#!/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" DOCK_CONFIG="$DIR/config_dock.jsonc" DOCK_STYLE="$DIR/style/style_dock.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" & waybar -c "$DOCK_CONFIG" -s "$DOCK_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