Repository navigation
Expand file tree
/
Copy pathexecutable_sketchybarrc
More file actions
202 lines (176 loc) · 9.08 KB
/
Copy pathexecutable_sketchybarrc
File metadata and controls
202 lines (176 loc) · 9.08 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# This is a demo config to show some of the most important commands more easily.
# This is meant to be changed and configured, as it is intentionally kept sparse.
# For a more advanced configuration example see my dotfiles:
# https://github.com/FelixKratz/dotfiles
# https://github.com/FelixKratz/SketchyBar/discussions/12?sort=top
# https://github.com/FelixKratz/dotfiles/blob/master/.config/sketchybar/sketchybarrc
source "$CONFIG_DIR/colors.sh" # Loads all defined colors
source "$CONFIG_DIR/icons.sh" # Loads all defined icons
# https://github.com/khaneliman/dotfiles/blob/main/dots/macos/yabai/home/.config/sketchybar/sketchybarrc
# Setting up and starting the helper process
source "$HOME/.config/sketchybar/helper/helper.sh"
# FONT="JetBrainsMono Nerd Font"
FONT="Maple Mono NF CN"
PLUGIN_DIR="$CONFIG_DIR/plugins"
##### Bar Appearance #####
# Configuring the general appearance of the bar, these are only some of the
# options available. For all options see:
# https://felixkratz.github.io/SketchyBar/config/bar
# If you are looking for other colors, see the color picker:
# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker
sketchybar --bar height=22 \
blur_radius=30 \
position=top \
sticky=off \
padding_left=10 \
padding_right=10 \
color=0x15ffffff
##### Changing Defaults #####
# We now change some default values that are applied to all further items
# For a full list of all available item properties see:
# https://felixkratz.github.io/SketchyBar/config/items
sketchybar --default icon.font="$FONT:Bold:17.0" \
icon.color=0xffffffff \
label.font="$FONT:Bold:14.0" \
label.color=0xffffffff \
padding_left=5 \
padding_right=5 \
label.padding_left=4 \
label.padding_right=4 \
icon.padding_left=4 \
icon.padding_right=4
##### Adding Mission Control Space Indicators #####
# Now we add some mission control spaces:
# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item
# to indicate active and available mission control spaces
# SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
#
# for i in "${!SPACE_ICONS[@]}"
# do
# sid=$(($i+1))
# sketchybar --add space space.$sid left \
# --set space.$sid space=$sid \
# icon=${SPACE_ICONS[i]} \
# background.color=0x44ffffff \
# background.corner_radius=5 \
# background.height=20 \
# background.drawing=off \
# label.drawing=off \
# script="$PLUGIN_DIR/space.sh" \
# click_script="yabai -m space --focus $sid"
# done
##### Adding Left Items #####
# We add some regular items to the left side of the bar
# only the properties deviating from the current defaults need to be set
# TODO yabai layout, prev_app
# https://github.com/FelixKratz/SketchyBar/discussions/12?sort=top#discussioncomment-6974258
# current_app: yabai -m query --windows --window | jq '.app'
# prev_app : yabai -m query --windows --window recent | jq '.app'
# sketchybar --add item space_separator left \
# --set space_separator icon= \
# padding_left=10 \
# padding_right=10 \
# label.drawing=off \
# \
sketchybar --add item front_app left \
--set front_app script="$PLUGIN_DIR/front_app.sh" \
icon.drawing=off \
--subscribe front_app front_app_switched
##### Adding Right Items #####
# In the same way as the left items we can add items to the right side.
# Additional position (e.g. center) are available, see:
# https://felixkratz.github.io/SketchyBar/config/items#adding-items-to-sketchybar
# Some items refresh on a fixed cycle, e.g. the clock runs its script once
# every 10s. Other items respond to events they subscribe to, e.g. the
# volume.sh script is only executed once an actual change in system audio
# volume is registered. More info about the event system can be found here:
# https://felixkratz.github.io/SketchyBar/config/events
# sketchybar --add item clock right \
# --set clock update_freq=10 \
# icon= \
# script="$PLUGIN_DIR/clock.sh" \
# \
# --add item wifi right \
# --set wifi script="$PLUGIN_DIR/wifi.sh" \
# icon= \
# --subscribe wifi wifi_change \
# \
# --add item volume right \
# --set volume script="$PLUGIN_DIR/volume.sh" \
# --subscribe volume volume_change \
# \
# --add item battery right \
# --set battery script="$PLUGIN_DIR/battery.sh" \
# update_freq=120 \
# --subscribe battery system_woke power_source_change \
clock=(
icon.drawing=off
icon.font="$FONT:Bold:14.0"
script="$PLUGIN_DIR/clock.sh"
update_freq=10
)
battery=(
icon.drawing=off
# label.drawing=off
script="$PLUGIN_DIR/battery.sh"
update_freq=120
updates=on
)
# Trigger the brew_udpate event when brew update or upgrade is run from cmdline
# e.g. via function in .zshrc
# icon= nf-fa-beer | https://www.nerdfonts.com/cheat-sheet
brew=(
icon=
icon.font="$FONT:Bold:14.0"
label=?
script="$PLUGIN_DIR/brew.sh"
update_freq=900
)
# cpu, memory: https://github.com/FelixKratz/SketchyBar/discussions/12?sort=top#discussioncomment-4623255
# FIXME No matching processes belonging to you were found\n ps: stdout: Broken pipe | /opt/homebrew/var/log/sketchybar/sketchybar.err.log
cpu_percent=(
icon="$CPU"
icon.color="$BLUE"
label=?
update_freq=4
mach_helper="$HELPER"
)
memory=(
icon="$MEMORY"
icon.color="$GREEN"
update_freq=15
script="$PLUGIN_DIR/ram.sh"
)
sketchybar --add item clock right \
--set clock "${clock[@]}" \
--subscribe clock system_woke \
\
--add item battery right \
--set battery "${battery[@]}" \
--subscribe battery system_woke power_source_change \
\
--add item cpu.percent right \
--set cpu.percent "${cpu_percent[@]}" \
\
--add item memory right \
--set memory "${memory[@]}" \
\
--add event brew_update \
--add item brew right \
--set brew "${brew[@]}" \
--subscribe brew brew_update
# https://github.com/FelixKratz/SketchyVim
# sketchybar --add item svim.mode right \
# --set svim.mode popup.align=right \
# icon= \
# icon.font="$FONT:Bold:28.0" \
# label.font="$FONT:Bold:13.0" \
# icon.color=0xffff6578 \
# script="sketchybar --set svim.mode popup.drawing=off" \
# --subscribe svim.mode front_app_switched window_focus \
# --add item svim.cmdline popup.svim.mode \
# --set svim.cmdline icon="Command: "
##### Finalizing Setup #####
# The below command is only needed at the end of the initial configuration to
# force all scripts to run the first time, it should never be run in an item script.
sketchybar --update