mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-28 04:20:03 +02:00
xss-lock: tentative to use transparency to notify
This commit is contained in:
parent
c2128a109d
commit
78512cf93a
1 changed files with 12 additions and 15 deletions
27
bin/xss-lock
27
bin/xss-lock
|
@ -20,24 +20,21 @@ 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 "[ x$redshift = x ] || kill -CONT $redshift" EXIT
|
||||
trap 'kill %% 2> /dev/null; exit 0' HUP # user activity
|
||||
trap 'sleep 0.2s; kill %% 2> /dev/null; exit 0' TERM # locker started
|
||||
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 || \
|
||||
outputs=("${outputs[@]/$out}")
|
||||
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
|
||||
for i in $(seq 1.0 -0.1 0.1); do
|
||||
awesome-client <<EOF
|
||||
for _, c in ipairs(client.get()) do
|
||||
if c:isvisible() then
|
||||
c.opacity=$i
|
||||
end
|
||||
end
|
||||
EOF
|
||||
sleep 0.2
|
||||
done
|
||||
sleep 0.1
|
||||
done
|
||||
echo "notify: end"
|
||||
sleep infinity &
|
||||
wait
|
||||
echo "notify: end"
|
||||
;;
|
||||
lock)
|
||||
# Something may have mendled with screensaver settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue