Modify music player scripts to use spotifyd

This commit is contained in:
Wiktor Zykubek 2020-12-21 12:51:42 +01:00
parent 0e831ebd9f
commit 82669efb95
2 changed files with 21 additions and 9 deletions

View File

@ -1,7 +1,7 @@
super + Return
$($TERMINAL)
super + {_,ctrl,alt +} b
{search,firefox,tor-browser}
{search,chromium,tor-browser}
super + {_,shift +} d
rofi -show {run,drun}
super + shift + s
@ -54,15 +54,15 @@ XF86Audio{Raise,Lower}Volume
amixer sset Master 5%{+,-} && refbar
# songs control
XF86Audio{Next,Prev}
mpc {next,prev} && refbar
playerctl {next,previous} && refbar
ctrl + XF86Audio{Next,Prev}
mpc seek {+,-}4
# pause/play
{XF86AudioPlay,super + slash}
mpc toggle && refbar
playerctl play-pause && refbar
# stop
XF86AudioStop
mpc stop && refbar
playerctl stop && refbar
ctrl + alt + {Left,Up,Down,Right}
rotscreen {left,normal,inverted,right}

View File

@ -1,11 +1,23 @@
#!/bin/sh
if playerctl metadata --format={{playerName}} | grep -q "spotifyd"; then
echo ""
else
echo ""
if mpc status | grep -q "playing"; then
mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[playing\\].*//g"
elif mpc status | grep -q "paused"; then
fi
# if mpc status | grep -q "playing"; then
# mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[playing\\].*//g"
# elif mpc status | grep -q "paused"; then
# echo ""
# else
# echo ""
# fi
if playerctl --player=spotifyd status | grep -q "Playing"; then
playerctl metadata --format "{{ artist }} - {{ title }}"
elif playerctl --player=spotifyd status | grep -q "Paused"; then
echo ""
else
echo ""
fi