~charles/dotfiles

ref: c7fd4474610306d468857a1890fc952023b4163b dotfiles/overlay/bin/configure-dpms -rwxr-xr-x 668 bytes
c7fd4474Charles Daniels setup xfce terminal gruvbox theme 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

set -e
set -u

# Configure DPMS settings to one of several profiles

CONFIGURATION="$1"

echo "Setting DPMS configuration to $CONFIGURATION"

# not sure this does much on modern systems, but in theory it turns of the
# bell, whatever that is.
xset b off

case "$CONFIGURATION" in
	docked)
		# 15 * 60 = 900
		# 30 * 60 = 1800
		# 45 * 60 = 2700
		xset dpms 900 1800 2700
		;;
	undocked)
		# 3 * 60 = 180
		# 6 * 60 = 360
		# 9 * 60 = 540
		xset dpms 180 360 540
		;;
	nosleep)
		echo "monitor will never sleep, remember to re-enable sleep when you are done"
		xset dpms 0 0 0
		;;
	*)
		echo "Invalid DPMS configuration '$CONFIGURATION'"
		exit 1
		;;
esac