I just installed Tumbleweed KDE Plasma and wanted to use my favorite player, Quod Libet, to play a playlist automatically on login, but unlike the repo version of Quod Libet, which isn’t currently available in the main OpenSUSE repos, the Flatpak version of Quod Libet would resume playback on startup, but wouldn’t select the playlist I wanted after a login, so it would only play one song and then stop.
What follows is the solution I finally came up with, using a shell script that is auto-started at login by KDE. If there’s a better way to do this, please share! If not, maybe this will help someone else.
Here are the steps I took to get it working:
- Use Discover to install the Flatpak version of Quod Libet.
- Add your music library to Quod Libet as prompted on the first start of Quod Libet.
- Copy your Quod Libet playlists to ~/.var/app/io.github.quodlibet.QuodLibet/config/quodlibet/playlists, or use Quod Libet’s Import tool to do so.
- Select a playlist and start playing a track to verify that Quod Libet is working.
- In Quod Libet File > Preferences, make sure “Resume playback on startup” is selected.
- Create a script called autostart_quodlibet.sh (or a name of your choice) with the following, substituting the name of your playlist for
Your Playlist Here:
#!/bin/sh
flatpak run --branch=stable --arch=x86_64 --command=quodlibet --file-forwarding io.github.quodlibet.QuodLibet --run --play-file @@u %U @@ &
sleep 2
/usr/bin/flatpak run --command=quodlibet-remote io.github.quodlibet.QuodLibet --dbus --playlist "Your Playlist Here"
# Keep script alive only while the Flatpak app is running.
while /usr/bin/flatpak ps --columns=application | grep -qx io.github.quodlibet.QuodLibet; do
sleep 5
done
exit 0
- Save the file to ~/.local/bin and make it executable by running
chmod +x autostart_quodlibet.shfrom the ~/.local/bin directory. - Open KDE System Settings > Autostart and add the autostart_quodlibet.sh script as a Login Script.
- Log out, then log back in to test. KDE Autostart should run the script, starting Quod Libet, resuming playback, and selecting the playlist you designated in the script. If you look in KDE Settings > Autostart, the entry should show “Running” as long as Quod Libet is running.
If the Autostart entry is something other than “Running,” it may be that your system’s flatpak ps command, used in the script, is using a different column name than “application”. You can check for the correct column name to use with the command:
flatpak ps --help
Which will list the correct column name to use in the “while” statement in the script.