Merge pull request #808 from dylanaraps/kde
theme: Show KDE and GTK output if both are available.
This commit is contained in:
commit
af80438a6f
17
neofetch
17
neofetch
|
@ -835,6 +835,8 @@ get_wm_theme() {
|
||||||
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='}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Quartz Compositor")
|
"Quartz Compositor")
|
||||||
|
@ -1615,15 +1617,12 @@ get_style() {
|
||||||
if [[ -f "${kde_config_dir}/kdeglobals" ]]; then
|
if [[ -f "${kde_config_dir}/kdeglobals" ]]; then
|
||||||
kde_config_file="${kde_config_dir}/kdeglobals"
|
kde_config_file="${kde_config_dir}/kdeglobals"
|
||||||
|
|
||||||
theme="$(grep "^${kde}" "$kde_config_file")"
|
kde_theme="$(grep "^${kde}" "$kde_config_file")"
|
||||||
theme="${theme/${kde}*=}"
|
kde_theme="${kde_theme/${kde}*=}"
|
||||||
theme="$(uppercase "$theme")"
|
kde_theme="$(uppercase "$kde_theme") [KDE], "
|
||||||
|
|
||||||
gtk_shorthand="on"
|
|
||||||
else
|
else
|
||||||
err "Theme: KDE config files not found, skipping."
|
err "Theme: KDE config files not found, skipping."
|
||||||
fi
|
fi
|
||||||
return
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"Cinnamon"*)
|
*"Cinnamon"*)
|
||||||
|
@ -1704,7 +1703,7 @@ get_style() {
|
||||||
[[ "$gtk3" == "off" ]] && unset gtk3_theme
|
[[ "$gtk3" == "off" ]] && unset gtk3_theme
|
||||||
|
|
||||||
# Format the string based on which themes exist.
|
# Format the string based on which themes exist.
|
||||||
if [[ "$gtk2_theme" && "$gtk2_theme" == "$gtk3_theme" ]]; then
|
if [[ "$gtk2_theme" && "$gtk2_theme" == "$gtk3_theme" ]]; then
|
||||||
gtk3_theme+=" [GTK2/3]"
|
gtk3_theme+=" [GTK2/3]"
|
||||||
unset gtk2_theme
|
unset gtk2_theme
|
||||||
|
|
||||||
|
@ -1718,12 +1717,14 @@ get_style() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Final string.
|
# Final string.
|
||||||
theme="${gtk2_theme}${gtk3_theme}"
|
theme="${kde_theme}${gtk2_theme}${gtk3_theme}"
|
||||||
|
theme="${theme%, }"
|
||||||
|
|
||||||
# Make the output shorter by removing "[GTKX]" from the string.
|
# Make the output shorter by removing "[GTKX]" from the string.
|
||||||
if [[ "$gtk_shorthand" == "on" ]]; then
|
if [[ "$gtk_shorthand" == "on" ]]; then
|
||||||
theme="${theme// '[GTK'[0-9]']'}"
|
theme="${theme// '[GTK'[0-9]']'}"
|
||||||
theme="${theme/ '[GTK2/3]'}"
|
theme="${theme/ '[GTK2/3]'}"
|
||||||
|
theme="${theme/ '[KDE]'}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue