Browse Source

polybar music script update

master
Akshay Pushparaj 4 years ago
parent
commit
a62579fe0f
  1. 8
      neomutt/neomuttrc
  2. 21
      polybar/scripts/music

8
neomutt/neomuttrc

@ -186,10 +186,10 @@ source /usr/lib/neomutt/source-neomuttrc.d|
#set query_command = "khard email --parsable --search-in-source-files '%s'"
set mbox_type = Maildir
set smtp_url = "https://example.com:587 "
set smtp_pass = "secret"
set folder = ""
set imap_pass = "secret"
set smtp_url = "smtp://akshay@10.22.13.6:25"
set smtp_pass = "Mee1ujo2eegeingu"
set folder = "imaps://akshay@10.22.13.6:143"
set imap_pass = "Mee1ujo2eegeingu"
set realname = "Akshay Pushparaj"
set spoolfile = "+INBOX"
set ssl_starttls = yes

21
polybar/scripts/music

@ -10,22 +10,31 @@ if [ "$down" = "$none" -o "$down" = "Stopped" ]; then
else
tracklength=$(playerctl metadata mpris:length 2>&1| sed 's/.\{6\}$//')
current=$(playerctl position 2>&1 | sed 's/.\{7\}$//')
if [ "$tracklength" -ge 3600 ]; then
if [ "$tracklength" = "No player could handle this c" ]; then
duration=""
elif [ "$tracklength" -ge 3600 ]; then
duration=$(date -d@"$tracklength" -u +%H:%M:%S 2>&1)
else
echo $tracklength
duration=$(date -d@"$tracklength" -u +%M:%S 2>&1)
fi
if [ "$current" -ge 3600 ]; then
if [ "$current" = "No player could handle this " ]; then
position = ""
elif [ "$current" -ge 3600 ]; then
position=$(date -d@"$current" -u +%H:%M:%S 2>&1)
else
position=$(date -d@"$current" -u +%M:%S 2>&1)
fi
artist=$(playerctl metadata xesam:artist 2>&1)
song=$(playerctl metadata xesam:title 2>&1)
if [ "$down" = "Playing" ]; then
echo "$song | $position"
elif [ "$down" = "Paused" ]; then
echo "$song | $position | $duration | paused"
if [ "$down" = "Playing" -a "$position" != "" ]; then
echo "$song - $position"
elif [ "$down" = "Paused" -a "$position" != "" ]; then
echo "$song | $position - $duration"
elif [ "$down" = "Playing" -a "$position" = "" ]; then
echo "$song"
elif [ "$down" = "Paused" -a "$position" = "" ]; then
echo "$song"
else
exit
fi

Loading…
Cancel
Save