wm_theme: clean up
This commit is contained in:
parent
62e52b8270
commit
74914899d8
200
neofetch
200
neofetch
|
@ -1254,7 +1254,7 @@ get_model() {
|
||||||
|
|
||||||
case $model in
|
case $model in
|
||||||
"Standard PC"*) model="KVM/QEMU (${model})" ;;
|
"Standard PC"*) model="KVM/QEMU (${model})" ;;
|
||||||
"OpenBSD"*) model="vmm ($model)" ;;
|
OpenBSD*) model="vmm ($model)" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1637,17 +1637,17 @@ get_de() {
|
||||||
|
|
||||||
if [[ $de_version == on && $de ]]; then
|
if [[ $de_version == on && $de ]]; then
|
||||||
case $de in
|
case $de in
|
||||||
"Plasma"*) de_ver=$(plasmashell --version) ;;
|
Plasma*) de_ver=$(plasmashell --version) ;;
|
||||||
"MATE"*) de_ver=$(mate-session --version) ;;
|
MATE*) de_ver=$(mate-session --version) ;;
|
||||||
"Xfce"*) de_ver=$(xfce4-session --version) ;;
|
Xfce*) de_ver=$(xfce4-session --version) ;;
|
||||||
"GNOME"*) de_ver=$(gnome-shell --version) ;;
|
GNOME*) de_ver=$(gnome-shell --version) ;;
|
||||||
"Cinnamon"*) de_ver=$(cinnamon --version) ;;
|
Cinnamon*) de_ver=$(cinnamon --version) ;;
|
||||||
"Deepin"*) de_ver=$(awk -F'=' '/Version/ {print $2}' /etc/deepin-version) ;;
|
Deepin*) de_ver=$(awk -F'=' '/Version/ {print $2}' /etc/deepin-version) ;;
|
||||||
"Budgie"*) de_ver=$(budgie-desktop --version) ;;
|
Budgie*) de_ver=$(budgie-desktop --version) ;;
|
||||||
"LXQt"*) de_ver=$(lxqt-session --version) ;;
|
LXQt*) de_ver=$(lxqt-session --version) ;;
|
||||||
"Lumina"*) de_ver=$(lumina-desktop --version 2>&1) ;;
|
Lumina*) de_ver=$(lumina-desktop --version 2>&1) ;;
|
||||||
"Trinity"*) de_ver=$(tde-config --version) ;;
|
Trinity*) de_ver=$(tde-config --version) ;;
|
||||||
"Unity"*) de_ver=$(unity --version) ;;
|
Unity*) de_ver=$(unity --version) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
de_ver=${de_ver/*TDE:}
|
de_ver=${de_ver/*TDE:}
|
||||||
|
@ -1784,164 +1784,164 @@ get_wm_theme() {
|
||||||
((de_run != 1)) && get_de
|
((de_run != 1)) && get_de
|
||||||
|
|
||||||
case $wm in
|
case $wm in
|
||||||
"E16")
|
E16)
|
||||||
wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")"
|
wm_theme=$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Sawfish")
|
Sawfish)
|
||||||
wm_theme="$(awk -F '\\(quote|\\)' '/default-frame-style/ {print $(NF-4)}' \
|
wm_theme=$(awk -F '\\(quote|\\)' '/default-frame-style/ {print $(NF-4)}' \
|
||||||
"${HOME}/.sawfish/custom")"
|
"$HOME/.sawfish/custom")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Cinnamon" | "Muffin" | "Mutter (Muffin)")
|
Cinnamon|Muffin|"Mutter (Muffin)")
|
||||||
detheme="$(gsettings get org.cinnamon.theme name)"
|
detheme=$(gsettings get org.cinnamon.theme name)
|
||||||
wm_theme="$(gsettings get org.cinnamon.desktop.wm.preferences theme)"
|
wm_theme=$(gsettings get org.cinnamon.desktop.wm.preferences theme)
|
||||||
wm_theme="$detheme (${wm_theme})"
|
wm_theme="$detheme ($wm_theme)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Compiz" | "Mutter" | "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)
|
||||||
|
|
||||||
[[ -z "${wm_theme//\'}" ]] && \
|
[[ ${wm_theme//\'} ]] || \
|
||||||
wm_theme="$(gsettings get org.gnome.desktop.wm.preferences theme)"
|
wm_theme=$(gsettings get org.gnome.desktop.wm.preferences theme)
|
||||||
|
|
||||||
elif type -p gconftool-2 >/dev/null; then
|
elif type -p gconftool-2 >/dev/null; then
|
||||||
wm_theme="$(gconftool-2 -g /apps/metacity/general/theme)"
|
wm_theme=$(gconftool-2 -g /apps/metacity/general/theme)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Metacity"*)
|
Metacity*)
|
||||||
if [[ "$de" == "Deepin" ]]; then
|
if [[ $de == Deepin ]]; then
|
||||||
wm_theme="$(gsettings get com.deepin.wrap.gnome.desktop.wm.preferences theme)"
|
wm_theme=$(gsettings get com.deepin.wrap.gnome.desktop.wm.preferences theme)
|
||||||
|
|
||||||
elif [[ "$de" == "MATE" ]]; then
|
elif [[ $de == MATE ]]; then
|
||||||
wm_theme="$(gsettings get org.mate.Marco.general theme)"
|
wm_theme=$(gsettings get org.mate.Marco.general theme)
|
||||||
|
|
||||||
else
|
else
|
||||||
wm_theme="$(gconftool-2 -g /apps/metacity/general/theme)"
|
wm_theme=$(gconftool-2 -g /apps/metacity/general/theme)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"E17" | "Enlightenment")
|
E17|Enlightenment)
|
||||||
if type -p eet >/dev/null; then
|
if type -p eet >/dev/null; then
|
||||||
wm_theme="$(eet -d "${HOME}/.e/e/config/standard/e.cfg" config |\
|
wm_theme=$(eet -d "$HOME/.e/e/config/standard/e.cfg" config |\
|
||||||
awk '/value \"file\" string.*.edj/ {print $4}')"
|
awk '/value \"file\" string.*.edj/ {print $4}')
|
||||||
wm_theme="${wm_theme##*/}"
|
wm_theme=${wm_theme##*/}
|
||||||
wm_theme="${wm_theme%.*}"
|
wm_theme=${wm_theme%.*}
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Fluxbox")
|
Fluxbox)
|
||||||
[[ -f "${HOME}/.fluxbox/init" ]] && \
|
[[ -f $HOME/.fluxbox/init ]] &&
|
||||||
wm_theme="$(awk -F "/" '/styleFile/ {print $NF}' "${HOME}/.fluxbox/init")"
|
wm_theme=$(awk -F "/" '/styleFile/ {print $NF}' "$HOME/.fluxbox/init")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"IceWM"*)
|
IceWM*)
|
||||||
[[ -f "${HOME}/.icewm/theme" ]] && \
|
[[ -f $HOME/.icewm/theme ]] &&
|
||||||
wm_theme="$(awk -F "[\",/]" '!/#/ {print $2}' "${HOME}/.icewm/theme")"
|
wm_theme=$(awk -F "[\",/]" '!/#/ {print $2}' "$HOME/.icewm/theme")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Openbox")
|
Openbox)
|
||||||
case $de in
|
case $de in
|
||||||
"LXDE"*) ob_file="lxde-rc" ;;
|
LXDE*) ob_file=lxde-rc ;;
|
||||||
"LXQt"*) ob_file="lxqt-rc" ;;
|
LXQt*) ob_file=lxqt-rc ;;
|
||||||
*) ob_file="rc" ;;
|
*) ob_file=rc ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ob_file="${XDG_CONFIG_HOME}/openbox/${ob_file}.xml"
|
ob_file=$XDG_CONFIG_HOME/openbox/$ob_file.xml
|
||||||
|
|
||||||
[[ -f "$ob_file" ]] && \
|
[[ -f $ob_file ]] &&
|
||||||
wm_theme="$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/))
|
wm_theme=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/))
|
||||||
{l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")"
|
{l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"PekWM")
|
PekWM)
|
||||||
[[ -f "${HOME}/.pekwm/config" ]] && \
|
[[ -f $HOME/.pekwm/config ]] &&
|
||||||
wm_theme="$(awk -F "/" '/Theme/{gsub(/\"/,""); print $NF}' "${HOME}/.pekwm/config")"
|
wm_theme=$(awk -F "/" '/Theme/{gsub(/\"/,""); print $NF}' "$HOME/.pekwm/config")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Xfwm4")
|
Xfwm4)
|
||||||
[[ -f "${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]] && \
|
[[ -f $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml ]] &&
|
||||||
wm_theme="$(xfconf-query -c xfwm4 -p /general/theme)"
|
wm_theme=$(xfconf-query -c xfwm4 -p /general/theme)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"KWin"*)
|
KWin*)
|
||||||
kde_config_dir
|
kde_config_dir
|
||||||
kwinrc="${kde_config_dir}/kwinrc"
|
kwinrc=$kde_config_dir/kwinrc
|
||||||
kdebugrc="${kde_config_dir}/kdebugrc"
|
kdebugrc=$kde_config_dir/kdebugrc
|
||||||
|
|
||||||
if [[ -f "$kwinrc" ]]; then
|
if [[ -f $kwinrc ]]; then
|
||||||
wm_theme="$(awk '/theme=/ {
|
wm_theme=$(awk '/theme=/ {
|
||||||
gsub(/theme=.*qml_|theme=.*svg__/,"",$0);
|
gsub(/theme=.*qml_|theme=.*svg__/,"",$0);
|
||||||
print $0;
|
print $0;
|
||||||
exit
|
exit
|
||||||
}' "$kwinrc")"
|
}' "$kwinrc")
|
||||||
|
|
||||||
[[ -z "$wm_theme" ]] && \
|
[[ "$wm_theme" ]] ||
|
||||||
wm_theme="$(awk '/library=org.kde/ {
|
wm_theme=$(awk '/library=org.kde/ {
|
||||||
gsub(/library=org.kde./,"",$0);
|
gsub(/library=org.kde./,"",$0);
|
||||||
print $0;
|
print $0;
|
||||||
exit
|
exit
|
||||||
}' "$kwinrc")"
|
}' "$kwinrc")
|
||||||
|
|
||||||
[[ -z "$wm_theme" ]] && \
|
[[ $wm_theme ]] ||
|
||||||
wm_theme="$(awk '/PluginLib=kwin3_/ {
|
wm_theme=$(awk '/PluginLib=kwin3_/ {
|
||||||
gsub(/PluginLib=kwin3_/,"",$0);
|
gsub(/PluginLib=kwin3_/,"",$0);
|
||||||
print $0;
|
print $0;
|
||||||
exit
|
exit
|
||||||
}' "$kwinrc")"
|
}' "$kwinrc")
|
||||||
|
|
||||||
elif [[ -f "$kdebugrc" ]]; then
|
elif [[ -f $kdebugrc ]]; then
|
||||||
wm_theme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kdebugrc")"
|
wm_theme=$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kdebugrc")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wm_theme="${wm_theme/theme=}"
|
wm_theme=${wm_theme/theme=}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Quartz Compositor")
|
"Quartz Compositor")
|
||||||
global_preferences="${HOME}/Library/Preferences/.GlobalPreferences.plist"
|
global_preferences=$HOME/Library/Preferences/.GlobalPreferences.plist
|
||||||
wm_theme="$(PlistBuddy -c "Print AppleInterfaceStyle" "$global_preferences")"
|
wm_theme=$(PlistBuddy -c "Print AppleInterfaceStyle" "$global_preferences")
|
||||||
wm_theme_color="$(PlistBuddy -c "Print AppleAccentColor" "$global_preferences")"
|
wm_theme_color=$(PlistBuddy -c "Print AppleAccentColor" "$global_preferences")
|
||||||
|
|
||||||
[[ -z "$wm_theme" ]] && \
|
[[ "$wm_theme" ]] ||
|
||||||
wm_theme="Light"
|
wm_theme=Light
|
||||||
|
|
||||||
case $wm_theme_color in
|
case $wm_theme_color in
|
||||||
"-1") wm_theme_color="Graphite" ;;
|
-1) wm_theme_color=Graphite ;;
|
||||||
"0") wm_theme_color="Red" ;;
|
0) wm_theme_color=Red ;;
|
||||||
"1") wm_theme_color="Orange" ;;
|
1) wm_theme_color=Orange ;;
|
||||||
"2") wm_theme_color="Yellow" ;;
|
2) wm_theme_color=Yellow ;;
|
||||||
"3") wm_theme_color="Green" ;;
|
3) wm_theme_color=Green ;;
|
||||||
"5") wm_theme_color="Purple" ;;
|
5) wm_theme_color=Purple ;;
|
||||||
"6") wm_theme_color="Pink" ;;
|
6) wm_theme_color=Pink ;;
|
||||||
*) wm_theme_color="Blue" ;;
|
*) wm_theme_color=Blue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
wm_theme="${wm_theme_color} ($wm_theme)"
|
wm_theme="$wm_theme_color ($wm_theme)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"Explorer")
|
*Explorer)
|
||||||
path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft"
|
path=/proc/registry/HKEY_CURRENT_USER/Software/Microsoft
|
||||||
path+="/Windows/CurrentVersion/Themes/CurrentTheme"
|
path+=/Windows/CurrentVersion/Themes/CurrentTheme
|
||||||
|
|
||||||
wm_theme="$(head -n1 "$path")"
|
wm_theme=$(head -n1 "$path")
|
||||||
wm_theme="${wm_theme##*\\}"
|
wm_theme=${wm_theme##*\\}
|
||||||
wm_theme="${wm_theme%.*}"
|
wm_theme=${wm_theme%.*}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Blackbox" | "bbLean"*)
|
Blackbox|bbLean*)
|
||||||
path="$(wmic process get ExecutablePath | grep -F "blackbox")"
|
path=$(wmic process get ExecutablePath | grep -F "blackbox")
|
||||||
path="${path//\\/\/}"
|
path=${path//\\/\/}
|
||||||
|
|
||||||
wm_theme="$(grep '^session\.styleFile:' "${path/\.exe/.rc}")"
|
wm_theme=$(grep '^session\.styleFile:' "${path/\.exe/.rc}")
|
||||||
wm_theme="${wm_theme/session\.styleFile: }"
|
wm_theme=${wm_theme/session\.styleFile: }
|
||||||
wm_theme="${wm_theme##*\\}"
|
wm_theme=${wm_theme##*\\}
|
||||||
wm_theme="${wm_theme%.*}"
|
wm_theme=${wm_theme%.*}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
wm_theme="$(trim_quotes "$wm_theme")"
|
wm_theme=$(trim_quotes "$wm_theme")
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cpu() {
|
get_cpu() {
|
||||||
|
|
Reference in New Issue