From bb2e0210debf5776541ddbc67f45961c86dea9ed Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 16 Feb 2016 10:49:21 +1100 Subject: [PATCH] getgtk has been renamed to getstyle and is now a generic function that prints the GTK/QT theme --- fetch | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/fetch b/fetch index cf8308ed..3bab0485 100755 --- a/fetch +++ b/fetch @@ -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" } # }}}