#!/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" # A hack needed for the bar to recognize the special workspaces defined in the # Hyprland config instead of creating regular workspaces with the same name, # breaking the functionality. # POPULATE_SPECIAL_WORKSPACES=1 kill_bars() { if pgrep waybar > /dev/null; then pkill waybar return 0 fi return 1 } run_bars() { # if [ $POPULATE_SPECIAL_WORKSPACES -eq 1 ]; then # hyprctl dispatch exec [ workspace special:dungeon silent ] "kitty --class kitty-specialkludge1" # hyprctl dispatch exec [ workspace special:magic silent ] "kitty --class kitty-specialkludge2" # sleep 1 # fi waybar -c "$TOP_CONFIG" -s "$TOP_STYLE" & waybar -c "$BOTTOM_CONFIG" -s "$BOTTOM_STYLE" & # if [ $POPULATE_SPECIAL_WORKSPACES -eq 1 ]; then # sleep 2 # hyprctl dispatch closewindow class:kitty-specialkludge1 # hyprctl dispatch closewindow class:kitty-specialkludge2 # fi 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