From 5bd3881e94015b80bd8f833b6db06be280142fea Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 3 Aug 2022 13:48:23 +0200 Subject: sxhkd script : search a pattern instead of a exact name --- sxhkd/scripts/sxhkd/show.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sxhkd/scripts') diff --git a/sxhkd/scripts/sxhkd/show.sh b/sxhkd/scripts/sxhkd/show.sh index b87067c..9f89fa1 100755 --- a/sxhkd/scripts/sxhkd/show.sh +++ b/sxhkd/scripts/sxhkd/show.sh @@ -1,7 +1,12 @@ #!/bin/sh +# Check if a desktop match the name +desktop=$(bspc query --desktops --names | grep "$1") + # If the required desktop does not exists, create it -bspc query --desktops --names | grep --quiet "$1" || bspc monitor --add-desktops "$1" +if [ -z "$desktop" ]; then + bspc monitor --add-desktops "$1" +fi # Switch to the desired desktop -bspc desktop --focus "$1" +bspc desktop --focus "${desktop:-$1}" -- cgit v1.2.3