sketchybar: init
This commit is contained in:
parent
ded82a8f8b
commit
ae71080920
10 changed files with 182 additions and 96 deletions
|
|
@ -4,7 +4,7 @@
|
|||
# For a (much) more advanced configuration example see my dotfiles:
|
||||
# https://github.com/FelixKratz/dotfiles
|
||||
|
||||
PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
|
||||
PLUGIN_DIR="$HOME/dots/stow/.config/sketchybar/plugins"
|
||||
|
||||
##### Bar Appearance #####
|
||||
# Configuring the general appearance of the bar.
|
||||
|
|
@ -13,120 +13,129 @@ PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
|
|||
# If you are looking for other colors, see the color picker:
|
||||
# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker
|
||||
|
||||
sketchybar --bar position=top \
|
||||
height=32 \
|
||||
blur_radius=30 \
|
||||
color=0x00000000 \
|
||||
padding_right=10 \
|
||||
padding_left=10 \
|
||||
y_offset=3
|
||||
sketchybar --bar position=top height=42 blur_radius=0 color=0x00000000 padding_right=15 padding_left=15 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=(
|
||||
icon.font="ComicShannsMono Nerd Font:Regular:11.0"
|
||||
label.font="ComicShannsMono Nerd Font:Bold:11.0"
|
||||
icon.font="ComicShannsMono Nerd Font:Regular:16.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
|
||||
icon.color=$PRIMARY_COLOUR
|
||||
label.color=$PRIMARY_COLOUR
|
||||
icon.color=$SECONDARY_COLOUR
|
||||
background.color=$BACKGROUND_COLOUR
|
||||
icon.padding_left=10
|
||||
icon.padding_right=1
|
||||
label.padding_left=5
|
||||
label.padding_right=10
|
||||
|
||||
background.padding_left=2
|
||||
background.padding_right=2
|
||||
background.corner_radius=10
|
||||
label.padding_left=7
|
||||
label.padding_right=7
|
||||
background.corner_radius=5
|
||||
)
|
||||
|
||||
sketchybar --default "${default[@]}"
|
||||
|
||||
##### Adding Mission Control Space Indicators #####
|
||||
# Let's 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.
|
||||
#
|
||||
# Adding Left Items
|
||||
#
|
||||
|
||||
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
|
||||
for i in "${!SPACE_ICONS[@]}"
|
||||
do
|
||||
sid="$(($i+1))"
|
||||
space=(
|
||||
icon.color=$PRIMARY_COLOUR
|
||||
background.color=$BACKGROUND_COLOUR
|
||||
# Focused window title
|
||||
sketchybar --add item front_app left \
|
||||
--set front_app icon=" " \
|
||||
script="$PLUGIN_DIR/front_app.sh" \
|
||||
--subscribe front_app front_app_switched \
|
||||
|
||||
space="$sid"
|
||||
icon="${SPACE_ICONS[i]}"
|
||||
icon.padding_left=12
|
||||
icon.padding_right=12
|
||||
background.height=32
|
||||
background.padding_left=0
|
||||
background.padding_right=0
|
||||
label.drawing=off
|
||||
script="$PLUGIN_DIR/space.sh"
|
||||
click_script="yabai -m space --focus $sid"
|
||||
)
|
||||
sketchybar --add space space."$sid" left --set space."$sid" "${space[@]}"
|
||||
# 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 \
|
||||
background.corner_radius=0 \
|
||||
label.color=$PRIMARY_COLOUR \
|
||||
label="$sid" \
|
||||
click_script="aerospace workspace $sid" \
|
||||
script="$CONFIG_DIR/plugins/aerospace.sh $sid"
|
||||
done
|
||||
|
||||
##### Adding Left Items #####
|
||||
# We add some regular items to the left side of the bar, where
|
||||
# only the properties deviating from the current defaults need to be set
|
||||
# Currently playing music status (only works for Music.app)
|
||||
sketchybar --add item music left \
|
||||
--set music icon=" " update_freq=10 \
|
||||
script="$PLUGIN_DIR/music.sh" \
|
||||
click_script="osascript -e 'tell application \"Music\" to playpause'" \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
background.drawing=false \
|
||||
background.color=$PRIMARY_COLOUR \
|
||||
icon.color=$BACKGROUND_COLOUR \
|
||||
label.color=$BACKGROUND_COLOUR \
|
||||
icon.drawing=false
|
||||
|
||||
#sketchybar --add item chevron left \
|
||||
# --set chevron icon= label.drawing=off \
|
||||
# --add item front_app left \
|
||||
# --set front_app icon.drawing=off script="$PLUGIN_DIR/front_app.sh" \
|
||||
# --subscribe front_app front_app_switched
|
||||
#
|
||||
# Adding Right Items
|
||||
#
|
||||
|
||||
sketchybar --add item front_app left \
|
||||
--set front_app icon.drawing=off \
|
||||
label.color=$PRIMARY_COLOUR \
|
||||
padding_left=10 \
|
||||
label.padding_left=10 \
|
||||
background.color=$BACKGROUND_COLOUR \
|
||||
background.height=32 \
|
||||
script="$PLUGIN_DIR/front_app.sh" \
|
||||
--subscribe front_app front_app_switched \
|
||||
|
||||
|
||||
|
||||
##### Adding Right Items #####
|
||||
|
||||
sketchybar --add item clock right \
|
||||
--set clock \
|
||||
update_freq=10 \
|
||||
icon.color=$PRIMARY_COLOUR \
|
||||
label.color=$PRIMARY_COLOUR \
|
||||
background.color=$BACKGROUND_COLOUR \
|
||||
background.height=32 \
|
||||
label.padding_right=20 \
|
||||
# Clock
|
||||
sketchybar --add item clock right \
|
||||
--set clock icon=" " \
|
||||
update_freq=10 \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
label.padding_right=20 \
|
||||
script="$PLUGIN_DIR/clock.sh"
|
||||
|
||||
sketchybar --add item battery right \
|
||||
--set battery update_freq=10 \
|
||||
script="$PLUGIN_DIR/battery.sh" \
|
||||
icon.color=$SECONDARY_COLOUR \
|
||||
label.color=$SECONDARY_COLOUR \
|
||||
background.color=$BACKGROUND_COLOUR \
|
||||
background.height=32 \
|
||||
# Input Method
|
||||
sketchybar --add item input-method right \
|
||||
--set input-method icon="" \
|
||||
update_freq=1 \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
script="$PLUGIN_DIR/input-method.sh"
|
||||
|
||||
sketchybar --add item backlight right \
|
||||
--set backlight icon="" \
|
||||
icon.color=$TERTIARY_COLOUR \
|
||||
label.color=$TERTIARY_COLOUR \
|
||||
background.color=$BACKGROUND_COLOUR \
|
||||
background.height=32 \
|
||||
script="$PLUGIN_DIR/backlight.sh" \
|
||||
--subscribe backlight brightness_change \
|
||||
# Battery
|
||||
sketchybar --add item battery right \
|
||||
--set battery update_freq=10 \
|
||||
script="$PLUGIN_DIR/battery.sh" \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
|
||||
sketchybar --add item audio right \
|
||||
--set audio icon = "" \
|
||||
icon.color=$TERTIARY_COLOUR \
|
||||
label.color=$TERTIARY_COLOUR \
|
||||
background.color=$BACKGROUND_COLOUR \
|
||||
background.height=32 \
|
||||
script="$PLUGIN_DIR/volume.sh" \
|
||||
--subscribe audio volume_change \
|
||||
# Backlight
|
||||
sketchybar --add item backlight right \
|
||||
--set backlight icon="" \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
script="$PLUGIN_DIR/backlight.sh" \
|
||||
--subscribe backlight brightness_change \
|
||||
|
||||
# Volume
|
||||
sketchybar --add item audio right \
|
||||
--set audio \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
script="$PLUGIN_DIR/volume.sh" \
|
||||
--subscribe audio volume_change \
|
||||
|
||||
# Wifi
|
||||
sketchybar --add item wifi right \
|
||||
--set wifi script="$PLUGIN_DIR/wifi.sh" \
|
||||
update_freq=60 \
|
||||
background.padding_right=0 \
|
||||
background.padding_left=0 \
|
||||
label.padding_left=0
|
||||
|
||||
##### Force all scripts to run the first time (never do this in a script) #####
|
||||
sketchybar --update
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue