blob: 4521cc1c9dce1d65194ac610631bc1a6522776a0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
module Config (config) where
import Control.Monad.IO.Class
import Control.Monad.Loops
import Control.Monad.RWS (MonadReader (ask))
import qualified Wetterhorn.Core.KeyEvent as KeyEvent
import Wetterhorn.Core.Keys
import Wetterhorn.Core.W
import Wetterhorn.Layout.Full
alsoLog :: KeyHandler -> W ()
alsoLog kh =
putKeyHandler
( \ke -> do
liftIO $ putStrLn $ (: []) $ KeyEvent.codepoint ke
kh ke
)
config :: Config WindowLayout
config =
defaultConfig
{ hooks =
defaultHooks
{ keyHook = keysWithHandler alsoLog $ do
ignoreReleaseEvents
bind (Mod1 .+ 'r') (shellExec "wofi --show run")
bind (Shift .+ Mod1 .+ 'R') requestHotReload
bind (Mod1 .+ 't') (shellExec "alacritty")
subbind (Mod1 .+ 'l') $ do
bind 'l' $ wio $ putStrLn "lololololo"
bind 'j' $ wio $ putStrLn "JOGGING!"
subbind (Mod1 .+ 'p') $ do
str <-
unfoldM
( do
ke <- ask
if KeyEvent.codepoint ke == '\r'
then return Nothing
else do
Just (KeyEvent.codepoint ke) <$ nextKeyPress
)
liftIO $ putStrLn $ "You input: " ++ str
bind (str == "hello") $ do
liftIO $ putStrLn "You Win! *\\o/*"
liftIO $ putStrLn "You Lose :("
forwardEvent,
surfaceHook = do
handleSurface
},
layout = WindowLayout Full
}
|