From cee6be015203f7fd42078f48c3f1dc4a6ddc902a Mon Sep 17 00:00:00 2001 From: Kelly Roberts Date: Thu, 1 Sep 2022 09:00:23 -0700 Subject: [PATCH] better version with transition --- .local/bin/nightlight | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.local/bin/nightlight b/.local/bin/nightlight index 8684a7f5..a324d07a 100755 --- a/.local/bin/nightlight +++ b/.local/bin/nightlight @@ -1,13 +1,18 @@ #!/bin/sh -# toggle for a "nightlight" color temperature # requires xsct +# toggle for a "nightlight" color temperature +# edit value of settemp to your desired color temperature (minimum is 700) ifinstalled "xsct" || exit + +settemp="2700" colortemp="$(xsct | cut -d' ' -f5)" if [ "$colortemp" -ge "6500" ]; then - xsct 2700 && notify-send "🌙 Night Light On" + notify-send "🌙 Night Light Enabled (${settemp}K)" + for i in $(seq 6500 -100 ${settemp}); do xsct $i; sleep 0.1; done else - xsct 0 && notify-send "☀️ Night Light Off" + notify-send "☀️ Night Light Disabled" + for i in $(seq ${settemp} 100 6500); do xsct $i; sleep 0.1; done fi