Merge branch 'master' of github.com:dylanaraps/neofetch

This commit is contained in:
Dylan Araps 2018-05-17 12:36:55 +10:00
commit 156136121a
2 changed files with 21 additions and 16 deletions

View file

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016-2017 Dylan Araps Copyright (c) 2016-2018 Dylan Araps
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -6,7 +6,7 @@
# #
# The MIT License (MIT) # The MIT License (MIT)
# #
# Copyright (c) 2016-2017 Dylan Araps # Copyright (c) 2016-2018 Dylan Araps
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -435,6 +435,8 @@ disk_subtitle="mount"
# tomahawk # tomahawk
# xmms2d # xmms2d
# yarock # yarock
# sayonara
# vlc
music_player="auto" music_player="auto"
# Format to display song information. # Format to display song information.
@ -447,7 +449,7 @@ music_player="auto"
# default: 'Song: Jet - Get Born - Sgt Major' # default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %album% - %title%" song_format="%artist% - %album% - %title%"
# Print the Artist and Title on separate lines # Print the Artist, Album and Title on separate lines
# #
# Default: 'off' # Default: 'off'
# Values: 'on', 'off' # Values: 'on', 'off'
@ -455,9 +457,10 @@ song_format="%artist% - %album% - %title%"
# #
# Example: # Example:
# on: 'Artist: The Fratellis' # on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger' # 'Song: Chelsea Dagger'
# #
# off: 'Song: The Fratellis - Chelsea Dagger' # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off" song_shorthand="off"
@ -2389,7 +2392,9 @@ get_song() {
-e "spotify" \ -e "spotify" \
-e "tomahawk" \ -e "tomahawk" \
-e "xmms2d" \ -e "xmms2d" \
-e "yarock")" -e "yarock" \
-e "sayonara" \
-e "vlc")"
[[ "$music_player" && "$music_player" != "auto" ]] && \ [[ "$music_player" && "$music_player" != "auto" ]] && \
player="$music_player" player="$music_player"
@ -2401,8 +2406,8 @@ get_song() {
dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \ dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \ org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
string:'Metadata' |\ string:'Metadata' |\
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ awk -F '"' 'BEGIN {RS=" entry"}; /xesam:artist/ {a = $4} /xesam:album/ {b = $4}
awk -F '"' '/artist/ {a=$2} /album"/ {b=$2} /title/ {t=$2} END{print a " ‡ " b " ‡ " t}' /xesam:title/ {t = $4} END {print a " ‡ " b " ‡ " t}'
)" )"
} }
@ -2421,14 +2426,12 @@ get_song() {
"bluemindo"*) get_song_dbus "Bluemindo" ;; "bluemindo"*) get_song_dbus "Bluemindo" ;;
"guayadeque"*) get_song_dbus "guayadeque" ;; "guayadeque"*) get_song_dbus "guayadeque" ;;
"yarock"*) get_song_dbus "yarock" ;; "yarock"*) get_song_dbus "yarock" ;;
"deepin-music"*) get_song_dbus "deepinmusic" ;; "deepin-music"*) get_song_dbus "DeepinMusic" ;;
"tomahawk"*) get_song_dbus "tomahawk" ;; "tomahawk"*) get_song_dbus "tomahawk" ;;
"elisa"*) get_song_dbus "elisa" ;; "elisa"*) get_song_dbus "elisa" ;;
"sayonara"*) get_song_dbus "sayonara" ;;
"audacious"*) "audacious"*) get_song_dbus "audacious" ;;
song="$(audtool current-song)" "vlc"*) get_song_dbus "vlc" ;;
[[ -z "$song" || "$song_shorthand" == "on" ]] && get_song_dbus "audacious"
;;
"cmus"*) "cmus"*)
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "}; song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
@ -2907,8 +2910,10 @@ END
fi fi
term_font="$(awk '/^[\S\n_#]+?font_family\s+?/ {$1="";gsub(/^[[:space:]]/,"");font=$0}\ term_font="$(awk '/^[\S\n_#]+?font_family\s+?/
/^[\S\n_#]+?font_size\s+?\d+?/ { size = $2 } END { print font " " size}' \ { $1 = ""; gsub(/^[[:space:]]/, ""); font = $0 }
/^[\S\n_#]+?font_size\s+?\d+?/
{ size = $2 } END { print font " " size}' \
"${kitty_file}")" "${kitty_file}")"
;; ;;