34

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.

Bovine
  • 534
MrBlue
  • 351
  • Welcome to AskUbuntu, how about Alt+Tab, or to kill application by System Monitor > Processes? – Sadaharu Wakisaka Jan 01 '20 at 23:51
  • alt+tab takes me back to whatever I was on last, spotify is still in fullscreen and I can see it behind the activities bar. I can close out of it just fine by pressing the windows key and clicking the X, but whenever I relaunch it, it goes back to full screen. – MrBlue Jan 02 '20 at 00:42
  • Alt+Space: you can bring the window menu, Alt+drag: you can drag windows which you can't grab the window bar. For this problem, someone already resolved by deleting $HOME/.config/spotify – Sadaharu Wakisaka Jan 02 '20 at 01:51
  • If using wmctrl make sure of the right usage of the "-r" argument. -r . If you are listening to music, the title of the spotify window changes changes to "artist - song title" which leaves the command wmctrl -r spotify -b toggle,fullscreen not finding the right window. – dav Mar 30 '21 at 12:29
  • Try to use wmctrl if you dont know what the process is called you can first do wmctrl -l – Jesse de gans May 02 '23 at 13:02

7 Answers7

83

Minimally invasive fix without dependencies for simple copy & paste - 2023

Regular installation (RPM / DEB)

  1. Close Spotify
  2. Run sed -i "/\b\(app.window.position\)\b/d" -- $HOME/.config/spotify/prefs
  3. Run Spotify

Flatpak installation

  1. Close Spotify
  2. Run sed -i "/\b\(app.window.position\)\b/d" -- $HOME/.var/app/com.spotify.Client/config/spotify/prefs
  3. Run Spotify

Snap installation

  1. Close Spotify
  2. Run sed -i "/\b\(app.window.position\)\b/d" -- $HOME/snap/spotify/current/.config/spotify/prefs
  3. 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.

dreua
  • 946
  • 3
    also works with the snap version; sed -i "/\b\(app.window.position\)\b/d" -- $HOME/snap/spotify/current/.config/spotify/prefs – FObersteiner Sep 21 '21 at 18:23
10

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

EDIT!

There's a better solution which solves the issue without deleting the file. Do not delete the file unless no other solution works for you

  • 2
    No need to kill everything with fire, just remove the lines containing app.window.position from from the prefs file. See my answer on how to do that with sed. Should work with snaps, too, if you adjust the file path. – dreua Apr 11 '21 at 11:28
  • This action will erase ALL configuration for the app. Most likely, none of your shortcuts will work afterward! – Nate T Aug 02 '21 at 07:56
  • This is a panic response and shouldn't have as many upvotes as it does.

    Reluctant to give it a downvote as it will fix the issue, but it will likely cause other issues too.

    – Tisch Feb 17 '22 at 15:08
  • I've updated my answer to avoid people preferring my solution, because you're completely right, @Tisch, it was a "panic" solution which did work – Lasse Brustad Nov 24 '22 at 13:04
7

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.

KokoseiJ
  • 71
  • 1
  • 1
5

Please follow the steps below to exit Full Screen on Spotify:

Open a Terminal window and install wmctrl:

sudo apt install wmctrl

While Spotify is running, pause the music and run the following command:

wmctrl -r spotify -b toggle,fullscreen

It should go back to windowed mode and you may keep playing your music ;)

  • For me the toggle option did not work, but wmctrl -r spotify -b remove,fullscreen did, using Ubuntu 21.04 with spotify snap package. – Kristian Jul 28 '21 at 08:04
  • Worked for similar issue with Plex Media Player. Ubuntu 22.04. – rgin Sep 10 '23 at 07:28
2

It depends if you have installed spotify through snap. In my case, I had installed spotify in snap. In this case:

  1. Goto spotify in snap folder. Notice the number 42 may change so use ls to know what number is in your case.

    cd snap/spotify/42/.config/spotify
    
  2. Then edit the preferences file:

    gedit prefs
    
  3. Set the number for app.window.position.width to a different value. It worked for me the value as reported in this thread Full-screen-under-Ubuntu-18-04 which is 1320.

    app.window.position.width=1320
    
  4. Save changes and start spotify. It should not be in full screen.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
LeninGF
  • 121
  • wmctrl did not work for me. This worked like a charm on Ubuntu 20.04.2 LTS, Spotify version 1.1.55.498.gf9a83c60. – Sunanda Mar 23 '21 at 15:01
  • Isn't their an "auto" value? – Nate T Aug 02 '21 at 07:58
  • @MitaliCyrus That is because it sounds like the app isn't in fullscreen. It is just configured to be bigger than the screen. This can be fixed with wmctrl but with a different sub-command. – Nate T Aug 02 '21 at 08:03
1

I just went into my files, showed hidden files, went into the Spotify folder, opened prefs under .config/spotify and changed app.window.position.saved=true to app.window.position.saved=false after the other things didn't helpt. idk but it seems to have worked

kane
  • 11
0

Are you using an app or extension that forces applications to open full-screen? I use one on my Fedora 24 for WXChat that lets me put apps on a specific screen and position, including full screen. one-liner solution:

sed -i -E -e 's|(^app.window.position.saved)=true|\1=false|'
-e 's|(^app.window.position.height)=.|\1=920|'
-e 's|(^app.window.position.width)=.
|\1=1200|'
.var/app/com.spotify.Client/config/spotify/prefs