The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

Use desktop wallpaper as i3lock image

asked 2012-07-17 11:12:17 +0000

Atmoz gravatar image

I want i3lock to show my current desktop wallpaper, without the need to set path manually every time I change the wallpaper. I know that I can use the -i /path/to/image option, but I don't know where X is storing the current wallpaper, if that even exists?

edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2012-07-17 14:24:39 +0000

Michael gravatar image

Wallpapers in X11 work by changing the root window contents. There is no (standard) way to recover the path where that image came from. Neither is there a way to tell i3lock to copy the root window contents. So, this is not possible.

edit flag offensive delete link more


The following tutorial for getting urxvt transparent says "[...] copies the wallpaper to the background of the terminal. (more exactly, the contents of Xorg's root window)": So it sounds like it's not that impossible.

Atmoz gravatar imageAtmoz ( 2012-07-17 14:51:11 +0000 )edit

True, but that would involve including background logic into i3 (copying the root window image). Or perhaps only into i3lock. In the first case I can't imagine it would get incorporated, while in the second perhaps its a possibility.

ab5tract gravatar imageab5tract ( 2012-08-02 14:59:23 +0000 )edit

No, it won’t be included. This should be done in a separate program or script.

Michael gravatar imageMichael ( 2012-08-29 12:02:19 +0000 )edit

answered 2013-01-23 13:45:44 +0000

dkeg gravatar image

updated 2013-01-23 13:48:12 +0000

This is what I did. As stated above using a screenshot will work. However, I did not want any activity on the scrot. I just took a scrot of a good lock back ground image as my wallpaper, with no active apps, and saved it in the .i3 directory. So when I call i3 lock

i3lock -i ~/.i3/lock_screen.png

I get a nice clean lock screen

edit flag offensive delete link more

answered 2012-08-31 13:19:28 +0000

lzap gravatar image

It depend's on your distribution, try to "locate wallpaper". Please note in Fedora the i3lock is not compiled with "-i" support, therefore you can't even load an image there.

edit flag offensive delete link more

answered 2012-08-29 04:52:03 +0000

sysadamin gravatar image

you could use a screenshot, inside a wrapper around i3lock - something like this:

scrot /tmp/screen_locked.png
i3lock -i /tmp/screen_locked2.png

save the file as an executable somewhere in your path, and that should do it.

edit flag offensive delete link more


although, apparently i shouldnt post at night. this will use your current desktop. perhaps add in a command to switch to a new desktop, then take the shot?

sysadamin gravatar imagesysadamin ( 2012-08-29 04:53:16 +0000 )edit

Question Tools


Asked: 2012-07-17 11:12:17 +0000

Seen: 7,318 times

Last updated: Jan 23 '13