module Config (config) where import Control.Monad.IO.Class import Control.Monad.Loops import Wetterhorn.Core.KeyEvent qualified as KeyEvent import Wetterhorn.Core.Keys import Wetterhorn.Core.W import Wetterhorn.Layout.Full alsoLog :: KeyContinuation -> W () alsoLog kh = putKeyHandler ( \ke -> do liftIO $ putStrLn $ (: []) $ KeyEvent.codepoint ke kh ke ) config :: Config WindowLayout config = defaultConfig { hooks = defaultHooks { surfaceHook = do handleSurface }, layout = WindowLayout Full, resetHook = do useKeysWithContinuation alsoLog $ do kp <- nextKeyPress bind kp (Mod1 .+ 'r') (shellExec "wofi --show run") bind kp (Shift .+ Mod1 .+ 'R') requestHotReload bind kp (Mod1 .+ 't') (shellExec "alacritty") bind kp (weak $ Mod1 .+ '∫') (shellExec "gxmessage hi") bind kp (Mod1 .+ 'p') $ do str <- unfoldM ( do ke <- nextKeyPress return $ if KeyEvent.codepoint ke == '\r' then Nothing else Just (KeyEvent.codepoint ke) ) liftIO $ putStrLn $ "You input: " ++ str bind kp (str == "hello") $ do wio $ putStrLn "You Win! *\\o/*" liftIO $ putStrLn "You lose :(" forwardEvent kp }