Making XMonad Work with Zoom

by Peter Stuart on September 6, 2021

Making XMonad work smoothly with Zoom takes some configuration. Here are some problems I’ve run into, with the solutions I’ve found.

Screen Sharing

If Zoom doesn’t give you the option to share individual windows when screen sharing, you need to use ewmh from XMonad.Hooks.EwmhDesktops.Reddit: xmonad window sharing with Zoom

If the “You are screen sharing” / “Stop Share” controls which appear at the top of the screen when you are screen sharing have a black background, and sometimes disappear when you change windows, you need to use a compositor. I use picom.

Floating Notification Windows

Zoom shows notification windows when you join audio (eg. “You are connected to computer audio”) and when people start screen sharing. By default, these windows will be tiled, but they should be floated. Because many of the windows change their title shortly after they are created, matching by title in a custom manageHook doesn’t work, since that doesn’t watch for changes to window titles. Instead, you need to also observe window title changes using XMonad.Hooks.DynamicProperty.Ethan Schoonover on the Arch Linux forums

I have a single manageZoomHook which I include in both my custom manageHook and my custom handleEventHook (using dynamicTitle from XMonad.Hooks.DynamicProperty):

manageZoomHook =
  composeAll $
    [ (className =? zoomClassName) <&&> shouldFloat <$> title --> doFloat,
      (className =? zoomClassName) <&&> shouldSink <$> title --> doSink
    ]
  where
    zoomClassName = "zoom"
    tileTitles =
      [ "Zoom - Free Account", -- main window
        "Zoom - Licensed Account", -- main window
        "Zoom", -- meeting window on creation
        "Zoom Meeting" -- meeting window shortly after creation
      ]
    shouldFloat title = title `notElem` tileTitles
    shouldSink title = title `elem` tileTitles
    doSink = (ask >>= doF . W.sink) <+> doF W.swapDown

myManageHook =
  manageZoomHook
    <+> manageDocks
    <+> manageHook defaultConfig

myHandleEventHook =
  mconcat
    [ dynamicTitle manageZoomHook,
      docksEventHook,
      handleEventHook defaultConfig
    ]