From 28f6066a3603f1d9a335bd32afd277b0d25f1534 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sat, 10 Feb 2024 16:27:48 +0000 Subject: Changed bar toggle bind so it only toggles the bar of the active monitor --- .config/eww/scripts/bar-toggle.sh | 13 +++++++++++++ .config/hypr/hyprland.conf | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .config/eww/scripts/bar-toggle.sh (limited to '.config') diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh new file mode 100755 index 0000000..2b55ff0 --- /dev/null +++ b/.config/eww/scripts/bar-toggle.sh @@ -0,0 +1,13 @@ +#!/bin/bash +monitors=$(hyprctl monitors -j | jq '.[] | .id') +for i in ${monitors}; +do + active_monitor=$(hyprctl -j activeworkspace | grep 'monitorID' | tr -dc '0-9\n') + bar=$(eww windows | grep "*bar$i") + if [ "$active_monitor" == "$i" ] && [ "$bar" == "*bar$i" ]; then + eww close bar$i + elif [ "$active_monitor" == "$i" ]; then + eww open bar$i + fi +done + diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index da029e1..8888334 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -257,7 +257,8 @@ bind = $mainMod CONTROL, PRINT, exec, ~/.local/bin/screenshot.sh focused-window bind = $mainMod, Z, swapactiveworkspaces, HDMI-A-1 eDP-1 # Toggle Eww Bar -bind = $mainMod, B, exec, eww kill || ~/.config/eww/scripts/start.sh +# bind = $mainMod, B, exec, eww kill || ~/.config/eww/scripts/start.sh +bind = $mainMod, B, exec, ~/.config/eww/scripts/bar-toggle.sh # Toggle keyboard layout bind = $mainMod SHIFT, Y, exec, hyprctl switchxkblayout at-translated-set-2-keyboard next; hyprctl switchxkblayout justine-smithies-jmspicotkl next -- cgit v1.2.3