diff --git a/README.md b/README.md index 4d27643..fc35a85 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,16 @@ and indicators. Recent Ubuntu releases support this requirement *almost* out of the box, thanks to a dedicated GNOME Flashback session that uses xmonad as the window manager. However, with an empty configuration, you won't have panels. With the default -`XMonad.Config.Gnome`, many keybindings won't work properly due to conflicts -with GNOME keybindings or bugs. So I thought I'd put together a curated minimal -xmonad config that fixes these issues but otherwise gives you a clean slate to -add your own favorite configuration options. +`XMonad.Config.Gnome`, there are still some unacceptable problems: + +* Many keybindings won't work properly due to conflicts with GNOME keybindings + or bugs. +* Applications going fullscreen (like media players or browsers) is not + supported. + +So I thought I'd put together a curated minimal xmonad config that fixes these +issues but otherwise gives you a clean slate to add your own favorite +configuration options. Setup ----- diff --git a/xmonad.hs b/xmonad.hs index 6699552..c7f78a8 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -1,13 +1,46 @@ import XMonad import XMonad.Config.Gnome +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.SetWMName (setWMName) import XMonad.Util.EZConfig import XMonad.Util.Run main = xmonad $ gnomeConfig { -- Use Win key rather than Alt. Alt is used by GNOME for many things. - modMask = mod4Mask + modMask = mod4Mask, + startupHook = composeAll [ + startupHook gnomeConfig, + -- fix fullscreen for Firefox + -- https://gist.github.com/sboehler/5f48017a6b53805485180a9a6d81196b + setFullscreenSupported + ], + handleEventHook = composeAll [ + handleEventHook gnomeConfig, + -- fix fullscreen + fullscreenEventHook + ] } `additionalKeys` [ -- Workaround for -- https://bugs.launchpad.net/ubuntu/+source/xmonad/+bug/1813049 ((mod4Mask .|. shiftMask, xK_q), spawn "gnome-session-quit --logout") ] + +setFullscreenSupported :: X () +setFullscreenSupported = withDisplay $ \dpy -> do + r <- asks theRoot + a <- getAtom "_NET_SUPPORTED" + c <- getAtom "ATOM" + supp <- mapM getAtom [ + "_NET_WM_STATE_HIDDEN", + "_NET_WM_STATE_FULLSCREEN", -- XXX Copy-pasted to add this line + "_NET_NUMBER_OF_DESKTOPS", + "_NET_CLIENT_LIST", + "_NET_CLIENT_LIST_STACKING", + "_NET_CURRENT_DESKTOP", + "_NET_DESKTOP_NAMES", + "_NET_ACTIVE_WINDOW", + "_NET_WM_DESKTOP", + "_NET_WM_STRUT" + ] + io $ changeProperty32 dpy r a c propModeReplace (fmap fromIntegral supp) + setWMName "xmonad"