aboutsummaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-03-25 16:07:48 -0600
committerJosh Rahm <rahm@google.com>2024-03-25 16:07:48 -0600
commit58857e81a97165541bbc83e63c589d904279c640 (patch)
tree3253d46feb5779d2fabd46e6950786bf42c19e02 /src/Config.hs
parent71190dfcb38fddf6248ee0f1994082f0ea02d502 (diff)
downloadmontis-58857e81a97165541bbc83e63c589d904279c640.tar.gz
montis-58857e81a97165541bbc83e63c589d904279c640.tar.bz2
montis-58857e81a97165541bbc83e63c589d904279c640.zip
Have macro support (again) and some type-level goodness.
Diffstat (limited to 'src/Config.hs')
-rw-r--r--src/Config.hs54
1 files changed, 30 insertions, 24 deletions
diff --git a/src/Config.hs b/src/Config.hs
index ca99aad..0bd0d43 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -1,9 +1,9 @@
+{-# LANGUAGE DataKinds #-}
+
module Config (config) where
-import Control.Monad (unless, when)
-import Control.Monad.IO.Class
-import Control.Monad.Loops
-import Text.Printf
+import Control.Monad (unless)
+import Data.Data (Proxy (Proxy))
import Wetterhorn.Core.W
import Wetterhorn.Dsl.Bind
import Wetterhorn.Dsl.Input
@@ -20,33 +20,39 @@ config =
},
layout = WindowLayout Full,
resetHook = do
- useInputHandler $ do
- ev <- nextInputEvent
+ useInputHandler $
+ withProxies inputProxies $ do
+ ev <- nextInputEvent
- macroSupport
- (Mod1 .+ 'q')
- (weak $ Mod1 .+ '@')
- ev
+ bind ev (released btnLeft) $
+ run $
+ wio $ putStrLn "Left Button Released!!"
- bind ev (released btnLeft) $ do
- wio $ putStrLn "Left Button Released!!"
+ unless (isPressEvent ev) $ do
+ forwardEvent ev
+ continue
- unless (isPressEvent ev) $ do
- forwardEvent ev
- continue
+ bind ev (Shift .+ Mod1 .+ 'R') $ run requestHotReload
- bind ev (Shift .+ Mod1 .+ 'R') requestHotReload
+ bind ev (Mod1 .+ 't') $ run (shellExec "alacritty")
- bind ev (Mod1 .+ 't') (shellExec "alacritty")
+ bind ev (Mod1 .+ 'p') $ do
+ ev2 <- nextInputPressEvent
- bind ev (Mod1 .+ 'p') $ do
- ev2 <- nextInputPressEvent
+ bind ev2 (Mod1 .+ 'p') $
+ run $
+ wio $ putStrLn "Test"
- bind ev2 (Mod1 .+ 'p') $ do
- wio $ putStrLn "Test"
+ bind ev (Mod1 .+ btnLeft) $
+ run $
+ wio $ putStrLn "Left Button Press!!"
- bind ev (Mod1 .+ btnLeft) $ do
- wio $ putStrLn "Left Button Press!!"
+ bind ev (Mod1 .+ 'q') macroStartStopKeybind
- forwardEvent ev
+ bind ev (weak $ Mod1 .+ '@') macroReplayKeybind
+
+ forwardEvent ev
}
+ where
+ inputProxies :: Proxy '[MacroSupport, KeyLogger]
+ inputProxies = Proxy