mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-23 18:28:34 +02:00
lock: avoid race condition with xbacklight
This commit is contained in:
parent
8dc196e60d
commit
83c49d1222
1 changed files with 4 additions and 3 deletions
|
@ -13,11 +13,12 @@ case "$1" in
|
|||
dim)
|
||||
echo "$me: dim: start"
|
||||
trap 'exit 0' TERM INT
|
||||
trap "xbacklight -steps 1 -set $(xbacklight -get); kill %%" EXIT
|
||||
trap "kill %% ; wait ; xbacklight -steps 1 -set $(xbacklight -get)" EXIT
|
||||
min_brightness=0
|
||||
fade_time=$(($notify * 800))
|
||||
fade_time=$(($notify * 1000))
|
||||
fade_steps=100
|
||||
xbacklight -time $fade_time -steps $fade_steps -set $min_brightness
|
||||
xbacklight -time $fade_time -steps $fade_steps -set $min_brightness &
|
||||
wait
|
||||
echo "$me: dim: end"
|
||||
sleep 2147483647 &
|
||||
wait
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue