From cfe1014d1a6633e53975d6fd808f40a9dd4c63b0 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 7 Dec 2019 18:00:58 +0100 Subject: [PATCH] Add initial support for DE version --- neofetch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/neofetch b/neofetch index 76668543..e6a45c8a 100755 --- a/neofetch +++ b/neofetch @@ -383,6 +383,17 @@ public_ip_host="http://ident.me" public_ip_timeout=2 +# Desktop Environment + + +# Show Desktop Environment version +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --de_version +de_version="off" + + # Disk @@ -1599,6 +1610,17 @@ get_de() { ((KDE_SESSION_VERSION >= 4)) && de=${de/KDE/Plasma} + if [[ $de_version == on && $de ]]; then + case $de in + "Plasma"*) + de_ver=$(plasmashell --version) + de_ver=${de_ver/* } + ;; + # TODO: Add other DEs + esac + de="$de $de_ver" + fi + de_run=1 } @@ -2752,6 +2774,9 @@ get_style() { # Get DE if user has disabled the function. ((de_run != 1)) && get_de + # remove version from $de + [[ $de_version == on ]] && de=${de/ *} + # Check for DE Theme. case $de in "KDE"* | "Plasma"*) @@ -4523,6 +4548,7 @@ INFO: NOTE: This only supports Linux. + --de_version on/off Show/Hide Desktop Environment version --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 @@ -4698,6 +4724,7 @@ get_args() { "--gpu_brand") gpu_brand="$2" ;; "--gpu_type") gpu_type="$2" ;; "--refresh_rate") refresh_rate="$2" ;; + "--de_version") de_version="$2" ;; "--gtk_shorthand") gtk_shorthand="$2" ;; "--gtk2") gtk2="$2" ;; "--gtk3") gtk3="$2" ;;