From 6f1ae617ff60bb9251b0b8c14aa763d829639158 Mon Sep 17 00:00:00 2001 From: edward-p Date: Mon, 1 Apr 2019 00:03:02 +0800 Subject: [PATCH 1/5] Handle ${GTK2_RC_FILES} with multiple values --- neofetch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 55e53238..27ce9b0b 100755 --- a/neofetch +++ b/neofetch @@ -2683,8 +2683,15 @@ get_style() { # Check for general GTK2 Theme. if [[ -z "$gtk2_theme" ]]; then - if [[ -f "${GTK2_RC_FILES:-${HOME}/.gtkrc-2.0}" ]]; then - gtk2_theme="$(grep "^[^#]*${name}" "${GTK2_RC_FILES:-${HOME}/.gtkrc-2.0}")" + if [[ -n "${GTK2_RC_FILES}" ]]; then + for gtkrc in ${GTK2_RC_FILES//:/ }; do + _gtk2_theme="$(grep "^[^#]*${name}" "${gtkrc}")" + [[ -n "${_gtk2_theme}" ]] && gtk2_theme="${_gtk2_theme}" + done + unset _gtk2_theme + + elif [[ -f "${HOME}/.gtkrc-2.0" ]]; then + gtk2_theme="$(grep "^[^#]*${name}" "${HOME}/.gtkrc-2.0")" elif [[ -f "/etc/gtk-2.0/gtkrc" ]]; then gtk2_theme="$(grep "^[^#]*${name}" /etc/gtk-2.0/gtkrc)" From 836197fc2e24ee0b7d63b358c77100eea80c42af Mon Sep 17 00:00:00 2001 From: edward-p Date: Fri, 3 May 2019 02:27:59 +0800 Subject: [PATCH 2/5] make some changes --- neofetch | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 27ce9b0b..fb94116f 100755 --- a/neofetch +++ b/neofetch @@ -2684,12 +2684,8 @@ get_style() { # Check for general GTK2 Theme. if [[ -z "$gtk2_theme" ]]; then if [[ -n "${GTK2_RC_FILES}" ]]; then - for gtkrc in ${GTK2_RC_FILES//:/ }; do - _gtk2_theme="$(grep "^[^#]*${name}" "${gtkrc}")" - [[ -n "${_gtk2_theme}" ]] && gtk2_theme="${_gtk2_theme}" - done - unset _gtk2_theme - + IFS=: read -ra rc_files <<< "$GTK2_RC_FILES" + gtk2_theme="$(grep "^[^#]*${name}" "${rc_files[@]}")" elif [[ -f "${HOME}/.gtkrc-2.0" ]]; then gtk2_theme="$(grep "^[^#]*${name}" "${HOME}/.gtkrc-2.0")" @@ -2701,7 +2697,7 @@ get_style() { fi - gtk2_theme="${gtk2_theme/${name}*=}" + gtk2_theme="${gtk2_theme/*${name}*=}" fi # Check for general GTK3 Theme. From d128f1cf1e95b06d89a0a43328e582e05c456313 Mon Sep 17 00:00:00 2001 From: edward-p Date: Fri, 3 May 2019 16:28:22 +0800 Subject: [PATCH 3/5] use "$GTK2_RC_FILES" --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index fb94116f..60c5cbe2 100755 --- a/neofetch +++ b/neofetch @@ -2683,7 +2683,7 @@ get_style() { # Check for general GTK2 Theme. if [[ -z "$gtk2_theme" ]]; then - if [[ -n "${GTK2_RC_FILES}" ]]; then + if [[ -n "$GTK2_RC_FILES" ]]; then IFS=: read -ra rc_files <<< "$GTK2_RC_FILES" gtk2_theme="$(grep "^[^#]*${name}" "${rc_files[@]}")" elif [[ -f "${HOME}/.gtkrc-2.0" ]]; then From 77c4e7d799994b7d973a1b0d583db9cf91103a15 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 4 May 2019 16:56:36 +0200 Subject: [PATCH 4/5] song: add gogglesmm --- neofetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neofetch b/neofetch index 776167d6..50350aed 100755 --- a/neofetch +++ b/neofetch @@ -449,6 +449,7 @@ disk_subtitle="mount" # exaile # gnome-music # gmusicbrowser +# gogglesmm # guayadeque # iTunes # juk @@ -2424,6 +2425,7 @@ get_song() { "exaile" "gnome-music" "gmusicbrowser" + "gogglesmm" "guayadeque" "iTunes" "juk" @@ -2493,6 +2495,7 @@ get_song() { "smplayer"*) get_song_dbus "smplayer" ;; "rhythmbox"*) get_song_dbus "rhythmbox" ;; "strawberry"*) get_song_dbus "strawberry" ;; + "gogglesmm"*) get_song_dbus "gogglesmm" ;; "netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;; "plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;; From 497dd4303ec3fb484620a265b365df665c566942 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 4 May 2019 17:00:49 +0200 Subject: [PATCH 5/5] song: add xnoise --- neofetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neofetch b/neofetch index 50350aed..fbc28733 100755 --- a/neofetch +++ b/neofetch @@ -470,6 +470,7 @@ disk_subtitle="mount" # tomahawk # vlc # xmms2d +# xnoise # yarock music_player="auto" @@ -2448,6 +2449,7 @@ get_song() { "tomahawk" "vlc" "xmms2d" + "xnoise" "yarock" ) @@ -2496,6 +2498,7 @@ get_song() { "rhythmbox"*) get_song_dbus "rhythmbox" ;; "strawberry"*) get_song_dbus "strawberry" ;; "gogglesmm"*) get_song_dbus "gogglesmm" ;; + "xnoise"*) get_song_dbus "xnoise" ;; "netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;; "plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;