From c9026ce0c19ddcdfa6dbe42218247b580300e52d Mon Sep 17 00:00:00 2001
From: Tobias Reisinger <tobias@msrg.cc>
Date: Tue, 3 Jan 2023 02:15:35 +0100
Subject: [PATCH] Fix polybar player-mpris script

---
 .bin/.e                                        |  1 +
 .config/polybar/scripts/player-mpris-simple.sh | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/.bin/.e b/.bin/.e
index 9e57d9b..0ec6214 100755
--- a/.bin/.e
+++ b/.bin/.e
@@ -11,6 +11,7 @@ declare -A mapper=(
 	["git"]="$HOME/.config/git/config"
 	["git-ignore"]="$HOME/.config/git/ignore"
 	["home-manager"]="$HOME/.config/nixpkgs/home.nix"
+	["polybar"]="$HOME/.config/polybar"
 	["qutebrowser"]="$HOME/.config/qutebrowser/common.py"
 	["starship"]="$HOME/.config/starship.toml"
 	["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
diff --git a/.config/polybar/scripts/player-mpris-simple.sh b/.config/polybar/scripts/player-mpris-simple.sh
index f8bee72..a32596b 100755
--- a/.config/polybar/scripts/player-mpris-simple.sh
+++ b/.config/polybar/scripts/player-mpris-simple.sh
@@ -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
-    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
-    echo " $(playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
+    echo " $($playerctl metadata -f '{{title}} - {{artist}} | {{duration(position)}}/{{duration(mpris:length)}}')"
 else
     echo ""
 fi