i3lock-fancy icon indicating copy to clipboard operation
i3lock-fancy copied to clipboard

Script fails, can't locate files

Open nsapp opened this issue 6 years ago • 10 comments
trafficstars

When trying to run the script, I get

convert: unable to open image '/usr/share/i3lock-fancy/icons/lock.png': No such file or directory @ error/blob.c/OpenBlob/3485. convert: no images defined `/tmp/tmp.OUclQpvXEQ.png' @ error/convert.c/ConvertImageCommand/3300.

I'm using Arch Linux, and installed using the PKGBUILD file included when cloning from the AUR.

nsapp avatar Feb 07 '19 19:02 nsapp

I am investigating this and it looks like this happens because something creates an empty output image file (/tmp/tmp.OUclQpvXEQ.png) before scrot is invoked. Scrot then won't write (unless -o is given) and therefore convert complains about it not being able to do something on an empty file.

Enteee avatar Aug 31 '19 11:08 Enteee

ah wait got it, mktemp obviously creates the empty file. So the fix for this should be as simple as adding -o when we call scrot.

Enteee avatar Aug 31 '19 11:08 Enteee

The linked commit https://github.com/resurrecting-open-source-projects/scrot/commit/489e3229045962be2f63535ecd70cd15e6e2414d caused this to happen.

Enteee avatar Aug 31 '19 11:08 Enteee

Ah hang on, i just realized that this error might not be related. I am so sorry, i was facing a different issue which i fixed with the linked pr in nixpkgs. You probably see this issue because something deleted /usr/share/i3lock-fancy/icons/lock.png on your system.

so what does file /usr/share/i3lock-fancy/icons/lock.png print ?

Enteee avatar Aug 31 '19 12:08 Enteee

@Enteee : I guess the problem is the same is the one I faced. If PREFIX is different that /usr, this will happen. I created a hacky solution to have it working, but I can create a cleaner one if needed be: https://github.com/JimmyDurandWesolowski/i3lock-fancy/commit/bf78dfbe1c4667e5e5b20ea35fc3176102da6ed7

JimmyDurandWesolowski avatar Jan 31 '20 17:01 JimmyDurandWesolowski

I have problem like this. When i try lock screen, i see this: import: WriteBlob Failed /tmp/tmp.CcnSlUmZA4.png' @ error/png.c/MagickPNGErrorHandler/1715. Also, privileges is 777 on /tmp, because i can free create a file by myself, but even root can't run i3lock-fancy normally (Although this is a bad idea). I use arch linux too.

Hm... I monitoring /tmp (watch ls /tmp) and i see, what file really created, but after one short moment just disappears

I think, i don't need create new issue? Thank you!

VladislavNekto avatar Mar 31 '20 10:03 VladislavNekto

@VladislavNekto You error seems similar, but the root cause appears to be different. Can you try to create an empty file, and copy a file in /tmp, for example?

touch /tmp/test
cp ~/.bashrc /tmp

JimmyDurandWesolowski avatar Mar 31 '20 14:03 JimmyDurandWesolowski

@JimmyDurandWesolowski, No problems.

VladislavNekto avatar Apr 03 '20 04:04 VladislavNekto

Oh, okay. After new update it's work perfect. Thank anyway.

VladislavNekto avatar Apr 03 '20 05:04 VladislavNekto

@Enteee : I guess the problem is the same is the one I faced. If PREFIX is different that /usr, this will happen. I created a hacky solution to have it working, but I can create a cleaner one if needed be: JimmyDurandWesolowski@bf78dfb

i3lock-fancy should not hardcode the paths, but have them replaced by m4 in the Makefile.

AladW avatar Jun 25 '20 16:06 AladW