'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 1:[1]
Your problem is specific to ndarray -> its typing has 2 arguments - shape and data type.
TypeError: 'type' object is not subscriptable is because you are passing a float as a shape argument, which is supposed to be list-like. (Although personally I got more clear error on Python 3.10 - TypeError: Too few arguments for numpy.ndarray
This will work:
from typing import Any
def get_distance(arr1: np.ndarray[Any, float], arr2: np.ndarray[Any, float]) -> int:
Solution 2:[2]
I'm not sure I've understood your question, but if you want np.ndarray[float]to be shown, that's exactly what you need to pass instead of just np.ndarray, like this:
def get_distance(arr1: np.ndarray[float], arr2: np.ndarray[float]) -> int:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | matszwecja |
| Solution 2 | Sofia Fernandes |
