From 9cd976a21d0c78e6c9291685b4d2efcb6d65a1d7 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 4 Mar 2024 01:46:17 -0700 Subject: Added a new KeysM monad. This monad allows keybindings to look and feel like one is writing blocking code with constructs like: key <- nextKey when (key == x) $ do key2 <- nextKey ... ... but this code does not block or do any io shenanigans, it under the hood just changes the handler on the state. It seems pretty awesome and opens the doors for some pretty expressive key bindings. --- src/Config.hs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/Config.hs') diff --git a/src/Config.hs b/src/Config.hs index e49a869..87a0277 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -1,14 +1,23 @@ -module Config where +module Config (config) where +import Wetterhorn.Core.Keys import Wetterhorn.Core.W import Wetterhorn.Layout.Full -import Wetterhorn.Layout.Combine -config = defaultConfig { - keyHook = wio . print, - surfaceHook = wio . print, - layout = WindowLayout Full -} +config :: Config WindowLayout +config = + defaultConfig + { hooks = + defaultHooks + { keyHook = ofKeys testKeys, + -- runKeybinds $ do + -- bind (Mod1 .+ 'r') (shellExec "wofi --show run") --- wetterhorn :: IO Wetterhorn --- wetterhorn = initWetterhorn defaultConfig + -- subbind (Mod1 .+ 'g') $ do + -- bind 't' $ shellExec "alacritty" + + -- bind (Mod1 .+ 'Q') requestHotReload, + surfaceHook = wio . print + }, + layout = WindowLayout Full + } -- cgit