google / xsecurelock

X11 screen lock utility with security in mind
Apache License 2.0
863 stars 65 forks source link

Saver image does not show in xmonad #177

Closed fleutot closed 9 months ago

fleutot commented 9 months ago

Trying to display an image while locked, I only get a black background.

It seems that the created background window is not created as xsecurelock expects it. This might be caused by my WM (xmonad) tiling the new window and probably resizing it:

$ XSECURELOCK_SAVER_IMAGE=/home/gauthier/Pictures/wallpapers/butterfly.jpg xsecurelock
2023-09-22T20:00:04Z 6373 xsecurelock: Got non-fatal X11 error: BadWindow (invalid Window parameter).
2023-09-22T20:00:04Z 6373 xsecurelock: Got non-fatal X11 error: BadWindow (invalid Window parameter).
2023-09-22T20:00:04Z 6373 xsecurelock: Got non-fatal X11 error: BadWindow (invalid Window parameter).

I tried to force xsecurelock windows to floating, by adding this to my xmonad config:

myManageHook = composeAll
    [ -- ...
    , className =? "xsecurelock"    --> doFloat
    -- ...
    ]

But that didn't help. That said, I'm not sure how I should try and identify that background window to make sure I actually force a float.

On the other hand, this might not be the cause of the black background at all, although it feels like it from the error messages.

I usually run compton, but the error remains after pkilling it.

fleutot commented 9 months ago

I don't know where I got that environment variable from, it doesn't seem to exist.

This works:

XSECURELOCK_LIST_VIDEOS_COMMAND='find ~/Videos/screenlock -type f' XSECURELOCK_GLOBAL_SAVER=~/bin/my_lock_saver xsecurelock

in combination with: