fix(waybar): icon spacing
This commit is contained in:
parent
f81997f94d
commit
136ac9fba0
5 changed files with 37 additions and 51 deletions
37
scripts/hypr
37
scripts/hypr
|
|
@ -49,21 +49,18 @@ exit)
|
|||
brightness)
|
||||
require brightnessctl notify-send
|
||||
BRIGHT_STEP=5
|
||||
max_brightness="$(brightnessctl max)"
|
||||
case "$1" in
|
||||
up)
|
||||
brightnessctl set "$BRIGHT_STEP"%+
|
||||
notify-send -t 2500 -r 5555 "brightness $(brightnessctl get | awk -v max="$max_brightness" '{printf "%d%%", $1*100/max}')"
|
||||
;;
|
||||
down)
|
||||
brightnessctl set "$BRIGHT_STEP"%-
|
||||
notify-send -t 2500 -r 5555 "brightness $(brightnessctl get | awk -v max="$max_brightness" '{printf "%d%%", $1*100/max}')"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid subcommand: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
up) brightnessctl set "$BRIGHT_STEP"%+ ;;
|
||||
down) brightnessctl set "$BRIGHT_STEP"%- ;;
|
||||
*) echo "Invalid subcommand: $1" >&2; exit 1 ;;
|
||||
esac
|
||||
pct=$(awk -v cur="$(brightnessctl get)" -v max="$(brightnessctl max)" 'BEGIN { printf "%d", cur * 100 / max }')
|
||||
filled=$((pct / 5))
|
||||
empty=$((20 - filled))
|
||||
bar=""
|
||||
i=0; while [ "$i" -lt "$filled" ]; do bar="${bar}━"; i=$((i + 1)); done
|
||||
i=0; while [ "$i" -lt "$empty" ]; do bar="${bar}─"; i=$((i + 1)); done
|
||||
notify-send -a hypr -t 2500 -r 5555 "☼ $bar"
|
||||
;;
|
||||
volume)
|
||||
require wpctl notify-send
|
||||
|
|
@ -88,11 +85,21 @@ volume)
|
|||
esac
|
||||
|
||||
vol=$(get_vol)
|
||||
filled=$((vol / 5))
|
||||
empty=$((20 - filled))
|
||||
bar=""
|
||||
i=0; while [ "$i" -lt "$filled" ]; do bar="${bar}━"; i=$((i + 1)); done
|
||||
i=0; while [ "$i" -lt "$empty" ]; do bar="${bar}─"; i=$((i + 1)); done
|
||||
if wpctl get-volume "$SINK" | grep -q MUTED; then
|
||||
notify-send -t 2500 -r 5556 "volume: ${vol}% (muted)"
|
||||
icon=""
|
||||
elif [ "$vol" -le 33 ]; then
|
||||
icon=""
|
||||
elif [ "$vol" -le 66 ]; then
|
||||
icon=""
|
||||
else
|
||||
notify-send -t 2500 -r 5556 "volume: ${vol}%"
|
||||
icon=""
|
||||
fi
|
||||
notify-send -a hypr -t 2500 -r 5556 "$icon $bar"
|
||||
;;
|
||||
pull)
|
||||
require hyprctl jq fuzzel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue