Revert xprop support for getwindowmanager
This commit is contained in:
parent
f035196886
commit
eac81f3b48
1
1.1.md
1
1.1.md
|
@ -32,7 +32,6 @@ at launch or in script.
|
||||||
**Window Manager:**
|
**Window Manager:**
|
||||||
|
|
||||||
- Added support for `$XINITRC`
|
- Added support for `$XINITRC`
|
||||||
- Added support for `xprop`
|
|
||||||
|
|
||||||
**Shell:**
|
**Shell:**
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ your distro's logo or any ascii art of your choice!
|
||||||
- **Note:** To enable iTerm2 mode, you need to change `$image_backend` to `iterm2`
|
- **Note:** To enable iTerm2 mode, you need to change `$image_backend` to `iterm2`
|
||||||
or use the launch flag `--image_backend iterm2`.
|
or use the launch flag `--image_backend iterm2`.
|
||||||
- Image Cropping, Resizing etc: `ImageMagick`
|
- Image Cropping, Resizing etc: `ImageMagick`
|
||||||
- More accurate window manager detection: `wmctrl` or `xprop`
|
- More accurate window manager detection: `wmctrl`
|
||||||
|
|
||||||
**Linux / BSD:**
|
**Linux / BSD:**
|
||||||
|
|
||||||
|
|
69
fetch
69
fetch
|
@ -12,7 +12,7 @@
|
||||||
# Optional Dependencies: (You'll lose these features without them)
|
# Optional Dependencies: (You'll lose these features without them)
|
||||||
# Displaying Images: w3m + w3m-img
|
# Displaying Images: w3m + w3m-img
|
||||||
# Image Cropping: ImageMagick
|
# Image Cropping: ImageMagick
|
||||||
# More accurate window manager detection: wmctrl or xprop
|
# More accurate window manager detection: wmctrl
|
||||||
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
|
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
|
||||||
# [ Linux / BSD ] Current Song: mpc or cmus
|
# [ Linux / BSD ] Current Song: mpc or cmus
|
||||||
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
|
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
|
||||||
|
@ -652,54 +652,39 @@ getshell () {
|
||||||
# Window Manager {{{
|
# Window Manager {{{
|
||||||
|
|
||||||
getwindowmanager () {
|
getwindowmanager () {
|
||||||
# Check for window manager using wmctrl and xprop
|
|
||||||
if type -p wmctrl >/dev/null 2>&1; then
|
if type -p wmctrl >/dev/null 2>&1; then
|
||||||
windowmanager="$(wmctrl -m | head -n1)"
|
windowmanager="$(wmctrl -m | head -n1)"
|
||||||
windowmanager=${windowmanager/Name: }
|
windowmanager=${windowmanager/Name: }
|
||||||
|
|
||||||
elif type -p xprop >/dev/null 2>&1; then
|
elif [ "$XDG_CURRENT_DESKTOP" ]; then
|
||||||
# Get id of window manager
|
windowmanager="$XDG_CURRENT_DESKTOP"
|
||||||
wid=$(xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null)
|
|
||||||
wid=${wid//* }
|
|
||||||
|
|
||||||
windowmanager="$(xprop -id "$wid" 8s _NET_WM_NAME 2>/dev/null)"
|
elif [ "$XINITRC" ]; then
|
||||||
windowmanager=${windowmanager/*\(*\) = \"}
|
windowmanager=$(grep "^[^#]*exec" "$XINITRC")
|
||||||
windowmanager=${windowmanager/\"}
|
|
||||||
|
elif [ -e "$HOME/.xinitrc" ]; then
|
||||||
|
windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc")
|
||||||
|
|
||||||
|
else
|
||||||
|
case "$os" in
|
||||||
|
"Mac OS X")
|
||||||
|
windowmanager="Quartz Compositor"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"Windows")
|
||||||
|
windowmanager="Explorer"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
windowmanager="Unknown"
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the window manager wasn't found, fallback to
|
windowmanager="${windowmanager/exec }"
|
||||||
# checking files / envars.
|
windowmanager="${windowmanager/-session}"
|
||||||
if [ -z "$windowmanager" ]; then
|
windowmanager="${windowmanager^}"
|
||||||
if [ "$XDG_CURRENT_DESKTOP" ]; then
|
|
||||||
windowmanager="$XDG_CURRENT_DESKTOP"
|
|
||||||
|
|
||||||
elif [ "$XINITRC" ]; then
|
|
||||||
windowmanager=$(grep "^[^#]*exec" "$XINITRC")
|
|
||||||
|
|
||||||
elif [ -e "$HOME/.xinitrc" ]; then
|
|
||||||
windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc")
|
|
||||||
|
|
||||||
else
|
|
||||||
case "$os" in
|
|
||||||
"Mac OS X")
|
|
||||||
windowmanager="Quartz Compositor"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"Windows")
|
|
||||||
windowmanager="Explorer"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
windowmanager="Unknown"
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
windowmanager="${windowmanager/exec }"
|
|
||||||
windowmanager="${windowmanager/-session}"
|
|
||||||
windowmanager="${windowmanager^}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
Reference in New Issue