xss-lock: tentative to use transparency to notify

This commit is contained in:
Vincent Bernat 2020-01-24 21:54:03 +01:00
parent c2128a109d
commit 78512cf93a

View file

@ -20,24 +20,21 @@ case "$1" in
;; ;;
dim|notify) dim|notify)
echo "notify: start" echo "notify: start"
redshift=$(systemctl --user show \ trap 'echo notify: user activity; kill %% 2> /dev/null; exit 0' HUP # user activity
--property MainPID \ trap 'echo notify: locker started; kill %% 2> /dev/null; exit 0' TERM # locker started
--value redshift@$(systemd-escape -- "$DISPLAY").service) for i in $(seq 1.0 -0.1 0.1); do
[ x$redshift = x ] || kill -STOP $redshift awesome-client <<EOF
trap "[ x$redshift = x ] || kill -CONT $redshift" EXIT for _, c in ipairs(client.get()) do
trap 'kill %% 2> /dev/null; exit 0' HUP # user activity if c:isvisible() then
trap 'sleep 0.2s; kill %% 2> /dev/null; exit 0' TERM # locker started c.opacity=$i
outputs=($(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p')) end
for i in $(seq 0.7 -0.01 0.1); do end
for out in ${outputs[@]}; do EOF
xrandr --output $out --brightness $i || \ sleep 0.2
outputs=("${outputs[@]/$out}")
done done
sleep 0.1
done
echo "notify: end"
sleep infinity & sleep infinity &
wait wait
echo "notify: end"
;; ;;
lock) lock)
# Something may have mendled with screensaver settings # Something may have mendled with screensaver settings