playerctl: update playerctl config

This commit is contained in:
lelgenio 2023-02-08 17:12:54 -03:00
parent bd31b35e6b
commit 775181e570
4 changed files with 34 additions and 18 deletions

View file

@ -34,6 +34,7 @@ create_scripts
showkeys =
[ ]; # This will not work unless programs.wshowkeys is enabled systemwide
terminal = [ alacritty ];
playerctl-status = [ playerctl ];
wpass = [ final.wdmenu fd pass sd wl-clipboard wtype ];
screenshotsh =
[ capitaine-cursors grim slurp jq sway wl-clipboard xdg-user-dirs ];

14
scripts/playerctl-status Normal file
View file

@ -0,0 +1,14 @@
#!/bin/sh
PLAYERCTL="playerctl --ignore-player=mpd"
STATUS="$(env LC_ALL=C $PLAYERCTL status title)"
TITLE="$($PLAYERCTL metadata title)"
ARTIST="$($PLAYERCTL metadata artist)"
test "$STATUS" = "Playing" \
&& printf " %s" "$TITLE" \
&& test -n "$ARTIST" \
&& printf " - %s" "$ARTIST"
echo ""