From f5d2aac5aa442ed5b5b7174841f4ff9dfc391b55 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 22 Dec 2016 13:23:48 +1100 Subject: [PATCH] GPU: Add --gpu_type --- config/config | 17 +++++++++++++++++ neofetch | 6 ++++-- neofetch.1 | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/config/config b/config/config index b1ed368f..66d859c1 100644 --- a/config/config +++ b/config/config @@ -210,6 +210,23 @@ cpu_temp="off" # off: 'HD 7950' gpu_brand="on" +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" # Resolution diff --git a/neofetch b/neofetch index cfcc2b29..e40c099c 100755 --- a/neofetch +++ b/neofetch @@ -973,8 +973,8 @@ get_gpu() { for gpu in "${gpus[@]}"; do # GPU shorthand tests. - [[ "$gpu_show" == "dedicated" && "$gpu" =~ (i|I)ntel ]] || \ - [[ "$gpu_show" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \ + [[ "$gpu_type" == "dedicated" && "$gpu" =~ (i|I)ntel ]] || \ + [[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \ { unset -v gpu; continue; } case "$gpu" in @@ -3045,6 +3045,7 @@ INFO --refresh_rate on/off Whether to display the refresh rate of each monitor Unsupported on Windows --gpu_brand on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel) + --gpu_type type Which GPU to display. (all, dedicated, integrated) --gtk_shorthand on/off Shorten output of gtk theme/icons --gtk2 on/off Enable/Disable gtk2 theme/font/icons output --gtk3 on/off Enable/Disable gtk3 theme/font/icons output @@ -3205,6 +3206,7 @@ get_args() { "--uptime_shorthand") uptime_shorthand="$2" ;; "--cpu_shorthand") cpu_shorthand="$2" ;; "--gpu_brand") gpu_brand="$2" ;; + "--gpu_type") gpu_type="$2" ;; "--refresh_rate") refresh_rate="$2" ;; "--gtk_shorthand") gtk_shorthand="$2" ;; "--gtk2") gtk2="$2" ;; diff --git a/neofetch.1 b/neofetch.1 index b1494b4b..2136425d 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -68,6 +68,9 @@ Unsupported on Windows \fB\-\-gpu_brand\fR on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel) .TP +\fB\-\-gpu_type\fR type +Which GPU to display. (all, dedicated, integrated) +.TP \fB\-\-gtk_shorthand\fR on/off Shorten output of gtk theme/icons .TP