From 98ae22b400c310a811b9b5606b4d65a129edbdd6 Mon Sep 17 00:00:00 2001 From: iFargle Date: Mon, 28 Aug 2023 20:44:27 +0900 Subject: [PATCH] test --- .../hyprland/gruvbox/waybar/scripts/waybar-scripts.nix | 9 ++++----- .../desktops/hyprland/gruvbox/waybar/waybar-conf2.nix | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix index 49409ef3..b4b2427d 100644 --- a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix +++ b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix @@ -6,7 +6,6 @@ text = '' #!/usr/bin/env bash CLASS=`tailscale status --json | jq -r '.BackendState'` - TEXT="󰌆" # Known values: Running, Stopped # Expected Output: @@ -14,12 +13,12 @@ # Different $Class depending on if TS is running or not if [ $CLASS == "Running" ]; then IP=`tailscale status --json | jq -r '.TailscaleIPs[0]'` - ALT="IP: $IP" - printf '{"text": "%s", "class": "%s", "alt": "%s"}\n' "$TEXT" "$CLASS" "$ALT" + TOOLTIP="IP: $IP" + printf '{"class": "%s", "tooltip": "%s"}\n' "$CLASS" "$TOOLTIP" fi if [ $CLASS == "Stopped" ]; then - ALT="Tailscale is not running" - printf '{"text": "%s", "class": "%s", "alt": "%s"}\n' "$TEXT" "$CLASS" "$ALT" + TOOLTIP="Tailscale is not running" + printf '{"class": "%s", "tooltip": "%s"}\n' "$CLASS" "$TOOLTIP" fi ''; }; diff --git a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix index c4b39528..a9cc53c3 100644 --- a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix +++ b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix @@ -43,6 +43,10 @@ "exec-if": "pgrep tailscaled", "return-type": "json", "interval": 5 + format-icons = { + "Running" = "󰌆", + "Stopped" = "󰌊", + } }, "idle_inhibitor": { @@ -215,7 +219,7 @@ #battery.critical, #custom-tailscale.Stopped, #network.disconnected { - background-color: #fe8019; + background-color: #f2594b; } #battery.charging { color: #98971a;