initial commit

This commit is contained in:
2025-06-03 14:16:01 +03:00
commit 6fed9ef617
683 changed files with 109296 additions and 0 deletions

21
xss-lock/dim-screen2.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Fade the screen and wait. Needs xbacklight.
# When receiving SIGHUP, stop fading and set backlight to original brightness.
# When receiving SIGTERM, wait a bit, and set backlight to original brightness
# (this prevents the screen from flashing before it is turned completely off
# by DPMS in the locker command).
min_brightness=30
fade_time=2000
fade_steps=70
BRIGHTNESS=$(xbacklight -get)
trap "xbacklight -set $BRIGHTNESS" EXIT
trap 'kill %%; exit 0' HUP
trap 'sleep 1s; kill %%; exit 0' TERM
xbacklight -time $fade_time -steps $fade_steps -set $min_brightness &
wait
sleep infinity & # No, sleeping in the foreground does not work
wait