MPV script to toggle playlist shuffle on/off on the fly without restarting playback.
When the playlist is shuffled, you can choose to keep playing the current track or jump to the first one.
Note
Pre-compiled versions are available on the releases page
Compile the project and copy the script to your mpv scripts folder:
npm ci
npm run build
cp dist/toggle-playlist-shuffle.js ~/.config/mpv/scripts/Create a file in ~/.config/mpv/script-opts/toggle-playlist-shuffle.conf with any of the following options:
| Option | Default | Values | Description |
|---|---|---|---|
shuffle_action |
play_current |
play_current / play_first |
What to do with the current track when enabling shuffle |
key_toggle |
ctrl+shift+s |
Your desired keyboard shortcut | Keybinding to toggle shuffle |
play_current: shuffle and keep playing the current trackplay_first: shuffle and jump to the first track
shuffle_action=play_first
key_toggle=alt+s