sketchybar tailscale
change
commit c16e82d9778d7e253b2a5c0ee0a8dc26a7107087
author Alpha Chen <alpha@kejadlen.dev>
date
parent 36544f86
diff --git a/.config/sketchybar/plugins/tailscale.sh b/.config/sketchybar/plugins/tailscale.sh
new file mode 100755
index 00000000..79c3f896
--- /dev/null
+++ b/.config/sketchybar/plugins/tailscale.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if tailscale status --self; then
+	ICON=􀎡
+else
+	ICON=􀎥
+fi
+
+sketchybar --set "$NAME" icon="$ICON"
diff --git a/.config/sketchybar/plugins/wifi.sh b/.config/sketchybar/plugins/wifi.sh
index 86662876..6027f1d2 100755
--- a/.config/sketchybar/plugins/wifi.sh
+++ b/.config/sketchybar/plugins/wifi.sh
@@ -1,19 +1,11 @@
-#!/bin/sh
-
-# source "$HOME/.config/colors.sh" # Loads all defined colors
+#!/bin/bash
 
 IP_ADDRESS=$(scutil --nwi | grep address | sed 's/.*://' | tr -d ' ' | head -1)
 
 if [[ $IP_ADDRESS != "" ]]; then
-	COLOR=$BLUE
 	ICON=􀙇
-	LABEL=
 else
-	COLOR=$WHITE
 	ICON=􀙈
-	LABEL="Not Connected"
 fi
 
-sketchybar --set $NAME background.color=$COLOR \
-	icon=$ICON \
-	label="$LABEL"
+sketchybar --set $NAME icon=$ICON
diff --git a/.config/sketchybar/sketchybarrc b/.config/sketchybar/sketchybarrc
index f0fb213a..45c845ea 100755
--- a/.config/sketchybar/sketchybarrc
+++ b/.config/sketchybar/sketchybarrc
@@ -73,7 +73,13 @@ sketchybar --add item datetime right \
            --set wifi \
                  label.drawing=off \
                  update_freq=30 \
+                 click_script="open x-apple.systempreferences:com.apple.wifi-settings-extension" \
                  script="$PLUGIN_DIR/wifi.sh" \
+           --add item tailscale right \
+           --set tailscale \
+                 label.drawing=off \
+                 update_freq=30 \
+                 script="$PLUGIN_DIR/tailscale.sh" \
            --add item volume right \
            --set volume \
                  label.drawing=off \