From 2c485ce2b43bd810a88278215b771136a2a17881 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Wed, 11 Feb 2026 05:47:33 +0300 Subject: add scripts --- private_dot_local/bin/executable_waybar-sunset | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 private_dot_local/bin/executable_waybar-sunset (limited to 'private_dot_local/bin/executable_waybar-sunset') diff --git a/private_dot_local/bin/executable_waybar-sunset b/private_dot_local/bin/executable_waybar-sunset new file mode 100644 index 0000000..88c98f0 --- /dev/null +++ b/private_dot_local/bin/executable_waybar-sunset @@ -0,0 +1,64 @@ +#!/bin/sh + +start () +{ + wlsunset -l "59.8" -L "30.2" -t "3000" -T "6500" & +} + +stop () +{ + pkill -x wlsunset +} + +rotate () +{ + pkill -x -SIGUSR1 wlsunset +} + +update_waybar () +{ + pkill -x -SIGRTMIN+10 waybar +} + +is_active () +{ + pkill -x -0 wlsunset +} + +has_wlsunset () +{ + command -v wlsunset >/dev/null +} + +case "$1" in + 'start') + start + update_waybar + ;; + 'stop') + stop + update_waybar + ;; + 'toggle') + is_active && stop || start + update_waybar + ;; + 'rotate') + rotate + update_waybar + ;; + 'check') + has_wlsunset + exit $? + ;; +esac + +if is_active; then + alt="on" + tooltip="Stop/rotate wlsunset" +else + alt="off" + tooltip="Start wlsunset" +fi + +printf '{"alt":"%s","tooltip":"%s"}\n' "$alt" "$tooltip" -- cgit v1.3