Sfoglia il codice sorgente

wm_theme: Make Openbox config file parsing more robust

Michael Straube 5 anni fa
parent
commit
4204f79e5d
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      neofetch

+ 2 - 1
neofetch

@@ -1816,7 +1816,8 @@ get_wm_theme() {
                 ob_file="rc"
                 ob_file="rc"
             fi
             fi
 
 
-            wm_theme="$(awk -F "[<,>]" '/<theme/ {getline; print $3}' \
+            wm_theme="$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/)) {l=n; exit}}}
+                        END {split(l, a, "[<>]"); print a[3]}' \
                         "${XDG_CONFIG_HOME}/openbox/${ob_file}.xml")";
                         "${XDG_CONFIG_HOME}/openbox/${ob_file}.xml")";
         ;;
         ;;