Adds delay to mediactrl

This commit is contained in:
Michel Fedde 2025-04-18 13:43:05 +02:00
parent 6d141a1a3b
commit 9d145716ff

View file

@ -30,6 +30,7 @@ stop_playback() {
# Display notification with song information # Display notification with song information
show_music_notification() { show_music_notification() {
sleep 0.5s
status=$(playerctl status) status=$(playerctl status)
if [[ "$status" == "Playing" ]]; then if [[ "$status" == "Playing" ]]; then
song_title=$(playerctl metadata title) song_title=$(playerctl metadata title)
@ -42,19 +43,19 @@ show_music_notification() {
# Get media control action from command line argument # Get media control action from command line argument
case "$1" in case "$1" in
"--nxt") "--nxt")
play_next play_next
;; ;;
"--prv") "--prv")
play_previous play_previous
;; ;;
"--pause") "--pause")
toggle_play_pause toggle_play_pause
;; ;;
"--stop") "--stop")
stop_playback stop_playback
;; ;;
*) *)
echo "Usage: $0 [--nxt|--prv|--pause|--stop]" echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
exit 1 exit 1
;; ;;