altdesktop / playerctl

🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.
GNU Lesser General Public License v3.0
2.48k stars 81 forks source link

Loop Toggle/Switch #306

Open noctuid opened 1 year ago

noctuid commented 1 year ago

It might be nice to have an argument to switch between the available loop settings rather than having to set a specific one.

pickpj commented 1 year ago

Not exactly the same, but I use the following to toggle the track loop on and off. playerctl -p spotify loop | grep Track && playerctl -p spotify loop None || playerctl -p spotify loop Track

alexgherman commented 2 days ago

kind of verbose, but this should go through all the available states:

playerctl -p spotify loop $(case $(playerctl -p spotify loop) in Track) echo Playlist;; Playlist) echo None;; None) echo Track;; esac)