diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-10-02 15:36:09 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-10-02 15:36:09 +0300 |
| commit | c94e2c5d9d20d64bc82254227977e3bd2d6ff6b6 (patch) | |
| tree | 41ffffc8187b184f88cf3527e16093f7605c8f16 | |
| parent | d8d8899ad2cffabdbc6e405e37bf6478879e1fa4 (diff) | |
| download | pfetch-c94e2c5d9d20d64bc82254227977e3bd2d6ff6b6.tar.gz | |
wm: handle non-matches
| -rwxr-xr-x | pfetch | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -765,8 +765,17 @@ get_wm() { # To extract the name, everything before '_NET_WM_NAME = \"' # is removed and everything after the next '"' is removed. wm=$(xprop -id "$id" -notype -len 25 -f _NET_WM_NAME 8t) - wm=${wm##*_NET_WM_NAME = \"} - wm=${wm%%\"*} + + # Handle cases of a window manager _not_ populating the + # '_NET_WM_NAME' atom. Display nothing in this case. + case $wm in + *'_NET_WM_NAME = '*) + wm=${wm##*_NET_WM_NAME = \"} + wm=${wm%%\"*} + ;; + + *) wm= ;; + esac } ;; esac |
