Commit 00f1dadb authored by Michael Straube's avatar Michael Straube

wm_theme: Refactor Openbox theme detection

parent 5c740aa4
...@@ -1809,19 +1809,17 @@ get_wm_theme() { ...@@ -1809,19 +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" ;;
elif [[ "$de" == "LXQt" && -f "${HOME}/.config/openbox/lxqt-rc.xml" ]]; then *) ob_file="rc" ;;
ob_file="lxqt-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 '/<theme>/ {while (getline n) {if (match(n, /<name>/)) {l=n; exit}}} [[ -f "$ob_file" ]] && \
END {split(l, a, "[<>]"); print a[3]}' \ wm_theme="$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/))
"${XDG_CONFIG_HOME}/openbox/${ob_file}.xml")"; {l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")"
;; ;;
"PekWM") "PekWM")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment