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