Add seek functionality.

This commit is contained in:
dabruh 2022-05-29 16:03:39 +02:00
parent 130373db63
commit d70f2b3c66
2 changed files with 8 additions and 5 deletions

View File

@ -5,10 +5,12 @@ bindsym XF86AudioMute exec --no-startup-id pavolctl toggle Master
bindsym XF86AudioMicMute exec --no-startup-id pavolctl toggle Capture bindsym XF86AudioMicMute exec --no-startup-id pavolctl toggle Capture
# Set cmus controls # Set cmus controls
bindsym XF86AudioStop exec --no-startup-id "cmusctl -c stop" bindsym XF86AudioStop exec --no-startup-id "cmusctl -c --stop"
bindsym XF86AudioPlay exec --no-startup-id "cmusctl -c pause" bindsym XF86AudioPlay exec --no-startup-id "cmusctl -c --pause"
bindsym XF86AudioPrev exec --no-startup-id "cmusctl -c prev" bindsym XF86AudioPrev exec --no-startup-id "cmusctl -c --prev"
bindsym XF86AudioNext exec --no-startup-id "cmusctl -c next" 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 # Write cmus file for i3status
exec_always --no-startup-id cmusctl -l -e 2 exec_always --no-startup-id cmusctl -l -e 2

View File

@ -134,7 +134,8 @@ if $LOOP && multiple_instances_running; then
fi fi
fi fi
[ -n "$COMMAND" ] && cmus-remote "--$COMMAND" # shellcheck disable=SC2086
[ -n "$COMMAND" ] && cmus-remote $COMMAND
while true; do while true; do
QUERY_RESULT="$(cmus-remote --query 2>/dev/null)" QUERY_RESULT="$(cmus-remote --query 2>/dev/null)"