Xmonad无法识别Spotify窗口
我的ManageHook无法识别Spotify窗口,因此我无法将其移至我希望打开的工作区域。它可以与其他所有窗口一起使用,除了Spotify。
这是我的managhook:
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
和Spotify的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
我已经尝试重新编译Xmonad配置和重新启动,这没有改变任何东西
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里,答案是一个答案,下面的链接。
简而言之,它有助于使用。
一个具体的示例如何发布在这里。
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.