From d127fda655d51a306734c6bf2086ed9f2915ad5f Mon Sep 17 00:00:00 2001 From: Max Schillinger Date: Tue, 9 Mar 2021 10:45:51 +0100 Subject: [PATCH 1/2] try _NET_CLIENT_LIST if _NET_CLIENT_LIST_STACKING doesn't work --- jumpapp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jumpapp b/jumpapp index d81528e..0af08f1 100755 --- a/jumpapp +++ b/jumpapp @@ -379,6 +379,10 @@ get_active_windowid() { list_stacking_order() { local name ids read -r name ids < <(xprop -root ' $0+\n' _NET_CLIENT_LIST_STACKING) + if [[ "$ids" == 'not found.' ]]; then + # in case the window manager doesn't support _NET_CLIENT_LIST_STACKING (p.e. dwm) + read -r name ids < <(xprop -root ' $0+\n' _NET_CLIENT_LIST) + fi printf '%s\n' "$ids" | tr ',' ' ' } From d5756f861ab7095e60050126d791ffddb84b7fcd Mon Sep 17 00:00:00 2001 From: Maximilian Schillinger Date: Tue, 9 Mar 2021 14:00:45 +0100 Subject: [PATCH 2/2] catch different error message (Ubuntu 18.04) --- jumpapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jumpapp b/jumpapp index 0af08f1..20566d1 100755 --- a/jumpapp +++ b/jumpapp @@ -379,7 +379,7 @@ get_active_windowid() { list_stacking_order() { local name ids read -r name ids < <(xprop -root ' $0+\n' _NET_CLIENT_LIST_STACKING) - if [[ "$ids" == 'not found.' ]]; then + if [[ "$ids" == 'not found.' ]] || [[ "$ids" =~ 'no such atom' ]]; then # in case the window manager doesn't support _NET_CLIENT_LIST_STACKING (p.e. dwm) read -r name ids < <(xprop -root ' $0+\n' _NET_CLIENT_LIST) fi