From d2b62c9d6f30a0ea88b2a235cde120cd10ba332b Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Sat, 11 Jul 2026 22:14:43 -0400 Subject: Sketchybar now, got tired of the battery issue --- .../modules/sketchybar/bar-config/sketchybarrc | 172 +++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100755 users/ryan/modules/sketchybar/bar-config/sketchybarrc (limited to 'users/ryan/modules/sketchybar/bar-config/sketchybarrc') diff --git a/users/ryan/modules/sketchybar/bar-config/sketchybarrc b/users/ryan/modules/sketchybar/bar-config/sketchybarrc new file mode 100755 index 0000000..446da25 --- /dev/null +++ b/users/ryan/modules/sketchybar/bar-config/sketchybarrc @@ -0,0 +1,172 @@ +#!/usr/bin/env bash +# ============================================================================ +# sketchybarrc — translated from a Hyprland/Waybar config +# Layout, fonts and colours mirror the original Waybar config + style.css. +# ============================================================================ +CONFIG_DIR="$HOME/.config/sketchybar" +PLUGIN_DIR="$CONFIG_DIR/plugins" +source "$CONFIG_DIR/colors.sh" +source "$CONFIG_DIR/icons.sh" + +env + +FONT="AnonymicePro Nerd Font" + +# ---- bar -------------------------------------------------------------------- +# From #waybar { background: rgba(0,0,0,0.25) } and Waybar height:30, position:top +sketchybar --bar \ + height=32 \ + position=top \ + color=$BAR_COLOR \ + padding_left=8 \ + padding_right=8 \ + corner_radius=0 \ + border_width=0 \ + shadow=off + +# ---- defaults --------------------------------------------------------------- +# From * { color:white; font: AnonymicePro Nerd Font 15px; no radius/shadow } +sketchybar --default \ + updates=when_shown \ + icon.font="$FONT:Regular:15.0" \ + icon.color=$TEXT \ + icon.padding_left=4 \ + icon.padding_right=4 \ + label.font="$FONT:Regular:15.0" \ + label.color=$TEXT \ + label.padding_left=4 \ + label.padding_right=4 \ + background.corner_radius=0 \ + background.height=32 + +# ---- popup helper ----------------------------------------------------------- +# add_popup : attaches a hover "tooltip" popup + a .details child +# (styled with POPUP_BG from window#waybar.solo) and subscribes to hover events. +add_popup() { + sketchybar --set "$1" \ + popup.background.color=$POPUP_BG \ + popup.background.corner_radius=0 \ + popup.background.border_width=0 \ + popup.horizontal=off \ + popup.y_offset=-1 \ + --subscribe "$1" mouse.entered mouse.exited + sketchybar --add item "$1.details" "popup.$1" \ + --set "$1.details" icon.drawing=off \ + label.font="$FONT:Regular:13.0" \ + label.padding_left=12 label.padding_right=12 \ + background.height=24 +} + +# ============================================================================ +# LEFT — hyprland/workspaces -> yabai spaces +# (hyprland/submap has no yabai/macOS analog -> omitted) +# ============================================================================ +for sid in 1 2 3 4 5 6 7 8 9 10; do + sketchybar --add space space.$sid left \ + --set space.$sid \ + space=$sid \ + icon=$sid \ + icon.color=$TEXT_DIM \ + icon.highlight_color=$TEXT \ + label.drawing=off \ + background.drawing=off \ + padding_left=5 padding_right=5 \ + script="$PLUGIN_DIR/space.sh" \ + click_script="yabai -m space --focus $sid 2>/dev/null" +done + +# ============================================================================ +# CENTER — hyprland/window -> front_app +# ============================================================================ +sketchybar --add item front_app center \ + --set front_app \ + icon.drawing=off \ + label.max_chars=80 \ + label.padding_left=10 label.padding_right=10 \ + script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched + +# ============================================================================ +# RIGHT — added right-to-left so the visual order matches Waybar's list: +# spotify weather mail storage brightness bluetooth volume network +# caffeinate battery clock +# ============================================================================ + +# clock (rightmost) — Waybar {:%a %d %b %H:%M} +sketchybar --add item clock right \ + --set clock update_freq=1 icon.drawing=off \ + label.padding_left=10 label.padding_right=16 \ + script="$PLUGIN_DIR/clock.sh" + +# battery (BAT0). Waybar battery#num2 (BAT1) omitted — Macs have one battery. +sketchybar --add item battery right \ + --set battery update_freq=60 icon.drawing=off \ + script="$PLUGIN_DIR/battery.sh" \ + --subscribe battery power_source_change system_woke +add_popup battery + +# idle_inhibitor -> caffeinate +sketchybar --add item caffeinate right \ + --set caffeinate update_freq=15 \ + script="$PLUGIN_DIR/caffeinate.sh" \ + click_script="$PLUGIN_DIR/caffeinate.sh toggle" + +# network +sketchybar --add item network right \ + --set network update_freq=5 icon.drawing=off \ + click_script="open -a 'System Settings' 2>/dev/null" \ + script="$PLUGIN_DIR/network.sh" +add_popup network + +# pulseaudio -> volume (native volume_change event) +sketchybar --add item volume right \ + --set volume icon.drawing=off script="$PLUGIN_DIR/volume.sh" \ + --subscribe volume volume_change mouse.scrolled + +# bluetooth (needs blueutil) +sketchybar --add item bluetooth right \ + --set bluetooth update_freq=30 icon.drawing=off \ + click_script="$PLUGIN_DIR/bluetooth.sh toggle" \ + script="$PLUGIN_DIR/bluetooth.sh" +add_popup bluetooth + +# backlight -> brightness (needs the `brightness` CLI; hides itself if absent) +sketchybar --add item brightness right \ + --set brightness update_freq=10 icon.drawing=off \ + script="$PLUGIN_DIR/brightness.sh" \ + --subscribe brightness mouse.scrolled + +# custom/storage +sketchybar --add item storage right \ + --set storage update_freq=60 icon.drawing=off \ + script="$PLUGIN_DIR/storage.sh" +add_popup storage + +# custom/mail (Mail.app unread) +# sketchybar --add item mail right \ +# --set mail update_freq=60 icon.drawing=off \ +# click_script="open -a Mail" \ +# script="$PLUGIN_DIR/mail.sh" + +# custom/weather (wttr.in j2 -> condition icon + temp, hover popup as a "tooltip") +sketchybar --add item weather right \ + --set weather update_freq=1800 icon.drawing=off \ + click_script="open https://wttr.in" \ + script="$PLUGIN_DIR/weather.sh" +add_popup weather + +# custom/spotify (now playing via native media_change) +# sketchybar --add item spotify right \ +# --set spotify icon=$SPOTIFY icon.color=$TEXT drawing=off \ +# label.max_chars=30 scroll_texts=on \ +# click_script="$PLUGIN_DIR/spotify.sh toggle" \ +# script="$PLUGIN_DIR/spotify.sh" \ +# --subscribe spotify media_change + +# ---------------------------------------------------------------------------- +# Omitted (no SketchyBar / macOS analog): +# tray -> the macOS menu bar already renders status/menu-extra items +# privacy -> macOS shows camera/mic indicators natively in the menu bar +# ---------------------------------------------------------------------------- + +sketchybar --update -- cgit v1.3