added playlist key

This commit is contained in:
2025-08-27 17:59:35 +02:00
parent ea9ff0501d
commit 1463d292f2
2 changed files with 24 additions and 15 deletions

View File

@@ -273,10 +273,10 @@ if [ "${1:-}" = "--fzf-key" ]; then
*",$FZF_KEY,"*) mpv_toggle_pause >/dev/null ;;
esac
case ",$KEYS_PLAY_NEXT," in
*",$FZF_KEY,"*) [ "$path" ] && mpv_next >/dev/null ;;
*",$FZF_KEY,"*) mpv_next >/dev/null ;;
esac
case ",$KEYS_PLAY_PREV," in
*",$FZF_KEY,"*) [ "$path" ] && mpv_prev >/dev/null ;;
*",$FZF_KEY,"*) mpv_prev >/dev/null ;;
esac
case ",$KEYS_SEEK_FORWARD," in
*",$FZF_KEY,"*) mpv_seek_forward >/dev/null ;;
@@ -399,6 +399,12 @@ if [ "${1:-}" = "--fzf-key" ]; then
QUERY="$secsymb "
;;
esac
case ",$KEYS_SHOW_PLAYLIST," in
*",$FZF_KEY,"*)
MODE_NEXT="$MODE_PLAYLIST"
ACCEPT=1
;;
esac
[ "${QUERY:-}" ] && printf "+change-query(%s)" "$QUERY"
if [ "$MODE_NEXT" ]; then
printf "%s#%s" "$MODE_NEXT" "${MODE_NEXT_ARGS:-}" >"$MODEFILE"
@@ -545,15 +551,9 @@ while true; do
column -t -s "$(printf '\t')" |
sed 's| \+\([0-9a-f-]\+\)$|\t\1|' |
$FZF \
--bind="$KEYS_HALFPAGE_DOWN:transform:$0 --fzf-key" \
--bind="$KEYS_HALFPAGE_UP:transform:$0 --fzf-key" \
--bind="$KEYS_BROWSE:transform:$0 --fzf-key {2}" \
--bind="$KEYS_FILTER_LOCAL:transform:$0 --fzf-key" \
--bind="$KEYS_TOGGLE_PLAY_PAUSE:transform:$0 --fzf-key" \
--bind="$KEYS_PLAY_NEXT:transform:$0 --fzf-key" \
--bind="$KEYS_PLAY_PREV:transform:$0 --fzf-key" \
--bind="$KEYS_SEEK_FORWARD:transform:$0 --fzf-key" \
--bind="$KEYS_SEEK_BACKWARD:transform:$0 --fzf-key" \
--bind="$KEYS_HALFPAGE_DOWN,$KEYS_HALFPAGE_UP,\
$KEYS_BROWSE,\
$KEYS_FILTER_LOCAL:transform:$0 --fzf-key {2} {3}" \
-1 \
--border="bold" \
--border-label="Select artist" \
@@ -569,6 +569,15 @@ while true; do
"$MODE_PLAYLIST")
count=$(mpv_playlist_count)
foo "Playlist: count=$count"
# --bind="$KEYS_HALFPAGE_DOWN,$KEYS_HALFPAGE_UP,\
#$KEYS_BROWSE,\
#$KEYS_IN,$KEYS_OUT,\
#$KEYS_SELECT_ARTIST,\
#$KEYS_FILTER_LOCAL,$KEYS_FILTER_PRIMARY,$KEYS_FILTER_SECONDARY,\
#$KEYS_SWITCH_ARTIST_ALBUM,$KEYS_SWITCH_LOCAL_REMOTE,\
#$KEYS_PLAY,$KEYS_QUEUE,$KEYS_TOGGLE_PLAY_PAUSE,\
#$KEYS_PLAY_NEXT,$KEYS_PLAY_PREV,\
#$KEYS_SEEK_FORWARD,$KEYS_SEEK_BACKWARD:transform:$0 --fzf-key {2} {3}" \
printf "%s#%s" "$MODE_LIST_ARTISTS" "" >"$MODEFILE"
;;
*) # Main instance
@@ -583,9 +592,8 @@ $KEYS_IN,$KEYS_OUT,\
$KEYS_SELECT_ARTIST,\
$KEYS_FILTER_LOCAL,$KEYS_FILTER_PRIMARY,$KEYS_FILTER_SECONDARY,\
$KEYS_SWITCH_ARTIST_ALBUM,$KEYS_SWITCH_LOCAL_REMOTE,\
$KEYS_PLAY,$KEYS_QUEUE,$KEYS_TOGGLE_PLAY_PAUSE,\
$KEYS_PLAY_NEXT,$KEYS_PLAY_PREV,\
$KEYS_SEEK_FORWARD,$KEYS_SEEK_BACKWARD:transform:$0 --fzf-key {2} {3}" \
$KEYS_PLAY,$KEYS_QUEUE,\
$KEYS_SHOW_PLAYLIST:transform:$0 --fzf-key {2} {3}" \
--info="inline-right" \
--info-command="$0 --fzf-info" \
--preview-window="right,25%,border-left,wrap,<30(hidden)" \