diff options
| author | Josh Rahm <rahm@google.com> | 2021-11-01 13:59:03 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2021-11-01 13:59:03 -0600 |
| commit | 1e38cda801d91f39ffe0eeb9808afb32f300098d (patch) | |
| tree | 00164bc14e3af6eaadab2309b5e9918a578e0bae /src/Internal/DMenu.hs | |
| parent | a9b95646b8581e8b0afd4eec99f960d9f42b9c38 (diff) | |
| download | rde-1e38cda801d91f39ffe0eeb9808afb32f300098d.tar.gz rde-1e38cda801d91f39ffe0eeb9808afb32f300098d.tar.bz2 rde-1e38cda801d91f39ffe0eeb9808afb32f300098d.zip | |
Add more DMenu integration & Add ability to change the spacing with Mod+Shift+[].
Diffstat (limited to 'src/Internal/DMenu.hs')
| -rw-r--r-- | src/Internal/DMenu.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Internal/DMenu.hs b/src/Internal/DMenu.hs index c5cac49..d91c7ba 100644 --- a/src/Internal/DMenu.hs +++ b/src/Internal/DMenu.hs @@ -1,10 +1,39 @@ module Internal.DMenu where +import XMonad.Util.Dmenu import XMonad import XMonad.Util.Run import Control.Monad +import Data.Map (Map) +import qualified Data.Map as Map +import XMonad.Util.Run +import Data.List (intercalate) + +data Colors = + Colors { + fg :: String, + bg :: String + } | DefaultColors runDMenu :: X () runDMenu = void $ safeSpawn "/usr/bin/dmenu_run" [ "-p", "Execute ", "-l", "12", "-dim", "0.4"] + +runDMenuPrompt :: String -> Maybe String -> [String] -> X String +runDMenuPrompt prompt color select = + let realColor = maybe [] (\c -> ["-sb", c, "-nf", c]) color + in + runProcessWithInput "/home/rahm/.local/bin/dmenu_debug.sh" ([ + "-p", prompt, + "-l", "12", + "-dim", "0.4" ] ++ realColor) (intercalate "\n" select) + + +runDMenuPromptWithMap :: String -> Maybe String -> Map String a -> X (Maybe a) +runDMenuPromptWithMap prompt color map = do + let realColor = maybe [] (\c -> ["-sb", c, "-nf", c]) color + menuMapArgs "dmenu"([ + "-p", prompt, + "-l", "12", + "-dim", "0.4" ] ++ realColor) map |