added stow
This commit is contained in:
20
.config/sketchybar/items/battery.sh
Normal file
20
.config/sketchybar/items/battery.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item battery right \
|
||||
--set battery \
|
||||
update_freq=60 \
|
||||
icon.color="$COLOR" \
|
||||
icon.padding_left=10 \
|
||||
label.padding_right=10 \
|
||||
label.color="$COLOR" \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=5 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/power.sh" \
|
||||
--subscribe battery power_source_change
|
||||
18
.config/sketchybar/items/calendar.sh
Normal file
18
.config/sketchybar/items/calendar.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item calendar center\
|
||||
--set calendar update_freq=15 \
|
||||
icon.color="$COLOR" \
|
||||
icon.padding_left=10 \
|
||||
label.color="$COLOR" \
|
||||
label.padding_right=10 \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=5 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/calendar.sh"
|
||||
21
.config/sketchybar/items/clock.sh
Normal file
21
.config/sketchybar/items/clock.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item clock right \
|
||||
--set clock update_freq=1 \
|
||||
icon.padding_left=10 \
|
||||
icon.color="$COLOR" \
|
||||
icon="" \
|
||||
label.color="$COLOR" \
|
||||
label.width=54 \
|
||||
label.padding_right=5 \
|
||||
align=center \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=2 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/clock.sh"
|
||||
20
.config/sketchybar/items/front_app.sh
Normal file
20
.config/sketchybar/items/front_app.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$WHITE"
|
||||
|
||||
sketchybar \
|
||||
--add item front_app left \
|
||||
--set front_app script="$PLUGIN_DIR/front_app.sh" \
|
||||
icon.drawing=off \
|
||||
background.height=21 \
|
||||
background.padding_left=0 \
|
||||
background.padding_right=10 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.color="$BAR_COLOR" \
|
||||
label.color="$COLOR" \
|
||||
label.padding_left=10 \
|
||||
label.padding_right=10 \
|
||||
associated_display=active \
|
||||
--subscribe front_app front_app_switched
|
||||
43
.config/sketchybar/items/spaces.sh
Normal file
43
.config/sketchybar/items/spaces.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh"
|
||||
|
||||
sketchybar --add item spacer.1 left \
|
||||
--set spacer.1 background.drawing=off \
|
||||
label.drawing=off \
|
||||
icon.drawing=off \
|
||||
width=10
|
||||
|
||||
for i in "${!SPACE_ICONS[@]}"; do
|
||||
sid=$((i + 1))
|
||||
sketchybar --add space space.$sid left \
|
||||
--set space.$sid associated_space=$sid \
|
||||
label.drawing=off \
|
||||
icon.padding_left=10 \
|
||||
icon.padding_right=10 \
|
||||
background.padding_left=-5 \
|
||||
background.padding_right=-5 \
|
||||
script="$PLUGIN_DIR/space.sh"
|
||||
done
|
||||
|
||||
sketchybar --add item spacer.2 left \
|
||||
--set spacer.2 background.drawing=off \
|
||||
label.drawing=off \
|
||||
icon.drawing=off \
|
||||
width=5
|
||||
|
||||
sketchybar --add bracket spaces '/space.*/' \
|
||||
--set spaces background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$BLUE" \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.height=21 \
|
||||
background.drawing=on
|
||||
|
||||
sketchybar --add item separator left \
|
||||
icon.font="$FONT:Regular:16.0" \
|
||||
background.padding_left=26 \
|
||||
background.padding_right=15 \
|
||||
label.drawing=off \
|
||||
associated_display=active \
|
||||
icon.color="$YELLOW"
|
||||
3
.config/sketchybar/plugins/calendar.sh
Executable file
3
.config/sketchybar/plugins/calendar.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sketchybar --set "$NAME" icon="" label="$(date '+%a, %d %b')"
|
||||
4
.config/sketchybar/plugins/clock.sh
Executable file
4
.config/sketchybar/plugins/clock.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
LABEL=$(date '+%H:%M')
|
||||
sketchybar --set "$NAME" label="$LABEL"
|
||||
7
.config/sketchybar/plugins/front_app.sh
Executable file
7
.config/sketchybar/plugins/front_app.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case "$SENDER" in
|
||||
"front_app_switched")
|
||||
sketchybar --set "$NAME" label="$INFO"
|
||||
;;
|
||||
esac
|
||||
30
.config/sketchybar/plugins/power.sh
Executable file
30
.config/sketchybar/plugins/power.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
|
||||
CHARGING=$(pmset -g batt | grep 'AC Power')
|
||||
|
||||
if [ "$PERCENTAGE" = "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case ${PERCENTAGE} in
|
||||
9[0-9] | 100)
|
||||
ICON=""
|
||||
;;
|
||||
[6-8][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[3-5][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[1-2][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
*) ICON="" ;;
|
||||
esac
|
||||
|
||||
if [ "$CHARGING" != "" ]; then
|
||||
ICON=""
|
||||
fi
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}% "
|
||||
17
.config/sketchybar/plugins/space.sh
Executable file
17
.config/sketchybar/plugins/space.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors
|
||||
|
||||
SPACE_CLICK_SCRIPT="yabai -m space --focus $SID 2>/dev/null"
|
||||
|
||||
if [ "$SELECTED" = "true" ]; then
|
||||
sketchybar --animate tanh 5 --set "$NAME" \
|
||||
icon.color="$BLUE" \
|
||||
icon="${SPACE_ICONS[$SID - 1]}" \
|
||||
click_script="$SPACE_CLICK_SCRIPT"
|
||||
else
|
||||
sketchybar --animate tanh 5 --set "$NAME" \
|
||||
icon.color="$COMMENT" \
|
||||
icon="${SPACE_ICONS[$SID - 1]}" \
|
||||
click_script="$SPACE_CLICK_SCRIPT"
|
||||
fi
|
||||
40
.config/sketchybar/sketchybarrc
Executable file
40
.config/sketchybar/sketchybarrc
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh"
|
||||
|
||||
sketchybar --bar height=27 \
|
||||
color="$TRANSPARENT" \
|
||||
shadow="$SHADOW" \
|
||||
position=top \
|
||||
y_offset=0 \
|
||||
padding_right=11 \
|
||||
padding_left=10 \
|
||||
blur_radius=0 \
|
||||
--default updates=when_shown \
|
||||
icon.font="$FONT:Bold:13.5" \
|
||||
icon.color="$ICON_COLOR" \
|
||||
icon.padding_left="$PADDINGS" \
|
||||
icon.padding_right="$PADDINGS" \
|
||||
label.font="$FONT:Bold:13.0" \
|
||||
label.color="$LABEL_COLOR" \
|
||||
label.padding_left="$PADDINGS" \
|
||||
label.padding_right="$PADDINGS" \
|
||||
background.padding_right="$PADDINGS" \
|
||||
background.padding_left="$PADDINGS" \
|
||||
# corner_radius="$CORNER_RADIUS" \
|
||||
# sticky=on \
|
||||
# margin=5 \
|
||||
|
||||
source "$ITEM_DIR/spaces.sh"
|
||||
source "$ITEM_DIR/front_app.sh"
|
||||
|
||||
source "$ITEM_DIR/calendar.sh"
|
||||
|
||||
source "$ITEM_DIR/clock.sh"
|
||||
source "$ITEM_DIR/battery.sh"
|
||||
|
||||
sketchybar --hotload true
|
||||
|
||||
sketchybar --update
|
||||
|
||||
echo "sketchybar configuration loaded.."
|
||||
53
.config/sketchybar/variables.sh
Normal file
53
.config/sketchybar/variables.sh
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Color Palette
|
||||
# Tokyonight Night
|
||||
# BLACK=0xff24283b
|
||||
# WHITE=0xffa9b1d6
|
||||
# MAGENTA=0xffbb9af7
|
||||
# BLUE=0xff7aa2f7
|
||||
# CYAN=0xff7dcfff
|
||||
# GREEN=0xff9ece6a
|
||||
# YELLOW=0xffe0af68
|
||||
# ORANGE=0xffff9e64
|
||||
# RED=0xfff7768e
|
||||
# BAR_COLOR=0xff1a1b26
|
||||
# COMMENT=0xff565f89
|
||||
|
||||
# Oxocarbon Theme
|
||||
BLACK=0xff161616
|
||||
WHITE=0xfff2f4f8
|
||||
MAGENTA=0xffbe95ff
|
||||
BLUE=0xff82cfff
|
||||
CYAN=0xff3ddbd9
|
||||
GREEN=0xff42be65
|
||||
YELLOW=0xffffe97b
|
||||
ORANGE=0xffff7eb6
|
||||
RED=0xff3ddbd9
|
||||
BAR_COLOR=0xff161616
|
||||
COMMENT=0xff525252
|
||||
|
||||
# TRANSPARENT=0x110000cc
|
||||
TRANSPARENT=0x00ffffff
|
||||
|
||||
ICON_COLOR=$WHITE
|
||||
LABEL_COLOR=$WHITE
|
||||
|
||||
ITEM_DIR="$HOME/.config/sketchybar/items"
|
||||
PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
|
||||
|
||||
FONT="MesloLGS Nerd Font Mono"
|
||||
|
||||
PADDINGS=3
|
||||
|
||||
POPUP_BORDER_WIDTH=2
|
||||
POPUP_CORNER_RADIUS=11
|
||||
POPUP_BACKGROUND_COLOR=$BLACK
|
||||
POPUP_BORDER_COLOR=$COMMENT
|
||||
|
||||
CORNER_RADIUS=15
|
||||
BORDER_WIDTH=1
|
||||
|
||||
SHADOW=on
|
||||
|
||||
SPACE_ICONS=("一" "二" "三" "四" "五" "六" "七" "八" "九" "十")
|
||||
Reference in New Issue
Block a user