Files
dotfiles/waybar/run.sh
2025-12-24 21:05:33 +03:00

44 lines
728 B
Bash
Executable File

#!/bin/bash
DIR="$HOME/.config/waybar"
TOP_CONFIG="$DIR/config_top.jsonc"
TOP_STYLE="$DIR/style/style_top.css"
BOTTOM_CONFIG="$DIR/config_bottom.jsonc"
BOTTOM_STYLE="$DIR/style/style_bottom.css"
kill_bars() {
if pgrep waybar > /dev/null; then
pkill waybar
return 0
fi
return 1
}
run_bars() {
waybar -c "$TOP_CONFIG" -s "$TOP_STYLE" &
waybar -c "$BOTTOM_CONFIG" -s "$BOTTOM_STYLE" &
return 0
}
case "$1" in
"")
kill_bars
run_bars
;;
toggle)
kill_bars
if [ $? -eq 1 ]; then
run_bars
fi
;;
kill)
kill_bars
;;
*)
echo "Usage: $0 [toggle | kill]"
exit 1
;;
esac