dotfiles/home/apps/sketchybar/sketchybarrc

89 lines
2.1 KiB
Text
Raw Normal View History

2024-05-31 03:10:39 +02:00
#!/usr/bin/env nu
2022-07-30 07:17:12 +02:00
# vim:fileencoding=utf-8:foldmethod=marker
2024-05-31 03:10:39 +02:00
let pluginDir = $env.HOME | path join ".config/sketchybar/plugins"
2022-07-30 07:17:12 +02:00
## bar appearance {{{
2024-05-31 03:10:39 +02:00
(sketchybar --bar
height=32
position=top
padding_left=5
padding_right=5
margin=5
corner_radius=10
2024-05-31 03:48:46 +02:00
border_width=0
2024-05-31 03:10:39 +02:00
hidden=off
topmost=off
y_offset=2)
2022-07-30 07:17:12 +02:00
2024-05-31 03:10:39 +02:00
# colors are managed separately in the colordummy.
# listens to theme_changed events, to swap between dark and light mode
2022-07-30 07:17:12 +02:00
sketchybar -m --add event theme_changed AppleInterfaceThemeChangedNotification
2024-05-31 03:10:39 +02:00
(sketchybar
--add item colordummy center
--set colordummy
drawing=off
$"script=($pluginDir)/colordummy.nu"
2023-02-10 09:13:56 +01:00
--subscribe colordummy theme_changed
2024-05-31 03:10:39 +02:00
)
2022-07-30 07:17:12 +02:00
##### Changing Defaults #####
2024-05-31 03:10:39 +02:00
(sketchybar --default
updates=when_shown
drawing=on
icon.font="Symbols Nerd Font:2048-em:18.0"
label.font="SF Pro:Regular:16.0"
label.padding_left=2
label.padding_right=2
icon.padding_left=2
2023-02-10 09:13:56 +01:00
icon.padding_right=2
2024-05-31 03:10:39 +02:00
)
2022-07-30 07:17:12 +02:00
# }}}
## left side of the bar {{{
# spaces for yabai wm
2024-05-31 03:10:39 +02:00
for $el in ["" "Ⅱ" "Ⅲ" "Ⅳ" "" "Ⅵ" "Ⅶ" "Ⅷ" "Ⅸ" ""] --numbered {
let i = $el.index + 1
(sketchybar
--add space $"space.($i)" left
--set $"space.($i)" $"associated_space=($i)"
$"icon=($el.item)"
icon.padding_left=8
icon.padding_right=8
background.padding_left=1
background.padding_right=1
background.height=32
label.drawing=off
$"script=($pluginDir)/space.nu"
$"click_script=yabai -m space --focus ($i)")
}
2022-07-30 07:17:12 +02:00
2024-05-31 03:10:39 +02:00
sketchybar -m --add event music_changed com.apple.Music.playerInfo
(sketchybar
--add item music left
--set music
$"script=($pluginDir)/music.nu"
label.y_offset=-1
--subscribe music music_changed
--add item clock right
--set clock
$"script=($pluginDir)/clock.nu"
update_freq=10
background.padding_right=4
--add alias "iStat Menus Status" right
icon.padding_left=0
icon.padding_right=0
--add alias "Little Snitch Agent" right
icon.padding_left=0
icon.padding_right=0
2024-05-31 03:48:46 +02:00
--add alias "Control Center,Battery" right
2024-05-31 03:10:39 +02:00
icon.padding_left=0
2023-02-10 09:13:56 +01:00
icon.padding_right=0
2024-05-31 03:10:39 +02:00
--add alias "Mullvad VPN" right
icon.padding_left=0
icon.padding_right=0
)
2022-07-30 07:17:12 +02:00
sketchybar --update