diff options
| author | wisatong <[email protected]> | 2021-01-02 07:13:21 +0700 |
|---|---|---|
| committer | wisatong <[email protected]> | 2021-01-02 07:13:21 +0700 |
| commit | b99e6c06249670422c58bcd995bc1e552fc77d94 (patch) | |
| tree | 4dd0bb0906d709a678393d04c87e038dd00cbc67 | |
| parent | 239d5ece0514ec5ad40a3ab0fbd088300a92497b (diff) | |
Fix get_class() only grab last class
| -rwxr-xr-x | bspswallow | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -6,7 +6,9 @@ get_class() { if [ -z "$id" ]; then echo "" else - xprop -id "$id" | sed -n '/WM_CLASS\|WM_COMMAND/s/.*"\(.*\)".*/\1/p' + xprop -id "$id" | sed -n \ + -e '/WM_CLASS/s/\( "\)/\n/g; s/[^\n]*\n\([^"]*\)[^\n]*/\1\n/g' \ + -e '/WM_COMMAND/s/[^"]*/\n\n/1; s/\n"//1; s/\n\([^"]*\)".*/\n\1/; /\n/p' fi } |
