diff --git a/dotfiles/config/taffybar/flake.lock b/dotfiles/config/taffybar/flake.lock index 443c0e99..4e265c5a 100644 --- a/dotfiles/config/taffybar/flake.lock +++ b/dotfiles/config/taffybar/flake.lock @@ -554,8 +554,8 @@ "xmonad-contrib": "xmonad-contrib" }, "locked": { - "lastModified": 1771379683, - "narHash": "sha256-849/9t0hXF1Xwv6ygMWoZFGKwZ3xNqUSk2bSm4jZi/E=", + "lastModified": 1771578172, + "narHash": "sha256-MOtI2hzDngvc2e+PhDDkUwQ0j6PlPwRKZOvcqt8cO04=", "path": "/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar", "type": "path" }, diff --git a/dotfiles/config/taffybar/imalison-taffybar.cabal b/dotfiles/config/taffybar/imalison-taffybar.cabal index 3f08c58a..24f498f0 100644 --- a/dotfiles/config/taffybar/imalison-taffybar.cabal +++ b/dotfiles/config/taffybar/imalison-taffybar.cabal @@ -19,7 +19,9 @@ executable taffybar , X11 , bytestring , containers + , directory , filepath + , gi-gdk3 , gi-gtk3 , gi-gdkpixbuf , gtk-sni-tray @@ -29,6 +31,7 @@ executable taffybar , hslogger , process , split + , status-notifier-item , text , time , taffybar>=3.2.0 diff --git a/dotfiles/config/taffybar/scripts/taffybar-restart b/dotfiles/config/taffybar/scripts/taffybar-restart index ecaa164d..1dc5e9d7 100755 --- a/dotfiles/config/taffybar/scripts/taffybar-restart +++ b/dotfiles/config/taffybar/scripts/taffybar-restart @@ -12,10 +12,11 @@ cd "$root" # `hyprctl` calls inside the bar work. if command -v hyprctl >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then if ! hyprctl monitors -j >/dev/null 2>&1; then + instances_json="$(hyprctl instances -j 2>/dev/null || true)" if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then - inst="$(hyprctl instances -j | jq -r --arg sock "$WAYLAND_DISPLAY" '.[] | select(.wl_socket == $sock) | .instance' | head -n1)" + inst="$(printf '%s\n' "$instances_json" | jq -r --arg sock "$WAYLAND_DISPLAY" '.[] | select(.wl_socket == $sock) | .instance' 2>/dev/null | head -n1 || true)" else - inst="$(hyprctl instances -j | jq -r '.[0].instance // empty')" + inst="$(printf '%s\n' "$instances_json" | jq -r '.[0].instance // empty' 2>/dev/null || true)" fi if [[ -n "${inst:-}" ]]; then diff --git a/dotfiles/config/taffybar/scripts/taffybar-run b/dotfiles/config/taffybar/scripts/taffybar-run index f9ebda62..b83919ec 100755 --- a/dotfiles/config/taffybar/scripts/taffybar-run +++ b/dotfiles/config/taffybar/scripts/taffybar-run @@ -9,10 +9,11 @@ cd "$root" # `hyprctl` calls inside the bar work. if command -v hyprctl >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then if ! hyprctl monitors -j >/dev/null 2>&1; then + instances_json="$(hyprctl instances -j 2>/dev/null || true)" if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then - inst="$(hyprctl instances -j | jq -r --arg sock "$WAYLAND_DISPLAY" '.[] | select(.wl_socket == $sock) | .instance' | head -n1)" + inst="$(printf '%s\n' "$instances_json" | jq -r --arg sock "$WAYLAND_DISPLAY" '.[] | select(.wl_socket == $sock) | .instance' 2>/dev/null | head -n1 || true)" else - inst="$(hyprctl instances -j | jq -r '.[0].instance // empty')" + inst="$(printf '%s\n' "$instances_json" | jq -r '.[0].instance // empty' 2>/dev/null || true)" fi if [[ -n "${inst:-}" ]]; then diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index d7658517..990a8e89 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit d7658517d9e7dfb072e15cb3f8503541b5dc450c +Subproject commit 990a8e891d60902eba2fd48cfecf229686140956 diff --git a/dotfiles/config/taffybar/taffybar.css b/dotfiles/config/taffybar/taffybar.css index a048055e..fe92d7b6 100644 --- a/dotfiles/config/taffybar/taffybar.css +++ b/dotfiles/config/taffybar/taffybar.css @@ -301,6 +301,15 @@ letter-spacing: 0.2px; } +.wakeup-debug label { + font-size: 10px; +} + +.wakeup-debug-hit { + background-color: rgba(255, 255, 255, 0.22); + border-radius: 5px; +} + /* ASUS platform profile widget */ .asus-profile { } diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index b2ef14c7..383573e8 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -501,6 +501,10 @@ sunLockWidget :: TaffyIO Gtk.Widget sunLockWidget = stackInPill "sun-lock" [simplifiedWlsunsetWidget, simplifiedScreenLockWidget] +wakeupDebugWidget :: TaffyIO Gtk.Widget +wakeupDebugWidget = + decorateWithClassAndBoxM "wakeup-debug" wakeupDebugWidgetNew + type SNIPriorityMap = M.Map String Int sniPriorityStateRelativePath :: FilePath @@ -676,6 +680,7 @@ endWidgetsForHost hostName = -- tray immediately left of it.) let baseEndWidgets = [ sniTrayWidget, + wakeupDebugWidget, audioWidget, ramSwapWidget, diskUsageWidget, @@ -686,6 +691,7 @@ endWidgetsForHost hostName = laptopEndWidgets = [ batteryNetworkWidget, sniTrayWidget, + wakeupDebugWidget, asusDiskUsageWidget, audioBacklightWidget, ramSwapWidget,