sketchybar: clean up file

This commit is contained in:
Nico 2025-10-28 20:51:58 +11:00
parent a89b7cfe62
commit 0de08d5891
Signed by: nico
SSH key fingerprint: SHA256:XuacYOrGqRxC3jVFjfLROn1CSvLz85Dec6N7O9Gwu/0

View file

@ -1,73 +1,42 @@
# vim: set filetype=sh : # vim: set filetype=sh :
# This is a demo config to showcase some of the most important commands.
# It is meant to be changed and configured, as it is intentionally kept sparse.
# For a (much) more advanced configuration example see my dotfiles:
# https://github.com/FelixKratz/dotfiles
PLUGIN_DIR="$HOME/dots/stow/.config/sketchybar/plugins" PLUGIN_DIR="$HOME/dots/stow/.config/sketchybar/plugins"
source $PLUGIN_DIR/../colours.sh # bar colours
##### Bar Appearance ##### sketchybar --bar \
# Configuring the general appearance of the bar. position=top \
# These are only some of the options available. For all options see: height=42 \
# https://felixkratz.github.io/SketchyBar/config/bar blur_radius=0 \
# If you are looking for other colors, see the color picker: color=0x00000000 \
# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker padding_right=15 \
padding_left=15 \
sketchybar --bar position=top height=42 blur_radius=0 color=0x00000000 padding_right=15 padding_left=15 y_offset=0 corner_radius=0 y_offset=0 \
corner_radius=0 \
source $PLUGIN_DIR/../colours.sh
##### Changing Defaults #####
# We now change some default values, which are applied to all further items.
# For a full list of all available item properties see:
# https://felixkratz.github.io/SketchyBar/config/items
default=( default=(
icon.font="ComicShannsMono Nerd Font:Regular:16.0" icon.font="ComicShannsMono Nerd Font:Regular:16.0"
label.font="ComicShannsMono Nerd Font:Bold:12.0" label.font="ComicShannsMono Nerd Font:Bold:12.0"
background.border_color=0x00000000
background.border_width=3
background.height=32
padding_left=1
padding_right=1
label.color=$PRIMARY_COLOUR label.color=$PRIMARY_COLOUR
icon.color=$SECONDARY_COLOUR icon.color=$SECONDARY_COLOUR
background.color=$BACKGROUND_COLOUR background.color=$BACKGROUND_COLOUR
background.corner_radius=$ROUNDING
background.border_color=0x00000000
background.border_width=3
background.height=32
background.padding_right=0
background.padding_left=0
icon.padding_left=10 icon.padding_left=10
icon.padding_right=1 icon.padding_right=1
label.padding_left=7 label.padding_left=7
label.padding_right=7 label.padding_right=7
background.corner_radius=$ROUNDING
) )
sketchybar --default "${default[@]}" sketchybar --default "${default[@]}"
# #
# Adding Left Items # Left Items
# #
# Aerospace workspace indicators
sketchybar --add event aerospace_workspace_change
for sid in $(aerospace list-workspaces --all); do
sketchybar --add item space.$sid left \
--subscribe space.$sid aerospace_workspace_change \
--set space.$sid \
background.color=$BACKGROUND_COLOUR \
background.drawing=true \
icon.drawing=false \
background.height=28 \
background.border_width=0 \
background.padding_right=0 \
background.padding_left=0 \
label.color=$PRIMARY_COLOUR \
label="$sid" \
click_script="aerospace workspace $sid" \
script="$CONFIG_DIR/plugins/aerospace.sh $sid"
done
# background.corner_radius=0 \
# Yabai Workspace Indictators # Yabai Workspace Indictators
# #
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9") SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9")
@ -77,9 +46,8 @@ do
space=( space=(
space="$sid" space="$sid"
icon="${SPACE_ICONS[i]}" icon="${SPACE_ICONS[i]}"
background.drawing=true \
icon.drawing=false \ icon.drawing=false \
background.height=28 \ background.height=29 \
background.border_width=0 \ background.border_width=0 \
background.padding_right=0 \ background.padding_right=0 \
background.padding_left=0 \ background.padding_left=0 \
@ -94,69 +62,56 @@ done
# Focused window title # Focused window title
sketchybar --add item front_app left \ sketchybar --add item front_app left \
--set front_app icon="󱂬 " \ script="$PLUGIN_DIR/front_app.sh" \
script="$PLUGIN_DIR/front_app.sh" \ --set front_app icon="󱂬 " \
--subscribe front_app front_app_switched \ --subscribe front_app front_app_switched \
# Currently playing music status (only works for Music.app) # Currently playing music status (only works for Music.app)
sketchybar --add item music left \ sketchybar --add item music left \
--set music icon="󰎇 " update_freq=10 \ --set music icon="󰎇 " update_freq=10 \
script="$PLUGIN_DIR/music.sh" \ script="$PLUGIN_DIR/music.sh" \
click_script="osascript -e 'tell application \"Music\" to playpause'" \ click_script="osascript -e 'tell application \"Music\" to playpause'" \
background.padding_right=0 \ scroll_texts=1 \
background.padding_left=0 \ label.max_chars=50 \
drawing=false \ label.scroll_duration=500 \
scroll_texts=1 \ background.color=$PRIMARY_COLOUR \
label.max_chars=50 \ icon.color=$BACKGROUND_COLOUR \
label.scroll_duration=500 \ label.color=$BACKGROUND_COLOUR \
background.color=$PRIMARY_COLOUR \ drawing=false
icon.color=$BACKGROUND_COLOUR \
label.color=$BACKGROUND_COLOUR \
drawing=false
# #
# Adding Right Items # Right Items
# #
# Clock # Clock
sketchybar --add item clock right \ sketchybar --add item clock right \
--set clock icon=" " \ --set clock icon=" " \
update_freq=10 \ update_freq=10 \
background.padding_right=0 \ label.padding_right=10 \
background.padding_left=0 \ script="$PLUGIN_DIR/clock.sh"
label.padding_right=10 \
script="$PLUGIN_DIR/clock.sh"
# Input Method # Input Method
sketchybar --add item input-method right \ sketchybar --add item input-method right \
--set input-method icon="" \ --set input-method icon="" \
update_freq=1 \ update_freq=1 \
background.padding_right=0 \ script="$PLUGIN_DIR/input-method.sh"
background.padding_left=0 \
script="$PLUGIN_DIR/input-method.sh"
# Battery # Battery
sketchybar --add item battery right \ sketchybar --add item battery right \
--set battery update_freq=10 \ --set battery update_freq=10 \
script="$PLUGIN_DIR/battery.sh" \ script="$PLUGIN_DIR/battery.sh" \
background.padding_right=0 \
background.padding_left=0 \
# Backlight # Backlight
sketchybar --add item backlight right \ sketchybar --add item backlight right \
--set backlight icon="" \ --set backlight icon="" \
background.padding_right=0 \ script="$PLUGIN_DIR/backlight.sh" \
background.padding_left=0 \ --subscribe backlight brightness_change \
script="$PLUGIN_DIR/backlight.sh" \
--subscribe backlight brightness_change \
# Volume # Volume
sketchybar --add item audio right \ sketchybar --add item audio right \
--set audio \ --set audio \
background.padding_right=0 \ script="$PLUGIN_DIR/volume.sh" \
background.padding_left=0 \ --subscribe audio volume_change \
script="$PLUGIN_DIR/volume.sh" \
--subscribe audio volume_change \
##### Force all scripts to run the first time (never do this in a script) ##### ##### Force all scripts to run the first time (never do this in a script) #####
sketchybar --update sketchybar --update