The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

i3lock: setting the image background in Ubuntu Precise

asked Sep 25 '12

anonymous user

Anonymous

updated Sep 26 '12

The version included in the Ubuntu Precise repository is "i3lock: version 2.2 (2011-11-06) © 2010-2011 Michael Stapelberg". This version does not seem to honor the '-i' option for setting a PNG image. (just in case, I tried with a JPG too, still no luck)

I've found in a question on this very faq website mentioned that in Fedora the '-i' is not compiled in. Is that the case for Precise too? (however, both the man page and the usage '--help' message have the '-i image.PNG' option shown as available).

Update: Actually i3lock works ok, but the problem lies with the Ubuntu default background file and is quite silly: I was attempting to set as image "/usr/share/backgrounds/warty-final-ubuntu.png" (which happens to be the default background used by Precise, the one I am currently using as background now and the only .png file in that directory, the others being .jpg). However, despite having a .png extension, that image file is actually a JPEG ... :| (a tiny warning on stderr that the image failed to load or is not a valid png could help in similar situations, but it's up to you)
Sorry for the noise.

Comments

There already was a message, but it only showed when you ran i3lock in debug mode. I just changed the code to print it always since I don’t see any reason for having that in debug mode only. Unfortunately, the message doesn’t give a good reason (like "you passed a JPEG file"), improvements welcome.

Michael gravatar imageMichael (Sep 26 '12)edit

Thanks. Any hint that something is wrong with the file is more than good enough and anyhow way better than no message.

Chris gravatar imageChris (Sep 26 '12)edit

Any reason why it can't be a JPEG image?

diegueus9 gravatar imagediegueus9 (May 8 '14)edit

1 answer

Sort by » oldest newest most voted
0

answered Sep 25 '12

Michael gravatar image

You can verify whether it should work by using

ldd $(which i3lock) | grep cairo

If that prints a line such as the following one, your version of i3lock has been compiled with cairo support:

libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f170526f000)

Note that the presence of the -i flag in the --help message should be a definitive indicator, too (unless the distribution messes with our source code).

Question Tools

Stats

Asked: Sep 25 '12

Seen: 2,357 times

Last updated: Sep 26 '12