Merge pull request #777 from mstraube/new

Various additions and enhancements
This commit is contained in:
Dylan Araps 2017-07-16 09:30:49 +10:00 committed by GitHub
commit eb38e6c553

View file

@ -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)"
;;
@ -1762,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"*)
@ -1788,6 +1794,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"
@ -1827,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")
@ -1859,7 +1869,15 @@ 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
# Default fallback font hardcoded in terminal-preferences.c
[[ -z "$term_font" ]] && term_font="Monospace 12"
;;
esac
}