Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try _NET_CLIENT_LIST if _NET_CLIENT_LIST_STACKING doesn't work #62

Merged
merged 2 commits into from
Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jumpapp
Original file line number Diff line number Diff line change
Expand Up @@ -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.' ]] || [[ "$ids" =~ 'no such atom' ]]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for testing this on multiple machines to catch the multiple messages. Another idea is instead of trying to match on specific error messages, we could invert the match and look for something that only appears in the success output (maybe (WINDOW) or 0x?). I like what you have though, let's try it and see if anyone reports issues.

BTW I double checked to see if we could use the process return status code, but it looks like it's always 0 whether the property exists or not.

# 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 ',' ' '
}

Expand Down