refactor(sketchybar): shellcheck, reformat

This commit is contained in:
winston 2022-08-03 01:13:51 +02:00
parent 8f1a75fc57
commit cce4628211
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 12 additions and 14 deletions

View file

@ -8,7 +8,7 @@ sketchybar --bar \
blur_radius=10 \ blur_radius=10 \
position=top \ position=top \
padding_left=0 \ padding_left=0 \
padding_right=4 \ padding_right=4
# colors are managed seperately in the colordummy, # colors are managed seperately in the colordummy,
# which listens to theme_changed events, # which listens to theme_changed events,
@ -17,8 +17,7 @@ sketchybar -m --add event theme_changed AppleInterfaceThemeChangedNotification
sketchybar \ sketchybar \
--add item colordummy left \ --add item colordummy left \
--set colordummy \ --set colordummy \
icon.drawing=off \ drawing=off \
label.drawing=off \
script="$PLUGIN_DIR/colordummy.sh" \ script="$PLUGIN_DIR/colordummy.sh" \
--subscribe colordummy theme_changed --subscribe colordummy theme_changed
@ -50,24 +49,18 @@ SPACE_ICONS=(
) )
for i in "${!SPACE_ICONS[@]}" for i in "${!SPACE_ICONS[@]}"
do do
if [[ $i == 0 ]]; then
lbgp=0
else
lbgp=1
fi
sketchybar \ sketchybar \
--add space "space.$i" left \ --add space "space.$i" left \
--set "space.$i" associated_space=$(($i+1)) \ --set "space.$i" associated_space=$((i+1)) \
icon="${SPACE_ICONS[i]}" \ icon="${SPACE_ICONS[i]}" \
icon.padding_left=8 \ icon.padding_left=8 \
icon.padding_right=8 \ icon.padding_right=8 \
background.padding_left="$lbgp" \ background.padding_left=1 \
background.padding_right=1 \ background.padding_right=1 \
background.height=32 \ background.height=32 \
label.drawing=off \ label.drawing=off \
script="$PLUGIN_DIR/space.sh" \ script="$PLUGIN_DIR/space.sh" \
click_script="yabai -m space --focus $(($i+1))" click_script="yabai -m space --focus $((i+1))"
done done
# window title # window title
@ -99,11 +92,13 @@ sketchybar \
--set clock \ --set clock \
script="$PLUGIN_DIR/clock.sh" \ script="$PLUGIN_DIR/clock.sh" \
update_freq=10 \ update_freq=10 \
lazy=true \
\ \
--add item date right \ --add item date right \
--set date \ --set date \
script="$PLUGIN_DIR/ddate.sh" \ script="$PLUGIN_DIR/ddate.sh" \
update_freq=60 \ update_freq=60 \
lazy=true \
\ \
--add item mullvad right \ --add item mullvad right \
--set mullvad \ --set mullvad \
@ -113,22 +108,26 @@ sketchybar \
--set battery \ --set battery \
update_freq=30 \ update_freq=30 \
script="$PLUGIN_DIR/battery.sh" \ script="$PLUGIN_DIR/battery.sh" \
lazy=true \
--subscribe battery system_woke \ --subscribe battery system_woke \
\ \
--add item sound right \ --add item sound right \
--set sound \ --set sound \
script="$PLUGIN_DIR/sound.sh" \ script="$PLUGIN_DIR/sound.sh" \
update_freq=5 \ update_freq=5 \
lazy=true \
\ \
--add item mail right \ --add item mail right \
--set mail \ --set mail \
script="$PLUGIN_DIR/mailIndicator.sh" \ script="$PLUGIN_DIR/mailIndicator.sh" \
update_freq=10 \ update_freq=10 \
lazy=true \
\ \
--add item tasks right \ --add item tasks right \
--set tasks \ --set tasks \
script="$PLUGIN_DIR/tasks.sh" \ script="$PLUGIN_DIR/tasks.sh" \
update_freq=10 update_freq=10 \
lazy=true
##### fin ##### ##### fin #####
sketchybar --update sketchybar --update

View file

@ -111,7 +111,6 @@ sketchybar \
--set /space/ \ --set /space/ \
icon.color=$(color mauve 128) \ icon.color=$(color mauve 128) \
icon.highlight_color=$(color pink) \ icon.highlight_color=$(color pink) \
background.highlight_color=$(color pink) \
\ \
--set window_title \ --set window_title \
icon.color=$(color text) \ icon.color=$(color text) \