rofi: fix brotab script calling itself when selecting tab

This commit is contained in:
Kevin Baensch 2024-11-21 13:04:10 +01:00
parent c206159758
commit 35f22bbe00
Signed by: derped
GPG key ID: C0F1D326C7626543

View file

@ -4,13 +4,13 @@ let
with pkgs; # bash with pkgs; # bash
'' ''
#!/usr/bin/env bash #!/usr/bin/env bash
if [ -z ''${1} ]; then if [ -z "''${1}" ]; then
${brotab}/bin/bt list; ${brotab}/bin/bt list;
else else
TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1}); TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1});
# activate window as focused to it is easy to switch to # activate window as focused to it is easy to switch to
${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1; ${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1;
if [ -n ''${SWAYSOCK} ] && which swaymsg; then if [ -n ''${SWAYSOCK} ] && which swaymsg >/dev/null 2>&1; then
swaymsg "[urgent=latest] focus" > /dev/null 2>&1; swaymsg "[urgent=latest] focus" > /dev/null 2>&1;
fi fi
fi fi