blob: 446da25ccc2eefb1481ab0509ccf7e6161e4c5f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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 <item>: attaches a hover "tooltip" popup + a <item>.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
|