aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/RebindKeys.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-11-23 00:30:20 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-11-23 00:30:20 -0700
commit901f50f904bfea282c9cb1c8575d3da14a49f256 (patch)
tree5bfb8152e1db8f8c3e4af6053140ae304ac630a0 /src/Rahm/Desktop/RebindKeys.hs
parent1f25484605881af1a8e1475565d2ceb20b88ea85 (diff)
downloadrde-901f50f904bfea282c9cb1c8575d3da14a49f256.tar.gz
rde-901f50f904bfea282c9cb1c8575d3da14a49f256.tar.bz2
rde-901f50f904bfea282c9cb1c8575d3da14a49f256.zip
Remove NoPersist.hs. It is redundant to ExtensionClass.
Diffstat (limited to 'src/Rahm/Desktop/RebindKeys.hs')
-rw-r--r--src/Rahm/Desktop/RebindKeys.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Rahm/Desktop/RebindKeys.hs b/src/Rahm/Desktop/RebindKeys.hs
index 6e8d212..b77b328 100644
--- a/src/Rahm/Desktop/RebindKeys.hs
+++ b/src/Rahm/Desktop/RebindKeys.hs
@@ -16,7 +16,6 @@ import qualified Data.Map as Map
)
import Data.Monoid (All (..))
import Rahm.Desktop.Logger ()
-import Rahm.Desktop.NoPersist (NoPersist (..))
import Text.Printf ()
import XMonad
( Default (def),
@@ -55,10 +54,10 @@ import qualified XMonad.Util.ExtensibleState as XS (get, modify)
type WindowHook = Query ()
newtype InterceptState
- = InterceptState (NoPersist (Map (KeyMask, KeySym) (X ())))
+ = InterceptState (Map (KeyMask, KeySym) (X ()))
newtype RemapState
- = RemapState (NoPersist (Map (Window, (KeyMask, KeySym)) (X ())))
+ = RemapState (Map (Window, (KeyMask, KeySym)) (X ()))
instance ExtensionClass InterceptState where
initialValue = InterceptState def
@@ -68,7 +67,7 @@ instance ExtensionClass RemapState where
remapHook :: Event -> X All
remapHook event = do
- RemapState (NoPersist map) <- XS.get
+ RemapState map <- XS.get
case event of
KeyEvent {ev_window = win, ev_event_type = typ, ev_keycode = code, ev_state = m}
@@ -118,9 +117,8 @@ remapKey keyFrom action = do
XConf {display = disp, theRoot = rootw} <- ask
doGrab disp window keyFrom
- XS.modify $ \(RemapState (NoPersist keyMap)) ->
+ XS.modify $ \(RemapState keyMap) ->
RemapState $
- NoPersist $
Map.insert (window, keyFrom) action keyMap
-- sendKey, but as a query.