sketchybar
change
commit fe7763914e482de10643e2b5b594235c127ec86b
author Alpha Chen <alpha.chen@brilliant.org>
date
parent 31f024f5
diff --git a/.config/sketchybar/plugins/datetime.sh b/.config/sketchybar/plugins/datetime.sh
new file mode 100755
index 00000000..3c1d11cf
--- /dev/null
+++ b/.config/sketchybar/plugins/datetime.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+sketchybar --set "$NAME" label="$(date '+%m-%dT%H:%M')"
+
diff --git a/.config/sketchybar/plugins/network.sh b/.config/sketchybar/plugins/network.sh
new file mode 100755
index 00000000..86662876
--- /dev/null
+++ b/.config/sketchybar/plugins/network.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# source "$HOME/.config/colors.sh" # Loads all defined colors
+
+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"
diff --git a/.config/sketchybar/sketchybarrc b/.config/sketchybar/sketchybarrc
index c4ee9a19..a74c2f31 100755
--- a/.config/sketchybar/sketchybarrc
+++ b/.config/sketchybar/sketchybarrc
@@ -66,14 +66,20 @@ sketchybar --add item front_app left \
 # volume is registered. More info about the event system can be found here:
 # https://felixkratz.github.io/SketchyBar/config/events
 
-sketchybar --add item clock right \
-           --set clock update_freq=10 icon=  script="$PLUGIN_DIR/clock.sh" \
+sketchybar --add item datetime right \
+           --set datetime update_freq=30 icon=􀉉 script="$PLUGIN_DIR/datetime.sh" \
+           --add item wifi right \
+           --subscribe wifi wifi_change \
+           --set wifi \
+           label.drawing=off \
+           update_freq=30 \
+           script="$PLUGIN_DIR/network.sh" \
            --add item volume right \
            --set volume script="$PLUGIN_DIR/volume.sh" \
            --subscribe volume volume_change \
            --add item battery right \
            --set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \
-           --subscribe battery system_woke power_source_change
+           --subscribe battery system_woke power_source_change \
 
 ##### Force all scripts to run the first time (never do this in a script) #####
 sketchybar --update
diff --git a/.gitignore b/.gitignore
index f9c6cef8..1a063f25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@ private
 !.config/nvim
 !.config/neovide
 !.config/pip
+!.config/sketchybar
 !.config/starship.toml
 !.config/tridactyl
 !.config/wezterm