Fix polybar player-mpris script
This commit is contained in:
parent
499c012601
commit
c9026ce0c1
2 changed files with 6 additions and 5 deletions
1
.bin/.e
1
.bin/.e
|
@ -11,6 +11,7 @@ declare -A mapper=(
|
||||||
["git"]="$HOME/.config/git/config"
|
["git"]="$HOME/.config/git/config"
|
||||||
["git-ignore"]="$HOME/.config/git/ignore"
|
["git-ignore"]="$HOME/.config/git/ignore"
|
||||||
["home-manager"]="$HOME/.config/nixpkgs/home.nix"
|
["home-manager"]="$HOME/.config/nixpkgs/home.nix"
|
||||||
|
["polybar"]="$HOME/.config/polybar"
|
||||||
["qutebrowser"]="$HOME/.config/qutebrowser/common.py"
|
["qutebrowser"]="$HOME/.config/qutebrowser/common.py"
|
||||||
["starship"]="$HOME/.config/starship.toml"
|
["starship"]="$HOME/.config/starship.toml"
|
||||||
["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
|
["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
alias playerctl="playerctl -p spotifyd"
|
playerctl="playerctl -p spotifyd"
|
||||||
|
|
||||||
player_status=$(playerctl status 2> /dev/null)
|
player_status=$($playerctl status 2> /dev/null)
|
||||||
|
|
||||||
if [ "$player_status" = "Playing" ]; then
|
if [ "$player_status" = "Playing" ]; then
|
||||||
echo " $(playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
|
echo " $($playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
|
||||||
elif [ "$player_status" = "Paused" ]; then
|
elif [ "$player_status" = "Paused" ]; then
|
||||||
echo " $(playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
|
echo " $($playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue