aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/darkroom
blob: 28e2589766dfb95f8a627660c4c6abbfdc60a05b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

SCREENS="`xrandr | grep ' connected ' | cut -f1 -d' '`"

mxr() {
	for screen in $SCREENS; do
		xrandr --output "$screen" $@
	done
}

if [ -e "$XDG_CACHE_HOME/darkroom" ]; then
	rm -f "$XDG_CACHE_HOME/darkroom"
	mxr --gamma '1:1:1'
else
	mkdir -p "$XDG_CACHE_HOME"
	touch "$XDG_CACHE_HOME/darkroom"
	killall -q redshift # redshift hijacks gamma
	mxr --gamma '1:0.0001:0.0001'
	lights darkroom
fi