mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-10 11:13:04 +03:00
27 lines
642 B
Bash
Executable file
27 lines
642 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# declare -A status_icon
|
|
|
|
case $BLOCK_BUTTON in
|
|
1) mpc toggle &> /dev/null ;;
|
|
3) notify-send "$(mpc)" ;;
|
|
esac
|
|
|
|
status_icon=(["playing"]="" ["paused"]="" ["stopped"]="")
|
|
song_name=$(mpc current -f '\[%artist%\] %title%')
|
|
if [[ ! -z "$song_name" ]]; then
|
|
mpc status | sed -sn 2p | awk -v NAME="$song_name" '{
|
|
switch ($1) {
|
|
case "[paused]":
|
|
status=""
|
|
break
|
|
case "[playing]":
|
|
status=""
|
|
break
|
|
}
|
|
printf("%s %s %s\n", status, $3, NAME)
|
|
printf("%s\n", status)
|
|
}'
|
|
else
|
|
echo ""
|
|
fi
|