(SXHkD)~playerctl controls instead of mpc based commands

playerctl is a bit more generic and makes it easier to script
interactions.
This commit is contained in:
2021-03-10 16:06:09 +00:00
parent 8670ea3980
commit 78d0281e29
2 changed files with 5 additions and 11 deletions

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if [[ $# -eq 0 ]]
then
echo "$(mpc volume | tr -d 'volume: ' | tr -d '%')"
elif [[ $# -eq 1 ]]
then
playerctl --player=spotify volume "$(echo $1 | tr -d '%')"
fi