diff options
| author | Josh Rahm <rahm@google.com> | 2021-11-01 13:59:03 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:45 -0600 |
| commit | 8475c103767344bd9c6a47052794cc14675d24cd (patch) | |
| tree | 00164bc14e3af6eaadab2309b5e9918a578e0bae /src/Internal/Lib.hs | |
| parent | 3cd8f412028b78a8a2624e0d184213781cb2218e (diff) | |
| download | rde-8475c103767344bd9c6a47052794cc14675d24cd.tar.gz rde-8475c103767344bd9c6a47052794cc14675d24cd.tar.bz2 rde-8475c103767344bd9c6a47052794cc14675d24cd.zip | |
Add more DMenu integration & Add ability to change the spacing with Mod+Shift+[].
Diffstat (limited to 'src/Internal/Lib.hs')
| -rw-r--r-- | src/Internal/Lib.hs | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/Internal/Lib.hs b/src/Internal/Lib.hs index e0b78c5..feb5f26 100644 --- a/src/Internal/Lib.hs +++ b/src/Internal/Lib.hs @@ -3,6 +3,7 @@ module Internal.Lib where import Prelude hiding ((!!)) +import XMonad.Util.Run import XMonad.Prompt import XMonad.Prompt.Input import XMonad.Prompt.Shell @@ -19,6 +20,7 @@ import Text.Printf import XMonad hiding (workspaces, Screen) import XMonad.StackSet hiding (filter, focus) import qualified Data.Map as Map +import Internal.DMenu type WorkspaceName = Char newtype Selector = Selector (forall a. (Eq a) => a -> [a] -> a) @@ -123,15 +125,22 @@ windowJump = do windowTitlesToWinId <- withWindowSet $ \ss -> Map.fromList <$> mapM (\wid -> (,) <$> getString wid <*> return wid) (allWindows ss) - mkXPrompt - WinPrompt - xpConfig - (\input -> return $ filter (fuzzyCompletion input) (Map.keys windowTitlesToWinId)) $ - \str -> do + windowId <- runDMenuPromptWithMap "Window" (Just "#f542f5") windowTitlesToWinId + + case windowId of + Nothing -> return () + Just wid -> do saveLastMark markContext - case Map.lookup str windowTitlesToWinId of - Just w -> focus w - Nothing -> - case filter (fuzzyCompletion str) (Map.keys windowTitlesToWinId) of - [s] -> mapM_ focus (Map.lookup s windowTitlesToWinId) - _ -> return () + focus wid + -- mkXPrompt + -- WinPrompt + -- xpConfig + -- (\input -> return $ filter (fuzzyCompletion input) (Map.keys windowTitlesToWinId)) $ + -- \str -> do + -- saveLastMark markContext + -- case Map.lookup str windowTitlesToWinId of + -- Just w -> focus w + -- Nothing -> + -- case filter (fuzzyCompletion str) (Map.keys windowTitlesToWinId) of + -- [s] -> mapM_ focus (Map.lookup s windowTitlesToWinId) + -- _ -> return () |