From ce2a49e9a0fd6ce4d7500714e681f0940d14da33 Mon Sep 17 00:00:00 2001 From: mcneb10 Date: Wed, 9 Aug 2023 01:23:36 -0500 Subject: [PATCH 1/3] Display global KDE Plasma theme --- neofetch | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 97498f93..a9ef9a54 100755 --- a/neofetch +++ b/neofetch @@ -3943,8 +3943,13 @@ get_style() { qt_theme="$(grep "^${kde}" "$kde_config_file")" qt_theme="${qt_theme/*=}" - kde_theme="$(grep "^${kde}" "$kde_config_file")" - kde_theme="${kde_theme/*=}" + if [[ "$kde" == "widgetStyle" ]] && [[ $(grep "\[Theme\]" $HOME/.config/plasmarc) ]]; then + kde_theme="$(awk '/name=/ {gsub(/name=/,"",$0);print $0;exit}' $HOME/.config/plasmarc)" + else + kde_theme="$(grep "^${kde}" "$kde_config_file")" + kde_theme="${kde_theme/*=}" + fi + if [[ "$kde" == "font" ]]; then kde_font_size="${kde_theme#*,}" kde_font_size="${kde_font_size/,*}" @@ -3961,7 +3966,7 @@ get_style() { kde_theme="$(grep "${kde}" "$kde_config_file")" kde_theme="${kde_theme/*=}" fi - kde_theme="$kde_theme [KDE], " + #kde_theme="$kde_theme [KDE], " else err "Theme: KDE config files not found, skipping." fi @@ -4132,11 +4137,13 @@ get_style() { gtk2_theme="$(trim "$gtk2_theme")" gtk3_theme="$(trim "$gtk3_theme")" qt_theme="$(trim "$qt_theme")" + kde_theme="$(trim "$kde_theme")" # Remove quotes. gtk2_theme="$(trim_quotes "$gtk2_theme")" gtk3_theme="$(trim_quotes "$gtk3_theme")" qt_theme="$(trim_quotes "$qt_theme")" + kde_theme="$(trim_quotes "$kde_theme")" # Handle Qt theme engines that load external themes case "$qt_theme" in @@ -4155,6 +4162,7 @@ get_style() { [[ "$gtk2" == "off" ]] && unset gtk2_theme [[ "$gtk3" == "off" ]] && unset gtk3_theme [[ "$qt" == "off" ]] && unset qt_theme + # TODO: kde theme visibility # Format the string based on which themes exist. # append_theme theme toolkit @@ -4170,6 +4178,7 @@ get_style() { } theme='' local cur_theme='' + append_theme "$kde_theme" 'KDE' append_theme "$fly_theme" 'Fly' append_theme "$qt_theme" 'Qt' append_theme "$gtk2_theme" 'GTK2' From 98feca03f9fe47d4aade102e2bbdc4a812256412 Mon Sep 17 00:00:00 2001 From: mcneb10 Date: Wed, 9 Aug 2023 13:04:55 -0500 Subject: [PATCH 2/3] Don't try to display XDG_SESSION_TYPE on Windows --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index a9ef9a54..7dd64986 100755 --- a/neofetch +++ b/neofetch @@ -2438,7 +2438,7 @@ get_de() { # TODO: # - New config option + flag: --de_display_server on/off ? # - Add display of X11, Arcan and anything else relevant. - [[ $de ]] && + [[ $de ]] && [[ $os != "Windows" ]] && de+=" (${XDG_SESSION_TYPE})" de_run=1 From b5e9edfae7444a8640e2acc5ad58a33a54458084 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 9 Aug 2023 18:26:00 -0700 Subject: [PATCH 3/3] [F] Fix shellcheck warnings --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 7dd64986..85f16de8 100755 --- a/neofetch +++ b/neofetch @@ -3943,8 +3943,8 @@ get_style() { qt_theme="$(grep "^${kde}" "$kde_config_file")" qt_theme="${qt_theme/*=}" - if [[ "$kde" == "widgetStyle" ]] && [[ $(grep "\[Theme\]" $HOME/.config/plasmarc) ]]; then - kde_theme="$(awk '/name=/ {gsub(/name=/,"",$0);print $0;exit}' $HOME/.config/plasmarc)" + if [[ "$kde" == "widgetStyle" ]] && grep -q "\[Theme\]" "$HOME/.config/plasmarc"; then + kde_theme="$(awk '/name=/ {gsub(/name=/,"",$0);print $0;exit}' "$HOME/.config/plasmarc")" else kde_theme="$(grep "^${kde}" "$kde_config_file")" kde_theme="${kde_theme/*=}"