Cannot exit fullscreen on Spotify
I had Spotify running in fullscreen mode on a second monitor when I closed it and unplugged my laptop. Now Spotify starts in fullscreen mode and I am unable to exit it. Using F11 just skips the current song.
Minimally invasive fix without dependencies for simple copy & paste - 2022
Regular installation (RPM / DEB)
- Close Spotify
- Run
sed -i "/\b\(app.window.position\)\b/d" -- $HOME/.config/spotify/prefs
- Run Spotify
Flatpak installation
- Close Spotify
- Run
sed -i "/\b\(app.window.position\)\b/d" -- $HOME/.var/app/com.spotify.Client/config/spotify/prefs
- Run Spotify
Snap installation
- Close Spotify
- Run
sed -i "/\b\(app.window.position\)\b/d" -- $HOME/snap/spotify/current/.config/spotify/prefs
- Run Spotify
(Thanks to @MrFuppes for the Snap instructions)
Source for sed command: How to remove lines from the text file containing specific words through terminal?
Btw: This is not Ubuntu-Specific, I'm on Fedora Linux.
I've had this issue for a while now, and @Sadaharu Wakisaka commented that for someone, it's already resolved by deleting $HOME/.config/spotify
, but for me, with the snap version, I had to delete $HOME/snap/spotify/current/.config/spotify
while Spotify was not running, and then sign in again
I pulled out a simple script that can toggle fullscreen on Spotify. It uses wmctrl
, but since the other answer uses window title to specify the window and it didn't work out in my system, I used xwininfo
to manually resolve a window ID of Spotify.
It's a one-liner, which is following:
xwininfo -root -tree | grep '("spotify" "Spotify")' | grep -oE '(0x[0-9a-z]{7,8})' | xargs -I % wmctrl -i -r % -b toggle,fullscreen
It grabs info of every window on system, grab spotify's window ID using couple grep
commands, and shoves it into wmctrl command.
It should work regardless of distro as long as you have xwininfo
installed, I use this on Fedora Cinnamon spin.