mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-21 23:54:22 +01:00
Add xmonad keybinding to force fullscreen
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
06d8b381c4
commit
68b2b3b07d
|
@ -11,8 +11,12 @@
|
|||
-- Normally, you'd only override those defaults you care about.
|
||||
--
|
||||
|
||||
{-# LANGUAGE BlockArguments
|
||||
#-}
|
||||
|
||||
import XMonad
|
||||
import Data.Monoid
|
||||
import Data.List (delete)
|
||||
import Data.Maybe
|
||||
import Data.Function
|
||||
import Data.Functor
|
||||
|
@ -159,6 +163,23 @@ myKeymap c =
|
|||
, ("<XF86TouchpadToggle>" , spawn "@toggle_touchpad@")
|
||||
|
||||
, ("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)
|
||||
]
|
||||
++
|
||||
|
||||
|
|
Loading…
Reference in a new issue