diff options
Diffstat (limited to 'mac/.config/sketchybar.mon/sketchybar/plugins/front_app.sh')
| -rwxr-xr-x | mac/.config/sketchybar.mon/sketchybar/plugins/front_app.sh | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/mac/.config/sketchybar.mon/sketchybar/plugins/front_app.sh b/mac/.config/sketchybar.mon/sketchybar/plugins/front_app.sh new file mode 100755 index 0000000..fcae89d --- /dev/null +++ b/mac/.config/sketchybar.mon/sketchybar/plugins/front_app.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash + +# Source colors and icons for consistent theming +source "$CONFIG_DIR/colors.sh" +source "$CONFIG_DIR/icons.sh" + +# Get the current application +if [ "$SENDER" = "front_app_switched" ]; then + APP_NAME="$INFO" +else + APP_NAME=$(yabai -m query --windows --window | jq -r '.app' 2>/dev/null || echo "$(osascript -e 'tell application "System Events" to get name of first application process whose frontmost is true')") +fi + +# Icon mapping for common applications +case $APP_NAME in + "Cursor") + ICON="" + ;; + "Visual Studio Code") + ICON="" + ;; + "Slack") + ICON="" + ;; + "Discord") + ICON="" + ;; + "Google Chrome") + ICON="" + ;; + "Safari") + ICON="" + ;; + "Firefox") + ICON="" + ;; + "Terminal") + ICON="" + ;; + "iTerm2") + ICON="" + ;; + "Finder") + ICON="" + ;; + "Spotify") + ICON="" + ;; + "Music") + ICON="" + ;; + "Mail") + ICON="" + ;; + "Messages") + ICON="" + ;; + "FaceTime") + ICON="" + ;; + "Zoom") + ICON="" + ;; + "Notion") + ICON="" + ;; + "Obsidian") + ICON="" + ;; + "Xcode") + ICON="" + ;; + "Docker") + ICON="" + ;; + "Figma") + ICON="" + ;; + "Sketch") + ICON="" + ;; + "Photoshop") + ICON="" + ;; + "System Preferences") + ICON="" + ;; + "System Settings") + ICON="" + ;; + "Activity Monitor") + ICON="" + ;; + *) + # Default icon for unknown applications + ICON="" + ;; +esac + +# Update the front_app item +sketchybar --set "$NAME" icon="$ICON" \ + icon.color=$ACCENT_QUATERNARY \ + label="$APP_NAME" \ + label.color=$WHITE |
