Install hooks executable
[gregoa/zavai.git] / hooks / display
1 #!/bin/sh
2 case "$1" in
3         # At the start of zavai
4         init)
5                 xset dpms 0 0 30
6                 echo 30 > ~/.zavai/blank-timeout
7         ;;
8         # When setting the display to always on
9         lock_on)
10                 xset dpms force on
11                 xset dpms 0 0 0
12                 echo 0 > ~/.zavai/blank-timeout
13         ;;
14         # When locking the screen with the backlight allowed to fade
15         lock_off)
16                 xset dpms force off
17                 xset dpms 0 0 5
18                 echo 5 > ~/.zavai/blank-timeout
19         ;;
20         # Temporarily turn on (for example, to read the time)
21         wiggle)
22                 xset dpms force on
23                 xset dpms 0 0 `cat ~/.zavai/blank-timeout`
24         ;;
25         defaults)
26                 xset dpms force on
27                 xset dpms 0 0 30
28                 echo 30 > ~/.zavai/blank-timeout
29         ;;
30         *)
31                 echo "Invalid option '$1'." >&2
32                 exit 1
33         ;;
34 esac
35
36 exit 0