xss-lock: use a simpler process to dim display

Just set a low brightness.
This commit is contained in:
Vincent Bernat 2020-01-24 23:02:07 +01:00
parent 9910ae4c11
commit 80cd6d2c26
3 changed files with 13 additions and 5 deletions

View file

@ -20,9 +20,20 @@ case "$1" in
;;
dim|notify)
echo "notify: start"
redshift=$(systemctl --user show \
--property MainPID \
--value redshift@$(systemd-escape -- "$DISPLAY").service)
[ x$redshift = x ] || {
kill -STOP $redshift
trap "kill -CONT $redshift" EXIT
}
trap 'echo notify: user activity; kill %% 2> /dev/null; exit 0' HUP # user activity
trap 'echo notify: locker started; kill %% 2> /dev/null; exit 0' TERM # locker started
/usr/lib/xscreensaver/bsod &
outputs=($(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p'))
for out in ${outputs[@]}; do
xrandr --output $out --brightness 0.2
done
sleep infinity &
wait
echo "notify: end"
;;

View file

@ -13,9 +13,6 @@ awful.rules.rules = {
-- i3lock
{ rule = { name = "i3lock" },
properties = { ontop = true } },
-- Apple2
{ rule = { class = "BSOD" },
properties = { fullscreen = true, ontop = true, floating = true, sticky = true } },
-- Browser stuff
{ rule = { role = "browser" },
callback = function(c)

View file

@ -64,7 +64,7 @@ shifty.config.apps = {
intrusive = true, -- Display even on exclusive tags
},
{
match = { class = { "Key[-]mon", "BSOD" },
match = { class = { "Key[-]mon" },
role = { "pop[-]up" },
name = { "Firebug" },
instance = { "plugin[-]container", "exe" } },