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

Use desktop wallpaper as i3lock image

asked Jul 17 '12

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?

4 answers

Sort by » oldest newest most voted
1

answered Jul 17 '12

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.

Comments

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)": http://ctkarch.org/documentation/tutorials/tuto.php?page=urxvt-transpa.xml So it sounds like it's not that impossible.

Atmoz gravatar imageAtmoz (Jul 17 '12)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 (Aug 2 '12)edit

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

Michael gravatar imageMichael (Aug 29 '12)edit
0

answered Jan 23 '13

dkeg gravatar image

updated Jan 23 '13

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

0

answered Aug 31 '12

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.

0

answered Aug 29 '12

sysadamin gravatar image

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

#!/bin/bash
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.

Comments

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 (Aug 29 '12)edit

Question Tools

Stats

Asked: Jul 17 '12

Seen: 7,315 times

Last updated: Jan 23 '13