aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-11-21 22:14:50 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-11-21 22:14:50 -0700
commit80057a6ed33f07f3a91a7a1d3552b222804b5d9e (patch)
tree249b2cda2074991adead57843d77db9d475bb514 /src/Rahm/Desktop/Keys
parent8888a83ef06d16d4bdd3c06bef721fff43f04175 (diff)
downloadrde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.tar.gz
rde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.tar.bz2
rde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.zip
Rudimentary pending buffer shown in Xmobar.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 1c8d073..10f2b5f 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -34,6 +34,7 @@ import Rahm.Desktop.Marking
import qualified Rahm.Desktop.StackSet as W
import Rahm.Desktop.Submap
import Rahm.Desktop.Workspaces
+import Rahm.Desktop.XMobarLog.PendingBuffer
import System.Exit (ExitCode (..), exitWith)
import Text.Printf
import XMonad
@@ -182,7 +183,10 @@ class (Monad m) => KeyFeeder m where
instance KeyFeeder X where
fromX = id
- readNextKey = mapNextStringWithKeysym
+ readNextKey fn = mapNextStringWithKeysym $
+ \mask sym str -> do
+ lift $ fromX $ addStringToPendingBuffer str
+ fn mask sym str
newtype FeedKeys a = FeedKeys {unFeedKeys :: StateT KeyString X a}
deriving (Monad, Functor, Applicative)
@@ -229,7 +233,7 @@ readNextWorkspaceName = joinMaybe $ workspaceName <$> readNextWorkspace
-- Returns the next workspaces associated with the next set of keystrokes.
readNextWorkspace :: (KeyFeeder m) => MaybeT m Workspace
readNextWorkspace =
- readNextKey $ \mask sym str ->
+ readNextKey $ \mask sym str -> do
case (mask, sym, str) of
(_, e, _) | e == xK_Escape -> MaybeT $ return Nothing
(_, _, [ch]) | isAlphaNum ch || ch == '*' -> return $ justWorkspace [ch]