Added wmctrl as a fallback for window manager detection.
This commit is contained in:
parent
25941af61b
commit
7afcf2f2ec
1 changed files with 5 additions and 2 deletions
7
fetch.sh
7
fetch.sh
|
@ -357,8 +357,11 @@ getshell () {
|
|||
|
||||
# Get window manager
|
||||
getwindowmanager () {
|
||||
if [ ! -z "${XDG_CURRENT_DESKTOP}" ]; then
|
||||
windowmanager="${XDG_CURRENT_DESKTOP}"
|
||||
if [ ! -z "$XDG_CURRENT_DESKTOP" ]; then
|
||||
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
|
||||
xinitrc=$(awk '/^[^#]*exec/ {print $2}' "${HOME}/.xinitrc")
|
||||
windowmanager="${xinitrc/-session/}"
|
||||
|
|
Loading…
Reference in a new issue