Merge pull request #1369 from arisinfenix/wm

Detect Mutter on GNOME Wayland and Openbox theme on LXQt
This commit is contained in:
dylan 2019-12-12 13:53:20 +02:00 committed by GitHub
commit 8de31f074a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 12 deletions

View File

@ -1646,6 +1646,7 @@ get_wm() {
-e clayland \ -e clayland \
-e dwc \ -e dwc \
-e fireplace \ -e fireplace \
-e gnome-shell \
-e greenfield \ -e greenfield \
-e grefsen \ -e grefsen \
-e kwin \ -e kwin \
@ -1678,10 +1679,6 @@ get_wm() {
wm=${wm/\"*} wm=${wm/\"*}
} }
# Rename window managers to their proper values.
[[ $wm == *WINDOWMAKER* ]] && wm=wmaker
[[ $wm == *"GNOME Shell"* ]] && wm=Mutter
# Fallback for non-EWMH WMs. # Fallback for non-EWMH WMs.
[[ $wm ]] || [[ $wm ]] ||
wm=$(ps "${ps_flags[@]}" | grep -m 1 -o \ wm=$(ps "${ps_flags[@]}" | grep -m 1 -o \
@ -1741,6 +1738,10 @@ get_wm() {
esac esac
fi fi
# Rename window managers to their proper values.
[[ $wm == *WINDOWMAKER* ]] && wm=wmaker
[[ $wm == *GNOME*Shell* ]] && wm=Mutter
wm_run=1 wm_run=1
} }
@ -1764,7 +1765,7 @@ get_wm_theme() {
wm_theme="$detheme (${wm_theme})" wm_theme="$detheme (${wm_theme})"
;; ;;
"Compiz" | "Mutter" | "GNOME Shell" | "Gala") "Compiz" | "Mutter" | "Gala")
if type -p gsettings >/dev/null; then if type -p gsettings >/dev/null; then
wm_theme="$(gsettings get org.gnome.shell.extensions.user-theme name)" wm_theme="$(gsettings get org.gnome.shell.extensions.user-theme name)"
@ -1808,15 +1809,17 @@ get_wm_theme() {
;; ;;
"Openbox") "Openbox")
if [[ "$de" == "LXDE" && -f "${HOME}/.config/openbox/lxde-rc.xml" ]]; then case $de in
ob_file="lxde-rc" "LXDE"*) ob_file="lxde-rc" ;;
"LXQt"*) ob_file="lxqt-rc" ;;
*) ob_file="rc" ;;
esac
elif [[ -f "${HOME}/.config/openbox/rc.xml" ]]; then ob_file="${XDG_CONFIG_HOME}/openbox/${ob_file}.xml"
ob_file="rc"
fi
wm_theme="$(awk -F "[<,>]" '/<theme/ {getline; print $3}' \ [[ -f "$ob_file" ]] && \
"${XDG_CONFIG_HOME}/openbox/${ob_file}.xml")"; wm_theme="$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/))
{l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")"
;; ;;
"PekWM") "PekWM")