diff --git a/desktop/.config/waybar/config b/desktop/.config/waybar/config index 2ceff8a..e7f5bdb 100644 --- a/desktop/.config/waybar/config +++ b/desktop/.config/waybar/config @@ -8,8 +8,8 @@ "format-alt": "{} {icon}", "format-alt-click": "click-right", "format-icons": { - "idle-disabled": "󰾫 ", - "idle-enabled": "󰅶 " + "idle-disabled": "󰅶 ", + "idle-enabled": "󰾫 " }, "exec": "~/.config/waybar/modules/keepawake", "on-click": "~/.config/waybar/modules/keepawake toggle", diff --git a/desktop/.config/waybar/modules/keepawake b/desktop/.config/waybar/modules/keepawake index bbb78d1..b73ebb8 100755 --- a/desktop/.config/waybar/modules/keepawake +++ b/desktop/.config/waybar/modules/keepawake @@ -13,14 +13,18 @@ if [ "$cmd" != "" ]; then if [ "$cmd" = "start" ] || [ "$cmd" = "toggle" ] && [ "$status" = "idle-disabled" ]; then SVDIR="$USER_SV_DIR" sv start swayidle + status="idle-enabled" elif [ "$cmd" = "stop" ] || [ "$cmd" = "toggle" ] && [ "$status" = "idle-enabled" ]; then SVDIR="$USER_SV_DIR" sv stop swayidle + status="idle-disabled" fi + printf "{\"text\": \"\", \"alt\": \"%s\", \"tooltip\": \"\", \"class\": \"\"}" \ + "$status" + exit fi -pid=$(pgrep -x swayidle) status="idle-disabled" -if [ "$pid" != "" ]; then +if pgrep -x swayidle >/dev/null; then status="idle-enabled" fi