From b4c3c76cbf940fb0d764f057ac5d35b82959715e Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sun, 3 Jan 2021 09:29:27 -0800 Subject: [PATCH] add notifications to screensaver toggle --- .config/sway/config | 2 +- bin/idle | 9 ++++++++- bin/noidle | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 639fc4b..3e205e7 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -203,7 +203,7 @@ bindsym $mod+r mode "resize" # screen lock bindsym $mod+Mod1+l exec "$lock -f" bindsym Scroll_Lock exec "$lock -f" -bindsym $mod+Scroll_Lock exec pkill swayidle +bindsym $mod+Scroll_Lock exec /home/thrrgilag/bin/noidle bindsym $mod+Mod1+Scroll_Lock exec /home/thrrgilag/bin/idle # screenshots diff --git a/bin/idle b/bin/idle index 61b8c7b..9b3aa51 100755 --- a/bin/idle +++ b/bin/idle @@ -9,4 +9,11 @@ swayidle -w \ timeout ${SLEEP_TMOUT} 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ before-sleep "swaylock -f -i ${BACKGROUND}" & - +pgrep swayidle +RT=$? +if [ $RT -eq 0 ] +then + notify-send -t 1000 idle "Screensaver enabled" +else + notify-send idle "Unable to enable screensaver" +fi diff --git a/bin/noidle b/bin/noidle index 9f02d50..0c969bb 100755 --- a/bin/noidle +++ b/bin/noidle @@ -1,2 +1,9 @@ #!/bin/bash pkill swayidle +RT=$? +if [ $RT -eq 0 ] +then + notify-send -t 1000 noidle "Screensaver disabled" +else + notify-send noidle "Unable to disable screensaver" +fi