Clean up, update configs to be actually useful now...

This commit is contained in:
Adriel Sand
2024-01-04 18:49:24 -08:00
parent 68d016d03e
commit c93f5d7caa
412 changed files with 4462 additions and 63004 deletions

View File

@@ -0,0 +1,44 @@
#!/bin/bash
POPUP_OFF='sketchybar --set apple.logo popup.drawing=off'
POPUP_CLICK_SCRIPT='sketchybar --set $NAME popup.drawing=toggle'
apple_logo=(
icon=$APPLE
icon.font="$FONT:Black:16.0"
icon.color=$GREEN
padding_right=15
label.drawing=off
click_script="$POPUP_CLICK_SCRIPT"
popup.height=35
)
apple_prefs=(
icon=$PREFERENCES
label="Preferences"
click_script="open -a 'System Preferences'; $POPUP_OFF"
)
apple_activity=(
icon=$ACTIVITY
label="Activity"
click_script="open -a 'Activity Monitor'; $POPUP_OFF"
)
apple_lock=(
icon=$LOCK
label="Lock Screen"
click_script="pmset displaysleepnow; $POPUP_OFF"
)
sketchybar --add item apple.logo left \
--set apple.logo "${apple_logo[@]}" \
\
--add item apple.prefs popup.apple.logo \
--set apple.prefs "${apple_prefs[@]}" \
\
--add item apple.activity popup.apple.logo \
--set apple.activity "${apple_activity[@]}" \
\
--add item apple.lock popup.apple.logo \
--set apple.lock "${apple_lock[@]}"

View File

@@ -0,0 +1,15 @@
#!/bin/bash
battery=(
script="$PLUGIN_DIR/battery.sh"
icon.font="$FONT:Regular:19.0"
padding_right=5
padding_left=0
label.drawing=off
update_freq=120
updates=on
)
sketchybar --add item battery right \
--set battery "${battery[@]}" \
--subscribe battery power_source_change system_woke

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Trigger the brew_udpate event when brew update or upgrade is run from cmdline
# e.g. via function in .zshrc
brew=(
icon=􀐛
label=?
padding_right=10
script="$PLUGIN_DIR/brew.sh"
)
sketchybar --add event brew_update \
--add item brew right \
--set brew "${brew[@]}" \
--subscribe brew brew_update

View File

@@ -0,0 +1,17 @@
#!/bin/bash
calendar=(
icon=cal
icon.font="$FONT:Black:12.0"
icon.padding_right=0
label.width=45
label.align=right
padding_left=15
update_freq=30
script="$PLUGIN_DIR/calendar.sh"
click_script="$PLUGIN_DIR/zen.sh"
)
sketchybar --add item calendar right \
--set calendar "${calendar[@]}" \
--subscribe calendar system_woke

53
.config/sketchybar/items/cpu.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
cpu_top=(
label.font="$FONT:Semibold:7"
label=CPU
icon.drawing=off
width=0
padding_right=15
y_offset=6
)
cpu_percent=(
label.font="$FONT:Heavy:12"
label=CPU
y_offset=-4
padding_right=15
width=55
icon.drawing=off
update_freq=4
mach_helper="$HELPER"
)
cpu_sys=(
width=0
graph.color=$RED
graph.fill_color=$RED
label.drawing=off
icon.drawing=off
background.height=30
background.drawing=on
background.color=$TRANSPARENT
)
cpu_user=(
graph.color=$BLUE
label.drawing=off
icon.drawing=off
background.height=30
background.drawing=on
background.color=$TRANSPARENT
)
sketchybar --add item cpu.top right \
--set cpu.top "${cpu_top[@]}" \
\
--add item cpu.percent right \
--set cpu.percent "${cpu_percent[@]}" \
\
--add graph cpu.sys right 75 \
--set cpu.sys "${cpu_sys[@]}" \
\
--add graph cpu.user right 75 \
--set cpu.user "${cpu_user[@]}"

View File

@@ -0,0 +1,30 @@
#!/bin/bash
FRONT_APP_SCRIPT='sketchybar --set $NAME label="$INFO"'
yabai=(
icon.width=0
label.width=0
script="$PLUGIN_DIR/yabai.sh"
icon.font="$FONT:Bold:16.0"
associated_display=active
)
front_app=(
icon.drawing=off
label.font="$FONT:Black:12.0"
associated_display=active
script="$FRONT_APP_SCRIPT"
)
sketchybar --add event window_focus \
--add event windows_on_spaces \
--add item yabai left \
--set yabai "${yabai[@]}" \
--subscribe yabai window_focus \
windows_on_spaces \
mouse.clicked \
\
--add item front_app left \
--set front_app "${front_app[@]}" \
--subscribe front_app front_app_switched

View File

@@ -0,0 +1,33 @@
#!/bin/bash
POPUP_CLICK_SCRIPT="sketchybar --set \$NAME popup.drawing=toggle"
github_bell=(
update_freq=180
icon=$BELL
icon.font="$FONT:Bold:15.0"
icon.color=$BLUE
label=$LOADING
label.highlight_color=$BLUE
popup.align=right
script="$PLUGIN_DIR/github.sh"
click_script="$POPUP_CLICK_SCRIPT"
)
github_template=(
drawing=off
background.corner_radius=12
padding_left=7
padding_right=7
icon.background.height=2
icon.background.y_offset=-12
)
sketchybar --add item github.bell right \
--set github.bell "${github_bell[@]}" \
--subscribe github.bell mouse.entered \
mouse.exited \
mouse.exited.global \
\
--add item github.template popup.github.bell \
--set github.template "${github_template[@]}"

View File

@@ -0,0 +1,59 @@
#!/bin/bash
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15")
# Destroy space on right click, focus space on left click.
# New space by left clicking separator (>)
sid=0
spaces=()
for i in "${!SPACE_ICONS[@]}"
do
sid=$(($i+1))
space=(
associated_space=$sid
icon="${SPACE_ICONS[i]}"
icon.padding_left=10
icon.padding_right=10
padding_left=2
padding_right=2
label.padding_right=20
icon.highlight_color=$RED
label.color=$GREY
label.highlight_color=$WHITE
label.font="sketchybar-app-font:Regular:16.0"
label.y_offset=-1
background.color=$BACKGROUND_1
background.border_color=$BACKGROUND_2
background.drawing=off
label.drawing=off
script="$PLUGIN_DIR/space.sh"
)
sketchybar --add space space.$sid left \
--set space.$sid "${space[@]}" \
--subscribe space.$sid mouse.clicked
done
spaces_bracket=(
background.color=$BACKGROUND_1
background.border_color=$BACKGROUND_2
)
separator=(
icon=􀆊
icon.font="$FONT:Heavy:16.0"
padding_left=10
padding_right=8
label.drawing=off
associated_display=active
click_script='yabai -m space --create && sketchybar --trigger space_change'
icon.color=$WHITE
)
sketchybar --add bracket spaces_bracket '/space\..*/' \
--set spaces_bracket "${spaces_bracket[@]}" \
\
--add item separator left \
--set separator "${separator[@]}"

View File

@@ -0,0 +1,197 @@
#!/bin/bash
SPOTIFY_EVENT="com.spotify.client.PlaybackStateChanged"
POPUP_SCRIPT="sketchybar -m --set spotify.anchor popup.drawing=toggle"
spotify_anchor=(
script="$PLUGIN_DIR/spotify.sh"
click_script="$POPUP_SCRIPT"
popup.horizontal=on
popup.align=center
popup.height=150
icon=􁁒
icon.font="$FONT:Regular:25.0"
label.drawing=off
drawing=off
y_offset=2
)
spotify_cover=(
script="$PLUGIN_DIR/spotify.sh"
click_script="open -a 'Spotify'; $POPUP_SCRIPT"
label.drawing=off
icon.drawing=off
padding_left=12
padding_right=10
background.image.scale=0.2
background.image.drawing=on
background.drawing=on
)
spotify_title=(
icon.drawing=off
padding_left=0
padding_right=0
width=0
label.font="$FONT:Heavy:15.0"
y_offset=55
)
spotify_artist=(
icon.drawing=off
y_offset=30
padding_left=0
padding_right=0
width=0
)
spotify_album=(
icon.drawing=off
padding_left=0
padding_right=0
y_offset=15
width=0
)
spotify_state=(
icon.drawing=on
icon.font="$FONT:Light Italic:10.0"
icon.width=35
icon="00:00"
label.drawing=on
label.font="$FONT:Light Italic:10.0"
label.width=35
label="00:00"
padding_left=0
padding_right=0
y_offset=-15
width=0
slider.background.height=6
slider.background.corner_radius=1
slider.background.color=$GREY
slider.highlight_color=$GREEN
slider.percentage=40
slider.width=115
script="$PLUGIN_DIR/spotify.sh"
update_freq=1
updates=when_shown
)
spotify_shuffle=(
icon=􀊝
icon.padding_left=5
icon.padding_right=5
icon.color=$BLACK
icon.highlight_color=$GREY
label.drawing=off
script="$PLUGIN_DIR/spotify.sh"
y_offset=-45
)
spotify_back=(
icon=􀊎
icon.padding_left=5
icon.padding_right=5
icon.color=$BLACK
script="$PLUGIN_DIR/spotify.sh"
label.drawing=off
y_offset=-45
)
spotify_play=(
icon=􀊔
background.height=40
background.corner_radius=20
width=40
align=center
background.color=$POPUP_BACKGROUND_COLOR
background.border_color=$WHITE
background.border_width=0
background.drawing=on
icon.padding_left=4
icon.padding_right=5
updates=on
label.drawing=off
script="$PLUGIN_DIR/spotify.sh"
y_offset=-45
)
spotify_next=(
icon=􀊐
icon.padding_left=5
icon.padding_right=5
icon.color=$BLACK
label.drawing=off
script="$PLUGIN_DIR/spotify.sh"
y_offset=-45
)
spotify_repeat=(
icon=􀊞
icon.highlight_color=$GREY
icon.padding_left=5
icon.padding_right=10
icon.color=$BLACK
label.drawing=off
script="$PLUGIN_DIR/spotify.sh"
y_offset=-45
)
spotify_controls=(
background.color=$GREEN
background.corner_radius=11
background.drawing=on
y_offset=-45
)
sketchybar --add event spotify_change $SPOTIFY_EVENT \
--add item spotify.anchor center \
--set spotify.anchor "${spotify_anchor[@]}" \
--subscribe spotify.anchor mouse.entered mouse.exited \
mouse.exited.global \
\
--add item spotify.cover popup.spotify.anchor \
--set spotify.cover "${spotify_cover[@]}" \
\
--add item spotify.title popup.spotify.anchor \
--set spotify.title "${spotify_title[@]}" \
\
--add item spotify.artist popup.spotify.anchor \
--set spotify.artist "${spotify_artist[@]}" \
\
--add item spotify.album popup.spotify.anchor \
--set spotify.album "${spotify_album[@]}" \
\
--add slider spotify.state popup.spotify.anchor \
--set spotify.state "${spotify_state[@]}" \
--subscribe spotify.state mouse.clicked \
\
--add item spotify.shuffle popup.spotify.anchor \
--set spotify.shuffle "${spotify_shuffle[@]}" \
--subscribe spotify.shuffle mouse.clicked \
\
--add item spotify.back popup.spotify.anchor \
--set spotify.back "${spotify_back[@]}" \
--subscribe spotify.back mouse.clicked \
\
--add item spotify.play popup.spotify.anchor \
--set spotify.play "${spotify_play[@]}" \
--subscribe spotify.play mouse.clicked spotify_change \
\
--add item spotify.next popup.spotify.anchor \
--set spotify.next "${spotify_next[@]}" \
--subscribe spotify.next mouse.clicked \
\
--add item spotify.repeat popup.spotify.anchor \
--set spotify.repeat "${spotify_repeat[@]}" \
--subscribe spotify.repeat mouse.clicked \
\
--add item spotify.spacer popup.spotify.anchor \
--set spotify.spacer width=5 \
\
--add bracket spotify.controls spotify.shuffle \
spotify.back \
spotify.play \
spotify.next \
spotify.repeat \
--set spotify.controls "${spotify_controls[@]}" \

View File

@@ -0,0 +1,45 @@
#!/bin/bash
volume_slider=(
script="$PLUGIN_DIR/volume.sh"
updates=on
label.drawing=off
icon.drawing=off
slider.highlight_color=$BLUE
slider.background.height=5
slider.background.corner_radius=3
slider.background.color=$BACKGROUND_2
slider.knob=􀀁
slider.knob.drawing=off
)
volume_icon=(
click_script="$PLUGIN_DIR/volume_click.sh"
padding_left=10
icon=$VOLUME_100
icon.width=0
icon.align=left
icon.color=$GREY
icon.font="$FONT:Regular:14.0"
label.width=25
label.align=left
label.font="$FONT:Regular:14.0"
)
status_bracket=(
background.color=$BACKGROUND_1
background.border_color=$BACKGROUND_2
)
sketchybar --add slider volume right \
--set volume "${volume_slider[@]}" \
--subscribe volume volume_change \
mouse.clicked \
mouse.entered \
mouse.exited \
\
--add item volume_icon right \
--set volume_icon "${volume_icon[@]}"
sketchybar --add bracket status brew github.bell volume_icon \
--set status "${status_bracket[@]}"