From 07d294425a98ee5d1e22d03e2b24ae2c76e487c0 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sat, 23 Aug 2025 12:42:37 +0900 Subject: updates --- .../sketchybar/plugins/monitor_watcher.sh | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh (limited to 'mac/.config/sketchybar.mon/sketchybar/plugins/monitor_watcher.sh') 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 -- cgit v1.2.3