feat(sketchybar): simplify further
This commit is contained in:
parent
86091c0e15
commit
71c14a90c1
4 changed files with 27 additions and 154 deletions
|
@ -15,7 +15,7 @@ sketchybar --bar \
|
||||||
# to swap between Catppuccin Mocha and Latte
|
# to swap between Catppuccin Mocha and Latte
|
||||||
sketchybar -m --add event theme_changed AppleInterfaceThemeChangedNotification
|
sketchybar -m --add event theme_changed AppleInterfaceThemeChangedNotification
|
||||||
sketchybar \
|
sketchybar \
|
||||||
--add item colordummy left \
|
--add item colordummy center \
|
||||||
--set colordummy \
|
--set colordummy \
|
||||||
drawing=off \
|
drawing=off \
|
||||||
script="$PLUGIN_DIR/colordummy.sh" \
|
script="$PLUGIN_DIR/colordummy.sh" \
|
||||||
|
@ -26,26 +26,26 @@ sketchybar --default \
|
||||||
updates=when_shown \
|
updates=when_shown \
|
||||||
drawing=on \
|
drawing=on \
|
||||||
icon.font="Symbols Nerd Font:2048-em:18.0" \
|
icon.font="Symbols Nerd Font:2048-em:18.0" \
|
||||||
label.font="Inter:Regular:16.0" \
|
label.font="SF Pro:Regular:16.0" \
|
||||||
label.padding_left=1 \
|
label.padding_left=2 \
|
||||||
label.padding_right=1 \
|
label.padding_right=2 \
|
||||||
icon.padding_left=8 \
|
icon.padding_left=2 \
|
||||||
icon.padding_right=8
|
icon.padding_right=2
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
## left side of the bar {{{
|
## left side of the bar {{{
|
||||||
# spaces for yabai wm
|
# spaces for yabai wm
|
||||||
SPACE_ICONS=(
|
SPACE_ICONS=(
|
||||||
" "
|
"Ⅰ"
|
||||||
" "
|
"Ⅱ"
|
||||||
" "
|
"Ⅲ"
|
||||||
" "
|
"Ⅳ"
|
||||||
" "
|
"Ⅴ"
|
||||||
" "
|
"Ⅵ"
|
||||||
" "
|
"Ⅶ"
|
||||||
" "
|
"Ⅷ"
|
||||||
" "
|
"Ⅸ"
|
||||||
" "
|
"Ⅹ"
|
||||||
)
|
)
|
||||||
for i in "${!SPACE_ICONS[@]}"
|
for i in "${!SPACE_ICONS[@]}"
|
||||||
do
|
do
|
||||||
|
@ -63,29 +63,6 @@ do
|
||||||
click_script="yabai -m space --focus $((i+1))"
|
click_script="yabai -m space --focus $((i+1))"
|
||||||
done
|
done
|
||||||
|
|
||||||
# window title
|
|
||||||
sketchybar \
|
|
||||||
--add item window_title left \
|
|
||||||
--set window_title \
|
|
||||||
background.padding_left=8 \
|
|
||||||
script="$PLUGIN_DIR/window_title.sh" \
|
|
||||||
--subscribe window_title front_app_switched
|
|
||||||
## }}}
|
|
||||||
|
|
||||||
## middle of the bar {{{
|
|
||||||
# Apple Music Status
|
|
||||||
sketchybar -m --add event song_update com.apple.Music.playerInfo
|
|
||||||
sketchybar \
|
|
||||||
--add item music center \
|
|
||||||
--set music \
|
|
||||||
label.font="Victor Mono:Bold Italic:16.0" \
|
|
||||||
script="$PLUGIN_DIR/music.sh" \
|
|
||||||
--subscribe music song_update
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
## right side of the bar {{{
|
|
||||||
# this starts at the rightmost item
|
|
||||||
# items should be self explanatory by their name, and are separated by a blank line
|
|
||||||
sketchybar \
|
sketchybar \
|
||||||
\
|
\
|
||||||
--add item clock right \
|
--add item clock right \
|
||||||
|
@ -93,24 +70,10 @@ sketchybar \
|
||||||
script="$PLUGIN_DIR/clock.sh" \
|
script="$PLUGIN_DIR/clock.sh" \
|
||||||
update_freq=10 \
|
update_freq=10 \
|
||||||
lazy=true \
|
lazy=true \
|
||||||
\
|
|
||||||
--add item date right \
|
|
||||||
--set date \
|
|
||||||
script="$PLUGIN_DIR/ddate.sh" \
|
|
||||||
update_freq=60 \
|
|
||||||
lazy=true \
|
|
||||||
\
|
\
|
||||||
--add item mullvad right \
|
--add item mullvad right \
|
||||||
--set mullvad \
|
--set mullvad \
|
||||||
script="$PLUGIN_DIR/mullvad.sh" \
|
script="$PLUGIN_DIR/mullvad.sh" \
|
||||||
update_freq=30 \
|
update_freq=30
|
||||||
\
|
|
||||||
--add item battery right \
|
|
||||||
--set battery \
|
|
||||||
update_freq=30 \
|
|
||||||
script="$PLUGIN_DIR/battery.sh" \
|
|
||||||
lazy=true \
|
|
||||||
--subscribe battery system_woke
|
|
||||||
|
|
||||||
##### fin #####
|
|
||||||
sketchybar --update
|
sketchybar --update
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
sketchybar --set "$NAME" label="$(date '+%H:%M')" icon=" "
|
sketchybar --set "$NAME" label="$(date '+%m-%d %H:%M')"
|
||||||
|
|
|
@ -8,29 +8,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $THEME == 'dark' ]]; then
|
if [[ $THEME == 'dark' ]]; then
|
||||||
ROSEWATER="f2d5cf"
|
|
||||||
FLAMINGO="eebebe"
|
|
||||||
PINK="f4b8e4"
|
PINK="f4b8e4"
|
||||||
MAUVE="ca9ee6"
|
MAUVE="ca9ee6"
|
||||||
RED="e78284"
|
|
||||||
MAROON="ea999c"
|
|
||||||
PEACH="ef9f76"
|
|
||||||
YELLOW="e5c890"
|
|
||||||
GREEN="a6d189"
|
|
||||||
TEAL="81c8be"
|
|
||||||
SKY="99d1db"
|
|
||||||
SAPPHIRE="85c1dc"
|
|
||||||
BLUE="8caaee"
|
|
||||||
LAVENDER="babbf1"
|
|
||||||
TEXT="c6d0f5"
|
TEXT="c6d0f5"
|
||||||
SUBTEXT1="b5bfe2"
|
|
||||||
SUBTEXT0="a5adce"
|
|
||||||
OVERLAY2="949cbb"
|
|
||||||
OVERLAY1="838ba7"
|
|
||||||
OVERLAY0="737994"
|
|
||||||
SURFACE2="626880"
|
|
||||||
SURFACE1="51576d"
|
|
||||||
SURFACE0="414559"
|
|
||||||
BASE="303446"
|
BASE="303446"
|
||||||
MANTLE="292c3c"
|
MANTLE="292c3c"
|
||||||
CRUST="232634"
|
CRUST="232634"
|
||||||
|
@ -39,29 +19,9 @@ if [[ $THEME == 'dark' ]]; then
|
||||||
MANTLE="000000"
|
MANTLE="000000"
|
||||||
CRUST="000000"
|
CRUST="000000"
|
||||||
else
|
else
|
||||||
ROSEWATER="dc8a78"
|
|
||||||
FLAMINGO="dd7878"
|
|
||||||
PINK="ea76cb"
|
PINK="ea76cb"
|
||||||
MAUVE="8839ef"
|
MAUVE="8839ef"
|
||||||
RED="d20f39"
|
|
||||||
MAROON="e64553"
|
|
||||||
PEACH="fe640b"
|
|
||||||
YELLOW="df8e1d"
|
|
||||||
GREEN="40a02b"
|
|
||||||
TEAL="179299"
|
|
||||||
SKY="04a5e5"
|
|
||||||
SAPPHIRE="209fb5"
|
|
||||||
BLUE="1e66f5"
|
|
||||||
LAVENDER="7287fd"
|
|
||||||
TEXT="4c4f69"
|
TEXT="4c4f69"
|
||||||
SUBTEXT1="5c5f77"
|
|
||||||
SUBTEXT0="6c6f85"
|
|
||||||
OVERLAY2="7c7f93"
|
|
||||||
OVERLAY1="8c8fa1"
|
|
||||||
OVERLAY0="9ca0b0"
|
|
||||||
SURFACE2="acb0be"
|
|
||||||
SURFACE1="bcc0cc"
|
|
||||||
SURFACE0="ccd0da"
|
|
||||||
CRUST="dce0e8"
|
CRUST="dce0e8"
|
||||||
MANTLE="e6e9ef"
|
MANTLE="e6e9ef"
|
||||||
BASE="eff1f5"
|
BASE="eff1f5"
|
||||||
|
@ -72,29 +32,9 @@ function color() {
|
||||||
color="$1"
|
color="$1"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
rosewater) color=$ROSEWATER ;;
|
|
||||||
flamingo) color=$FLAMINGO ;;
|
|
||||||
pink) color=$PINK ;;
|
pink) color=$PINK ;;
|
||||||
mauve) color=$MAUVE ;;
|
mauve) color=$MAUVE ;;
|
||||||
red) color=$RED ;;
|
|
||||||
maroon) color=$MAROON ;;
|
|
||||||
peach) color=$PEACH ;;
|
|
||||||
yellow) color=$YELLOW ;;
|
|
||||||
green) color=$GREEN ;;
|
|
||||||
teal) color=$TEAL ;;
|
|
||||||
sky) color=$SKY ;;
|
|
||||||
sapphire) color=$SAPPHIRE ;;
|
|
||||||
blue) color=$BLUE ;;
|
|
||||||
lavender) color=$LAVENDER ;;
|
|
||||||
text) color=$TEXT ;;
|
text) color=$TEXT ;;
|
||||||
subtext1) color=$SUBTEXT1 ;;
|
|
||||||
subtext0) color=$SUBTEXT0 ;;
|
|
||||||
overlay2) color=$OVERLAY2 ;;
|
|
||||||
overlay1) color=$OVERLAY1 ;;
|
|
||||||
overlay0) color=$OVERLAY0 ;;
|
|
||||||
surface2) color=$SURFACE2 ;;
|
|
||||||
surface1) color=$SURFACE1 ;;
|
|
||||||
surface0) color=$SURFACE0 ;;
|
|
||||||
crust) color=$CRUST ;;
|
crust) color=$CRUST ;;
|
||||||
mantle) color=$MANTLE ;;
|
mantle) color=$MANTLE ;;
|
||||||
base) color=$BASE ;;
|
base) color=$BASE ;;
|
||||||
|
@ -110,49 +50,21 @@ sketchybar \
|
||||||
\
|
\
|
||||||
--default \
|
--default \
|
||||||
icon.color=$(color pink) \
|
icon.color=$(color pink) \
|
||||||
label.color=$(color text) \
|
label.color=$(color pink) \
|
||||||
\
|
\
|
||||||
--set /space/ \
|
--set /space/ \
|
||||||
icon.color=$(color mauve 128) \
|
icon.color=$(color mauve 128) \
|
||||||
icon.highlight_color=$(color pink) \
|
icon.highlight_color=$(color pink) \
|
||||||
\
|
|
||||||
--set window_title \
|
|
||||||
icon.color=$(color text) \
|
|
||||||
label.color=$(color text) \
|
|
||||||
\
|
|
||||||
--set music \
|
|
||||||
icon.color=$(color subtext1) \
|
|
||||||
label.color=$(color subtext1) \
|
|
||||||
\
|
\
|
||||||
--set clock \
|
--set clock \
|
||||||
icon.color=$(color mauve) \
|
icon.color=$(color pink) \
|
||||||
label.color=$(color mauve) \
|
label.color=$(color pink) \
|
||||||
\
|
|
||||||
--set date \
|
|
||||||
icon.color=$(color blue) \
|
|
||||||
label.color=$(color blue) \
|
|
||||||
\
|
\
|
||||||
--set mullvad \
|
--set mullvad \
|
||||||
icon.color=$(color green) \
|
icon.color=$(color pink) \
|
||||||
label.color=$(color green) \
|
label.color=$(color pink)
|
||||||
\
|
|
||||||
--set battery \
|
|
||||||
icon.color=$(color yellow) \
|
|
||||||
label.color=$(color yellow) \
|
|
||||||
\
|
|
||||||
--set sound \
|
|
||||||
icon.color=$(color peach) \
|
|
||||||
label.color=$(color peach) \
|
|
||||||
\
|
|
||||||
--set mail \
|
|
||||||
icon.color=$(color red) \
|
|
||||||
label.color=$(color red) \
|
|
||||||
\
|
|
||||||
--set tasks \
|
|
||||||
icon.color=$(color red) \
|
|
||||||
label.color=$(color red)
|
|
||||||
|
|
||||||
# set the yabai colours as well
|
# set the yabai colours as well
|
||||||
yabai -m config active_window_border_color $(color pink)
|
yabai -m config active_window_border_color $(color base)
|
||||||
yabai -m config normal_window_border_color $(color mauve)
|
yabai -m config normal_window_border_color $(color base)
|
||||||
yabai -m config insert_feedback_color $(color yellow)
|
yabai -m config insert_feedback_color $(color base)
|
||||||
|
|
|
@ -9,12 +9,10 @@ fi
|
||||||
|
|
||||||
while read -r LINE; do
|
while read -r LINE; do
|
||||||
if echo "$LINE" | grep -q 'Connected'; then
|
if echo "$LINE" | grep -q 'Connected'; then
|
||||||
# regex grep the relay, e.g. se7 for sweden-7
|
|
||||||
OUTPUT=$(echo "$LINE" | grep -oE "\w{2}\d+")
|
|
||||||
ICON=" "
|
ICON=" "
|
||||||
else
|
else
|
||||||
ICON=" "
|
ICON=" "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sketchybar --set "$NAME" icon="$ICON" label="${OUTPUT^^}"
|
sketchybar --set "$NAME" icon="$ICON"
|
||||||
done < <(mullvad status listen)
|
done < <(mullvad status listen)
|
||||||
|
|
Loading…
Reference in a new issue