From 5b1d2d056ec846e47fdc259521513a06a70a7125 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 10 Dec 2022 14:21:27 +0100 Subject: update darkroom script and add `lights` script --- .local/share/bin/darkroom | 6 ++++-- .local/share/bin/lights | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 .local/share/bin/lights diff --git a/.local/share/bin/darkroom b/.local/share/bin/darkroom index 1860613..28e2589 100755 --- a/.local/share/bin/darkroom +++ b/.local/share/bin/darkroom @@ -10,9 +10,11 @@ mxr() { if [ -e "$XDG_CACHE_HOME/darkroom" ]; then rm -f "$XDG_CACHE_HOME/darkroom" - mxr --gamma '1:1:1' --brightness '1.0' + mxr --gamma '1:1:1' else mkdir -p "$XDG_CACHE_HOME" touch "$XDG_CACHE_HOME/darkroom" - mxr --gamma '1:0.0001:0.0001' --brightness '-1.0' + killall -q redshift # redshift hijacks gamma + mxr --gamma '1:0.0001:0.0001' + lights darkroom fi diff --git a/.local/share/bin/lights b/.local/share/bin/lights new file mode 100755 index 0000000..d76782f --- /dev/null +++ b/.local/share/bin/lights @@ -0,0 +1,5 @@ +#!/bin/sh +cmd="$1" +[[ -z "$cmd" ]] && cmd="toggle" +curl -X POST "$HASS_SERVER/api/webhook/$cmd" + -- cgit v1.2.3