I'm using i3wm with XFCE as my desktop environment. I've disable the default XFCE lockscreen (light-locker, I believe) in favor of my own locking script which uses i3lock-color, and I'm using xss-lock to trigger the locking script on lid close. The script itself (full script here) basically takes a screenshot, uses ImageMagick to pixellate the image and add a dark rectangle in the bottom left corner of the image (the rectangle provides extra contrast for the text that is overlaid by i3lock-color). Then it uses i3lock-color to lock the screen and display a clock, some text, etc.
When I run the script from the terminal, the result is as expected. The screen is locked with the correct image (including the dark rectangle).
However, after activating xss-lock with xss-lock -l /path/to/script/lock.sh
and then closing the lid, the script runs but the rectangle is not drawn, leading to sometimes unreadable lockscreen text.
I've tried modifying the script so that it doesn't delete the screenshot that it takes and edits, but the screenshot contains the dark rectangle. I think it's something weird with ImageMagick, since the pixellation and the rectangle drawing are specified in the same command, and the pixellation occurs but the rectangle drawing doesn't.
I'm very confused as to how this could occur. Neither journalctl
nor /var/log
display anything that looks related to this. Any help on where to begin debugging would be appreciated.
IFS=" " read -ra SRA <<<"${RES//[x+]/ }"
(see SC2206). If that doesn’t help substitute$rectangles
in line 39 with the values for your screen to debug – if it works it’s line 31 to 36 you need to check. Oh btw, doesn’txrandr
need theDISPLAY
variable set? That may not be the case withxss-lock
. I’d start by logging stdout and stderr output from this and the other lines constructing$rectangles
. – dessert Mar 21 '19 at 21:21$SR
. Thanks for your help! Also the script isn't mine, I basically copied it from here – theasianpianist Mar 22 '19 at 00:28