From d70f2b3c66ce81b3b3b54f0660ab2eabb83e8b6c Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Sun, 29 May 2022 16:03:39 +0200 Subject: [PATCH] Add seek functionality. --- .config/i3/layers/config.post-main-10-audio | 10 ++++++---- .local/bin/cmusctl | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.config/i3/layers/config.post-main-10-audio b/.config/i3/layers/config.post-main-10-audio index 9ba53ed..ca90061 100644 --- a/.config/i3/layers/config.post-main-10-audio +++ b/.config/i3/layers/config.post-main-10-audio @@ -5,10 +5,12 @@ bindsym XF86AudioMute exec --no-startup-id pavolctl toggle Master bindsym XF86AudioMicMute exec --no-startup-id pavolctl toggle Capture # Set cmus controls -bindsym XF86AudioStop exec --no-startup-id "cmusctl -c stop" -bindsym XF86AudioPlay exec --no-startup-id "cmusctl -c pause" -bindsym XF86AudioPrev exec --no-startup-id "cmusctl -c prev" -bindsym XF86AudioNext exec --no-startup-id "cmusctl -c next" +bindsym XF86AudioStop exec --no-startup-id "cmusctl -c --stop" +bindsym XF86AudioPlay exec --no-startup-id "cmusctl -c --pause" +bindsym XF86AudioPrev exec --no-startup-id "cmusctl -c --prev" +bindsym XF86AudioNext exec --no-startup-id "cmusctl -c --next" +bindsym Ctrl+XF86AudioPrev exec --no-startup-id "cmusctl -c '--seek -5s'" +bindsym Ctrl+XF86AudioNext exec --no-startup-id "cmusctl -c '--seek +5s'" # Write cmus file for i3status exec_always --no-startup-id cmusctl -l -e 2 diff --git a/.local/bin/cmusctl b/.local/bin/cmusctl index 8438850..36707d2 100755 --- a/.local/bin/cmusctl +++ b/.local/bin/cmusctl @@ -134,7 +134,8 @@ if $LOOP && multiple_instances_running; then fi fi -[ -n "$COMMAND" ] && cmus-remote "--$COMMAND" +# shellcheck disable=SC2086 +[ -n "$COMMAND" ] && cmus-remote $COMMAND while true; do QUERY_RESULT="$(cmus-remote --query 2>/dev/null)"