Added options to enable/disable GTK2/3 output for GTK theme.

This commit is contained in:
Dylan 2016-01-25 10:36:42 +11:00
parent e5e0b4ccce
commit 96c35229f0
2 changed files with 29 additions and 4 deletions

View file

@ -179,8 +179,10 @@ alias fetch2="fetch \
scaling_current, scaling_min, scaling_max scaling_current, scaling_min, scaling_max
NOTE: This only support Linux with cpufreq. NOTE: This only support Linux with cpufreq.
--uptime_shorthand Shorten the output of uptime --uptime_shorthand Shorten the output of uptime
--gtk_shorthand on/off Shorten output of gtk theme/icons
--gpu_shorthand on/off Shorten the output of GPU --gpu_shorthand on/off Shorten the output of GPU
--gtk_shorthand on/off Shorten output of gtk theme/icons
--gtk2 on/off Enable/Disable gtk2 theme/icons output
--gtk3 on/off Enable/Disable gtk3 theme/icons output
Text Colors: Text Colors:
--colors 1 2 3 4 5 Change the color of text --colors 1 2 3 4 5 Change the color of text

29
fetch
View file

@ -112,6 +112,15 @@ uptime_shorthand="off"
gtk_shorthand="off" gtk_shorthand="off"
# Enable/Disable gtk2 theme/icons output
# --gtk2 on/off
gtk2="on"
# Enable/Disable gtk3 theme/icons output
# --gtk3 on/off
gtk3="on"
# Color Blocks # Color Blocks
# Color block range # Color block range
@ -681,7 +690,7 @@ getcpu () {
getgpu () { getgpu () {
case "$os" in case "$os" in
"Linux" | "OpenBSD") "Linux")
gpu="$(lspci | grep "VGA")" gpu="$(lspci | grep "VGA")"
gpu=${gpu/* VGA compatible controller: } gpu=${gpu/* VGA compatible controller: }
gpu=${gpu/(rev*)} gpu=${gpu/(rev*)}
@ -931,6 +940,16 @@ getgtk () {
gtktheme="None" gtktheme="None"
fi fi
# Hide gtk2 from gtk theme output
if [ "$gtk2" == "off" ]; then
gtktheme=${gtktheme/*'[GTK2], '}
fi
# Hide gtk3 from gtk theme output
if [ "$gtk3" == "off" ]; then
gtktheme=${gtktheme/'[GTK2],'*/'[GTK2]'}
fi
# 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]'} gtktheme=${gtktheme/ '[GTK2]'}
@ -1256,8 +1275,10 @@ usage () { cat << EOF
scaling_current, scaling_min, scaling_max scaling_current, scaling_min, scaling_max
NOTE: This only support Linux with cpufreq. NOTE: This only support Linux with cpufreq.
--uptime_shorthand Shorten the output of uptime --uptime_shorthand Shorten the output of uptime
--gtk_shorthand on/off Shorten output of gtk theme/icons
--gpu_shorthand on/off Shorten the output of GPU --gpu_shorthand on/off Shorten the output of GPU
--gtk_shorthand on/off Shorten output of gtk theme/icons
--gtk2 on/off Enable/Disable gtk2 theme/icons output
--gtk3 on/off Enable/Disable gtk3 theme/icons output
Text Colors: Text Colors:
--colors 1 2 3 4 5 6 Change the color of text --colors 1 2 3 4 5 6 Change the color of text
@ -1334,8 +1355,10 @@ while [ "$1" ]; do
# Info # Info
--speed_type) speed_type="$2" ;; --speed_type) speed_type="$2" ;;
--uptime_shorthand) uptime_shorthand="$2" ;; --uptime_shorthand) uptime_shorthand="$2" ;;
--gtk_shorthand) gtk_shorthand="$2" ;;
--gpu_shorthand) gpu_shorthand="$2" ;; --gpu_shorthand) gpu_shorthand="$2" ;;
--gtk_shorthand) gtk_shorthand="$2" ;;
--gtk2) gtk2="$2" ;;
--gtk3) gtk3="$2" ;;
# Text Colors # Text Colors
--colors) title_color=$2 --colors) title_color=$2