I'm trying to assign Spotify to a specific workspace but with no luck.

My i3 config file looks like this

exec firefox 
exec spotify

assign [class="Spotify"] $ws4   
assign [class="Firefox"] $ws2

xprop on Spotify gives me this output

WM_CLASS(STRING) = "spotify", "Spotify"
WM_NAME(STRING) = "Spotify"
        window state: Normal
        icon window: 0x0
XdndProxy(WINDOW): window id # 0x1a00002
        program specified location: 0, 0
        window gravity: Static

At startup both firefox and spotify loads, but only firefox gets placed in its right workspace, and I really can't get what's going on since I'm using the exactly same syntax. I already tried using a different workspace but it doesn't work.

After a bit more of searching I've found a solution in another post


  • 1
    You could try using [instance="spotify"] instead. It might be that the class name "Spotify" does not get assigned until after the window was already created. – Adaephon Jun 7 '18 at 6:45
  • 1
    This didnt work, but I found a solution. I've updated the post – user293588 Jun 7 '18 at 9:33
  • 1
    This behavior is documented exactly on the docs now. And the question has been answered (though improperly in the question itself) – Evan Carroll Nov 24 '18 at 22:38
  • Which is at: i3wm.org/docs/userguide.html#assign_workspace: Another known issue is with Spotify, which doesn’t set the class hints when mapping the window, meaning you’ll have to use a for_window rule to assign Spotify to a specific workspace. – Anne van Rossum Apr 2 at 18:11

(Taken exactly from question). Simply use

for_window [class="Spotify"] move to workspace $ws4

This is also in the the Arch i3 Wiki

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy