mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 03:37:10 -04:00
bin: add now-playing
This commit is contained in:
parent
3f9daf48d4
commit
4f028154a4
19
.local/bin/now-playing
Executable file
19
.local/bin/now-playing
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
notify() {
|
||||
notify-send -r 9991 "$@"
|
||||
}
|
||||
|
||||
i=0
|
||||
while IFS= read -r line; do
|
||||
case "$i" in
|
||||
0) track_artist="$line" ;;
|
||||
1) track_title="$line" ;;
|
||||
*) break ;;
|
||||
esac
|
||||
i=$((i + 1))
|
||||
done <<EOF
|
||||
$(MPC_FORMAT="%artist%\n%title%" mpc)
|
||||
EOF
|
||||
|
||||
notify "$track_title" "by $track_artist"
|
Loading…
Reference in a new issue