summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
commit07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch)
treea6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh
parent6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff)
updates
Diffstat (limited to 'mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh')
-rwxr-xr-xmac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh b/mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh
new file mode 100755
index 0000000..50868d3
--- /dev/null
+++ b/mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# Source colors for consistent theming
+source "$CONFIG_DIR/colors.sh"
+
+# Store current monitor state to detect changes
+MONITOR_STATE_FILE="/tmp/aerospace_monitor_state"
+
+# Get current monitor state
+CURRENT_MONITORS=$(aerospace list-monitors | awk '{print $1}' | sort | tr '\n' ' ')
+
+# Check if state has changed
+if [ -f "$MONITOR_STATE_FILE" ]; then
+ PREVIOUS_MONITORS=$(cat "$MONITOR_STATE_FILE")
+ if [ "$CURRENT_MONITORS" != "$PREVIOUS_MONITORS" ]; then
+ # Monitor configuration changed, update display
+ "$CONFIG_DIR/plugins/aerospace_display.sh"
+ fi
+else
+ # First run, create state file
+ "$CONFIG_DIR/plugins/aerospace_display.sh"
+fi
+
+# Save current state
+echo "$CURRENT_MONITORS" > "$MONITOR_STATE_FILE" \ No newline at end of file