mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-03 17:54:31 +02:00
xss-lock: use a simpler process to dim display
Just set a low brightness.
This commit is contained in:
parent
9910ae4c11
commit
80cd6d2c26
3 changed files with 13 additions and 5 deletions
13
bin/xss-lock
13
bin/xss-lock
|
@ -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"
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue