Search code examples
spotifyxmonad

xmonad doesnt recognize the Spotify Window


my ManageHook doesn't recognize the Spotify Window, so i can't automatically move it to the Workspace I want it to be opened in. It works fine with every other Window, except Spotify.

Heres my Managehook:

myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll . concat $
    [ [ isDialog --> doCenterFloat ]
    , [ isFullscreen --> doFullFloat ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doIgnore | c <- bars ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doFloat | c <- float ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doCenterFloat | c <- cfloat ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift "0" | c <- ws0 ] -- 0
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 0) | c <- ws1 ] -- i
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 1) | c <- ws2 ] -- ii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 2) | c <- ws3 ] --iii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 3) | c <- ws4 ] -- iv
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 4) | c <- ws5 ] -- v
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 5) | c <- ws6 ] -- vi
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 6) | c <- ws7 ] -- vii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 7) | c <- ws8 ] -- viii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 8) | c <- ws9 ] -- ix
    ]
     where
     bars    = ["dzen2","desktop_window"]
     float   = ["feh","conky_mpd"]
     cfloat  = ["Xmessage","Gxmessage","Eog","xclock"]
            ++ ["SimpleScreenRecorder","Evolution-alarm-notify","Evolution","Gns3","Mtpaint","Calculator","world-clock","wifi-qrcode","agenda-term","arandr"]
            ++ ["xeyes", "pinentry","zoiper","blueman-manager","system-config-printer","Solaar", "nm-connection-editor", "Save File", "Gscreenshot", "qalculate-gtk"]
     ws0     = [""]                             --
     ws1     = [""]               --dev
     ws2     = ["Mozilla Firefox", "Opera", "vivaldi-stable", "min"] --www
     ws3     = ["Spotify"]                             --mus
     ws4     = ["postman"]                             --doc
     ws5     = ["VirtualBox Manager"]           --vbox
     ws6     = ["discord", "zoom", "Mail"]                      --chat
     ws7     = [""]                      --sys
     ws8     = ["mpv", "vlc"]                   --vid
     ws9     = ["Gimp", "Olive", "obs"]                         --gfx
     role    = stringProperty "WM_WINDOW_ROLE" -- example

and Spotify's xprop outpout:

XdndProxy(WINDOW): window id # 0x1c00004
_NET_WM_DESKTOP(CARDINAL) = 0
WM_CLASS(STRING) = "spotify", "Spotify"
WM_NAME(STRING) = "Spotify"
_NET_WM_NAME(UTF8_STRING) = "Spotify"
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: 0, 0
_NET_WM_PID(CARDINAL) = 18790
WM_CLIENT_MACHINE(STRING) = "arch-acer"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING

I already tried recompiling the xmonad config and rebooting, which didn't change anything


Solution

  • Similar issue on Reddit was asked here, where an answer suggests the links below.

    Briefly said, it helps to use DynamicProperty. A concrete example how to use it was posted here.