From 082c53e57e26fa20aaab85e9a2a083bbd8f3da12 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 15:16:41 +0200 Subject: [PATCH 1/6] Song: Add support for Pogo --- neofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index f8b0bb3f..f9e6671e 100755 --- a/neofetch +++ b/neofetch @@ -1336,7 +1336,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/ awk|Helper|Cache|ibus|indicator/) && /mpd|mopidy|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/ awk|Helper|Cache|ibus|indicator/) && /mpd|mopidy|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo/ {printf $5 " " $6; exit}')" get_song_dbus() { # Multiple players use an almost identical dbus command to get the information. @@ -1416,6 +1416,11 @@ get_song() { awk -F'"' '/artist/ {getline; a=$2} /title/ {getline; t=$2} END{print a " - " t}')" ;; + "pogo"*) + song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player org.freedesktop.MediaPlayer.GetMetadata | + awk -F'"' '/string "artist"/ {getline; a=$2} /string "title"/ {getline; t=$2} END{print a " - " t}')" + ;; + *) mpc >/dev/null 2>&1 && song="$(mpc current)" ;; From 70b7816b6ca8d1778bd92aa0db21042b69519a29 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 15:27:11 +0200 Subject: [PATCH 2/6] Term: Add font support for LXTerminal --- neofetch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neofetch b/neofetch index f9e6671e..17c6b429 100755 --- a/neofetch +++ b/neofetch @@ -1793,6 +1793,10 @@ get_term_font() { [[ "$profile_filename" ]] && term_font="$(awk -F '=|,' '/Font=/ {print $2 " " $3}' "$profile_filename")" ;; + "lxterminal"*) + term_font="$(awk -F '=' '/fontname=/ {print $2; exit}' "${XDG_CONFIG_HOME}/lxterminal/lxterminal.conf")" + ;; + "mate-terminal") # To get the actual config we have to create a temporarily file with the --save-config option. mateterm_config="/tmp/mateterm.cfg" From 99438ec16b642060e536ef9f1e07066ebce643f2 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 16:36:45 +0200 Subject: [PATCH 3/6] Term: Fix xfce4-terminal when using system-font --- neofetch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 17c6b429..895dbe43 100755 --- a/neofetch +++ b/neofetch @@ -1868,7 +1868,14 @@ get_term_font() { ;; "xfce4-terminal") - term_font="$(awk -F '=' '/^FontName/ {a=$2} END{print a}' "${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc")" + term_font="$(awk -F '=' '/^FontName/ {a=$2} /^FontUseSystem=TRUE/ {a=$0} END{print a}' "${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc")" + + if [[ "$term_font" == "FontUseSystem=TRUE" ]]; then + term_font="$(gsettings get org.gnome.desktop.interface monospace-font-name)" + term_font="$(trim_quotes "$term_font")" + fi + # TODO: Figure out how to get the fallback font when not using system-font + # and no font is set in the config file. ;; esac } From 2fb963fcb827cebf15571b25ac0dfbda4da643b5 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 17:32:42 +0200 Subject: [PATCH 4/6] Term: Simplify Hyper font detection --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 895dbe43..4ba90936 100755 --- a/neofetch +++ b/neofetch @@ -1767,7 +1767,8 @@ get_term_font() { ;; "Hyper"*) - term_font="$(awk -F "," '/fontFamily/ {a=$1} END{print a}' "${HOME}/.hyper.js" | awk -F "'" '{a=$2} END{print a}')" + term_font="$(awk -F':|,' '/fontFamily/ {print $2; exit}' "${HOME}/.hyper.js")" + term_font="$(trim_quotes "$term_font")" ;; "konsole"*) From 9596b0b921c278ebe86509bb40ec39f870008d07 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 17:39:22 +0200 Subject: [PATCH 5/6] General: Exit awk early --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 4ba90936..7b9369df 100755 --- a/neofetch +++ b/neofetch @@ -1837,7 +1837,7 @@ get_term_font() { ;; "sakura"*) - term_font="$(awk -F '=' '/^font=/ {a=$2} END{print a}' "${XDG_CONFIG_HOME}/sakura/sakura.conf")" + term_font="$(awk -F '=' '/^font=/ {print $2; exit}' "${XDG_CONFIG_HOME}/sakura/sakura.conf")" ;; "terminology") From b6b6083d2b65c30a3fcc14345b9ccaa0278093e1 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 15 Jul 2017 20:29:19 +0200 Subject: [PATCH 6/6] Term: Add xfce4-terminal fallback font --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 7b9369df..054c4f26 100755 --- a/neofetch +++ b/neofetch @@ -1875,8 +1875,9 @@ get_term_font() { term_font="$(gsettings get org.gnome.desktop.interface monospace-font-name)" term_font="$(trim_quotes "$term_font")" fi - # TODO: Figure out how to get the fallback font when not using system-font - # and no font is set in the config file. + + # Default fallback font hardcoded in terminal-preferences.c + [[ -z "$term_font" ]] && term_font="Monospace 12" ;; esac }