Attempt to react to screen event
This commit is contained in:
parent
05ca473721
commit
ebeb708303
2 changed files with 27 additions and 6 deletions
20
lib/ScreenEvents.hs
Normal file
20
lib/ScreenEvents.hs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
module ScreenEvents (
|
||||||
|
ScreenEvents.modify
|
||||||
|
) where
|
||||||
|
|
||||||
|
import XMonad
|
||||||
|
import Data.Monoid (All(..))
|
||||||
|
import Graphics.X11.Xlib.Extras (Event(RRScreenChangeNotifyEvent))
|
||||||
|
|
||||||
|
screenChangeHandler :: Event -> X All
|
||||||
|
screenChangeHandler (RRScreenChangeNotifyEvent _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) =
|
||||||
|
spawn "~/.fehbg" >> return (All True)
|
||||||
|
screenChangeHandler _ = return (All True)
|
||||||
|
|
||||||
|
modify :: XConfig l -> XConfig l
|
||||||
|
modify conf = conf
|
||||||
|
{ handleEventHook = mconcat
|
||||||
|
[ screenChangeHandler
|
||||||
|
, handleEventHook conf ] }
|
||||||
|
|
||||||
|
|
13
xmonad.hs
13
xmonad.hs
|
@ -19,7 +19,6 @@ import XMonad.Layout.Spacing
|
||||||
import XMonad.Layout.ThreeColumns (ThreeCol(..))
|
import XMonad.Layout.ThreeColumns (ThreeCol(..))
|
||||||
import XMonad.Layout.ToggleLayouts (toggleLayouts)
|
import XMonad.Layout.ToggleLayouts (toggleLayouts)
|
||||||
|
|
||||||
|
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import qualified Solarized as S
|
import qualified Solarized as S
|
||||||
|
|
||||||
|
@ -28,6 +27,7 @@ import KeyBindings as Keys (modify)
|
||||||
import MouseBindings as Mouse (modify)
|
import MouseBindings as Mouse (modify)
|
||||||
import Projects (modify)
|
import Projects (modify)
|
||||||
import Scratchpad (modify)
|
import Scratchpad (modify)
|
||||||
|
import ScreenEvents (modify)
|
||||||
|
|
||||||
-------------------- toggle btw vvvvvvvvvv or vvvvv
|
-------------------- toggle btw vvvvvvvvvv or vvvvv
|
||||||
--layouts = titleBar $ toggleLayouts fullscreen tiled
|
--layouts = titleBar $ toggleLayouts fullscreen tiled
|
||||||
|
@ -62,11 +62,12 @@ myManageHook = composeOne
|
||||||
|
|
||||||
------------ build the full config
|
------------ build the full config
|
||||||
withConfig =
|
withConfig =
|
||||||
Projects.modify -- Apply projects config
|
Projects.modify -- Apply projects config
|
||||||
$ Keys.modify -- Apply keybindings config
|
$ Keys.modify -- Apply keybindings config
|
||||||
$ Mouse.modify -- Apply mouse bindings config
|
$ Mouse.modify -- Apply mouse bindings config
|
||||||
$ Scratchpad.modify -- Apply scratchpad managehook config
|
$ Scratchpad.modify -- Apply scratchpad managehook config
|
||||||
$ desktopConfig -- on a default desktop config
|
$ ScreenEvents.modify -- Apply screen event hook config
|
||||||
|
$ desktopConfig -- on a default desktop config
|
||||||
{ manageHook = myManageHook <+> manageHook desktopConfig
|
{ manageHook = myManageHook <+> manageHook desktopConfig
|
||||||
, layoutHook = desktopLayoutModifiers layouts
|
, layoutHook = desktopLayoutModifiers layouts
|
||||||
, terminal = "nvidia-offload alacritty"
|
, terminal = "nvidia-offload alacritty"
|
||||||
|
|
Loading…
Reference in a new issue