#!/usr/bin/env bash

## Copyright (C) 2024
##
## Script to toggle waybar visibility in Hyprland

# Check if waybar is running
if pgrep -x "waybar" > /dev/null; then
    # If waybar is running, kill it
    killall -q waybar
    notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "Waybar Disabled"
else
    # If waybar is not running, start it with the config files
    CONFIG="$HOME/.config/hypr/waybar/config"
    STYLE="$HOME/.config/hypr/waybar/style.css"
    waybar --bar main-bar --log-level error --config ${CONFIG} --style ${STYLE} &
    notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "Waybar Enabled"
fi