From 6661cfc2c5279333528cc7c45366b1433da679dc Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 11 Jun 2025 09:55:24 +0200 Subject: [PATCH] made togglebar per monitor --- desktopenvs/hyprland/scripts/togglebar.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktopenvs/hyprland/scripts/togglebar.sh b/desktopenvs/hyprland/scripts/togglebar.sh index bab3263..0cf9957 100755 --- a/desktopenvs/hyprland/scripts/togglebar.sh +++ b/desktopenvs/hyprland/scripts/togglebar.sh @@ -10,14 +10,17 @@ GTK_THEME=cyberqueer monitorsum=$(hyprctl monitors | grep ID | wc -l) -statecon=$(eww active-windows) +actmon=$(hyprctl monitors | grep -B12 "focused: yes" | head -n1 | cut -d'(' -f 2 | cut -d' ' -f 2 | cut -d')' -f 1) +statecon=$(eww active-windows | grep "bar$actmon") #notify-send $statecon if [ "$statecon" != '' ]; then for i in $(seq 1 $monitorsum); do declare -i curmon=$i-1 + if [ "$curmon" == "$actmon" ]; then /usr/bin/eww open --toggle bar$curmon + fi done else @@ -25,7 +28,9 @@ else for i in $(seq 1 $monitorsum); do declare -i curmon=$i-1 + if [ "$curmon" == "$actmon" ]; then /usr/bin/eww open bar --id bar$curmon --arg monitor=$curmon + fi done fi