Add xmonad keybinding to force fullscreen

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-06-28 21:51:03 +02:00
parent 06d8b381c4
commit 68b2b3b07d
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -11,8 +11,12 @@
-- Normally, you'd only override those defaults you care about. -- Normally, you'd only override those defaults you care about.
-- --
{-# LANGUAGE BlockArguments
#-}
import XMonad import XMonad
import Data.Monoid import Data.Monoid
import Data.List (delete)
import Data.Maybe import Data.Maybe
import Data.Function import Data.Function
import Data.Functor import Data.Functor
@ -159,6 +163,23 @@ myKeymap c =
, ("<XF86TouchpadToggle>" , spawn "@toggle_touchpad@") , ("<XF86TouchpadToggle>" , spawn "@toggle_touchpad@")
, ("M-<F1>", spawn "@auxmenu@") , ("M-<F1>", spawn "@auxmenu@")
, ("M-<F11>", withDisplay $ \dpy -> withFocused $ \win -> do
wmstate <- getAtom "_NET_WM_STATE"
fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
wstate <- fromMaybe [] `fmap` getProp32 wmstate win
let
ptype = 4
chWstate f = io $ changeProperty32 dpy win wmstate ptype propModeReplace (f wstate)
isFull = fromIntegral fullsc `elem` wstate
when (not isFull) $ do
chWstate (fromIntegral fullsc:)
windows $ W.float win $ W.RationalRect 0 0 1 1
when isFull $ do
chWstate $ delete (fromIntegral fullsc)
windows $ W.sink win)
] ]
++ ++