From 0e622c6abaf5c8edceb9caeb27631f57f79355a5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 12 Nov 2023 20:08:01 +0100 Subject: [PATCH] Move swayidle script --- arch/stow/_scripts/.scripts/wlsunset.sh | 6 +++--- scripts/sunset.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) mode change 100755 => 100644 arch/stow/_scripts/.scripts/wlsunset.sh create mode 100755 scripts/sunset.sh diff --git a/arch/stow/_scripts/.scripts/wlsunset.sh b/arch/stow/_scripts/.scripts/wlsunset.sh old mode 100755 new mode 100644 index 84a7d69..f185115 --- a/arch/stow/_scripts/.scripts/wlsunset.sh +++ b/arch/stow/_scripts/.scripts/wlsunset.sh @@ -6,10 +6,10 @@ pid=$(pgrep wlsunset) if [[ -z ${pid} ]] ; then # Start wlsunset right away. - wlsunset -l 50 -L 4 -t 2500 & + wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & else # Currently stop wlsunset but restart in an hour. kill ${pid} - ~/.scripts/notify.sh 'Stopping sunset' 'Restarting in an hour' - at now +1 hours -f ~/.scripts/wlsunset.sh + notify-send 'Stopping sunset' 'Restarting in an hour' + at now +1 hours -f "${0}" fi diff --git a/scripts/sunset.sh b/scripts/sunset.sh new file mode 100755 index 0000000..f185115 --- /dev/null +++ b/scripts/sunset.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Script to disable for an hour or immediately continue wlsunset. 'Toggle' + +# Check if wlsunset is still running +pid=$(pgrep wlsunset) + +if [[ -z ${pid} ]] ; then + # Start wlsunset right away. + wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & +else + # Currently stop wlsunset but restart in an hour. + kill ${pid} + notify-send 'Stopping sunset' 'Restarting in an hour' + at now +1 hours -f "${0}" +fi