mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-18 01:44:34 +02:00
xss-lock: dim instead of notify
Use xrandr. This doesn't require a backlight.
This commit is contained in:
parent
0ba52f0e03
commit
d5b72851ec
1 changed files with 12 additions and 5 deletions
17
bin/xss-lock
17
bin/xss-lock
|
@ -20,12 +20,19 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
dim|notify)
|
dim|notify)
|
||||||
echo "$(date --rfc-3339=seconds) $me: notify: start"
|
echo "$(date --rfc-3339=seconds) $me: notify: start"
|
||||||
trap 'exit 0' TERM INT
|
pkill -STOP redshift
|
||||||
trap "kill %% ; wait" EXIT
|
trap 'pkill -CONT redshift' EXIT
|
||||||
notify-send "Lock screen" -t $((notify * 1000)) \
|
trap 'kill %%; exit 0' HUP
|
||||||
"Screen will be locked in 10 seconds..."
|
trap 'sleep 1s; kill %%; exit 0' TERM
|
||||||
|
outputs=$(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p')
|
||||||
|
for i in $(seq 0.7 -0.01 0.1); do
|
||||||
|
for out in $outputs; do
|
||||||
|
xrandr --output $out --brightness $i
|
||||||
|
done
|
||||||
|
sleep 0.02
|
||||||
|
done
|
||||||
echo "$(date --rfc-3339=seconds) $me: notify: end"
|
echo "$(date --rfc-3339=seconds) $me: notify: end"
|
||||||
sleep 2147483647 &
|
sleep infinity &
|
||||||
wait
|
wait
|
||||||
;;
|
;;
|
||||||
lock)
|
lock)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue