getgtk has been renamed to getstyle and is now a generic function that prints the GTK/QT theme

This commit is contained in:
Dylan 2016-02-16 10:49:21 +11:00
parent 98f1a0e057
commit bb2e0210de
1 changed files with 21 additions and 19 deletions

40
fetch
View File

@ -47,8 +47,8 @@ printinfo () {
info "Shell" shell
info "Desktop Environment" de
info "Window Manager" wm
info "GTK Theme" gtktheme
info "Icons" gtkicons
info "Theme" theme
info "Icons" icons
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
@ -1142,9 +1142,9 @@ getresolution () {
# }}}
# GTK Theme/Icons/Font {{{
# Theme/Icons/Font {{{
getgtk () {
getstyle () {
# Fix weird output when the function
# is run multiple times.
unset gtk2theme gtk3theme
@ -1195,8 +1195,10 @@ getgtk () {
if [ -f "${kde_config_dir}/share/config/kdeglobals" ]; then
kde_config_file="${kde_config_dir}/share/config/kdeglobals"
gtktheme=$(grep "^[^#]*$kde" "$kde_config_file")
gtktheme=${gtk3theme/${kde}*=}
theme=$(grep "^[^#]*$kde" "$kde_config_file")
theme=${gtk3theme/${kde}*=}
gtk_shorthand="on"
return
fi
;;
@ -1281,31 +1283,31 @@ getgtk () {
fi
# Final string
gtktheme="${gtk2theme}${gtk3theme}"
theme="${gtk2theme}${gtk3theme}"
# If the final string is empty print "None"
[ -z "$gtktheme" ] && gtktheme="None"
[ -z "$theme" ] && theme="None"
# Make the output shorter by removing "[GTKX]" from the string
if [ "$gtk_shorthand" == "on" ]; then
gtktheme=${gtktheme/ '[GTK2]'}
gtktheme=${gtktheme/ '[GTK3]'}
gtktheme=${gtktheme/ '[GTK2/3]'}
theme=${theme/ '[GTK2]'}
theme=${theme/ '[GTK3]'}
theme=${theme/ '[GTK2/3]'}
fi
}
getgtktheme () {
getgtk theme
gettheme () {
getstyle theme
}
getgtkicons () {
getgtk icons
gtkicons="$gtktheme"
geticons () {
getstyle icons
icons="$theme"
}
getgtkfont () {
getgtk font
gtkfont="$gtktheme"
getfont () {
getstyle font
font="$theme"
}
# }}}