|
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
|
# Optional Dependencies: (You'll lose these features without them) |
|
|
|
|
# Displaying Images: w3m + w3m-img |
|
|
|
|
# Image Cropping: ImageMagick |
|
|
|
|
# More accurate window manager detection: wmctrl |
|
|
|
|
# More accurate window manager detection: wmctrl or xprop |
|
|
|
|
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings |
|
|
|
|
# [ Linux / BSD ] Current Song: mpc or cmus |
|
|
|
|
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo |
|
|
|
|
@ -652,39 +652,54 @@ getshell () { |
|
|
|
|
# Window Manager {{{ |
|
|
|
|
|
|
|
|
|
getwindowmanager () { |
|
|
|
|
# Check for window manager using wmctrl and xprop |
|
|
|
|
if type -p wmctrl >/dev/null 2>&1; then |
|
|
|
|
windowmanager="$(wmctrl -m | head -n1)" |
|
|
|
|
windowmanager=${windowmanager/Name: } |
|
|
|
|
|
|
|
|
|
elif [ "$XDG_CURRENT_DESKTOP" ]; then |
|
|
|
|
windowmanager="$XDG_CURRENT_DESKTOP" |
|
|
|
|
elif type -p xprop >/dev/null 2>&1; then |
|
|
|
|
# Get id of window manager |
|
|
|
|
wid=$(xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null) |
|
|
|
|
wid=${wid//* } |
|
|
|
|
|
|
|
|
|
elif [ "$XINITRC" ]; then |
|
|
|
|
windowmanager=$(grep "^[^#]*exec" "$XINITRC") |
|
|
|
|
windowmanager="$(xprop -id $wid 8s _NET_WM_NAME 2>/dev/null)" |
|
|
|
|
windowmanager=${windowmanager/*\(*\) = \"} |
|
|
|
|
windowmanager=${windowmanager/\"} |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
elif [ -e "$HOME/.xinitrc" ]; then |
|
|
|
|
windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc") |
|
|
|
|
# If the window manager wasn't found, fallback to |
|
|
|
|
# checking files / envars. |
|
|
|
|
if [ -z "$windowmanager" ]; then |
|
|
|
|
if [ "$XDG_CURRENT_DESKTOP" ]; then |
|
|
|
|
windowmanager="$XDG_CURRENT_DESKTOP" |
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
case "$os" in |
|
|
|
|
"Mac OS X") |
|
|
|
|
windowmanager="Quartz Compositor" |
|
|
|
|
;; |
|
|
|
|
elif [ "$XINITRC" ]; then |
|
|
|
|
windowmanager=$(grep "^[^#]*exec" "$XINITRC") |
|
|
|
|
|
|
|
|
|
"Windows") |
|
|
|
|
windowmanager="Explorer" |
|
|
|
|
;; |
|
|
|
|
elif [ -e "$HOME/.xinitrc" ]; then |
|
|
|
|
windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc") |
|
|
|
|
|
|
|
|
|
*) |
|
|
|
|
windowmanager="Unknown" |
|
|
|
|
;; |
|
|
|
|
else |
|
|
|
|
case "$os" in |
|
|
|
|
"Mac OS X") |
|
|
|
|
windowmanager="Quartz Compositor" |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
esac |
|
|
|
|
fi |
|
|
|
|
"Windows") |
|
|
|
|
windowmanager="Explorer" |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
*) |
|
|
|
|
windowmanager="Unknown" |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
windowmanager="${windowmanager/exec }" |
|
|
|
|
windowmanager="${windowmanager/-session}" |
|
|
|
|
windowmanager="${windowmanager^}" |
|
|
|
|
esac |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
windowmanager="${windowmanager/exec }" |
|
|
|
|
windowmanager="${windowmanager/-session}" |
|
|
|
|
windowmanager="${windowmanager^}" |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# }}} |
|
|
|
|
|