aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/darkroom
diff options
context:
space:
mode:
Diffstat (limited to '.local/share/bin/darkroom')
-rwxr-xr-x.local/share/bin/darkroom18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/share/bin/darkroom b/.local/share/bin/darkroom
new file mode 100755
index 0000000..1860613
--- /dev/null
+++ b/.local/share/bin/darkroom
@@ -0,0 +1,18 @@
+#!/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' --brightness '1.0'
+else
+ mkdir -p "$XDG_CACHE_HOME"
+ touch "$XDG_CACHE_HOME/darkroom"
+ mxr --gamma '1:0.0001:0.0001' --brightness '-1.0'
+fi