Added wmctrl as a fallback for window manager detection.
This commit is contained in:
parent
25941af61b
commit
7afcf2f2ec
7
fetch.sh
7
fetch.sh
|
@ -357,8 +357,11 @@ getshell () {
|
||||||
|
|
||||||
# Get window manager
|
# Get window manager
|
||||||
getwindowmanager () {
|
getwindowmanager () {
|
||||||
if [ ! -z "${XDG_CURRENT_DESKTOP}" ]; then
|
if [ ! -z "$XDG_CURRENT_DESKTOP" ]; then
|
||||||
windowmanager="${XDG_CURRENT_DESKTOP}"
|
windowmanager="$XDG_CURRENT_DESKTOP"
|
||||||
|
elif type -p wmctrl >/dev/null 2>&1; then
|
||||||
|
windowmanager="$(wmctrl -m | head -n1)"
|
||||||
|
windowmanager=${windowmanager/Name: /}
|
||||||
elif [ -e "$HOME/.xinitrc" ]; then
|
elif [ -e "$HOME/.xinitrc" ]; then
|
||||||
xinitrc=$(awk '/^[^#]*exec/ {print $2}' "${HOME}/.xinitrc")
|
xinitrc=$(awk '/^[^#]*exec/ {print $2}' "${HOME}/.xinitrc")
|
||||||
windowmanager="${xinitrc/-session/}"
|
windowmanager="${xinitrc/-session/}"
|
||||||
|
|
Reference in New Issue