You can run a second command if the first one fails also, like this: (spotify 1>/dev/null 2>&1 &) & sleep 3 & qdbus / spotify:album:4m2880jivSbbyEGAKfITCaĭepending on how long time Spotify uses to cold start (reboot to check), you can increase or decrease the sleep time (in seconds). So & and & are two completely different things. & is used to run a command after the previous succeeds. We must use paranthesis to daemonize (put in background) when combining multiple commands. Adding & puts Spotify in the background, while 1>/dev/null 2>&1 ignores any output. Your example won't work, because the two last commands won't run before you quit Spotify. Either create and save the script I mentioned, and then run that script, or use a single command that combines all of them.
I wonder if the result of the script (open spotify and play URI) could be obtained with a single command from terminal Thank you olejon, both your command and the script worked great. Commands to play songs and playlists from terminal.