FIX add theme color to nm rofi call

This commit is contained in:
Nathan Dwarshuis 2020-08-15 17:00:13 -04:00
parent 217e524271
commit b77edbfcbb
1 changed files with 17 additions and 28 deletions

View File

@ -32,6 +32,15 @@ myDmenuCmd = "rofi"
spawnDmenuCmd :: [String] -> X () spawnDmenuCmd :: [String] -> X ()
spawnDmenuCmd = spawnCmd myDmenuCmd spawnDmenuCmd = spawnCmd myDmenuCmd
themeArgs :: String -> [String]
themeArgs hexColor =
[ "-theme-str"
, "'#element.selected.normal { background-color: " ++ hexColor ++ "; }'"
]
myDmenuMatchingArgs :: [String]
myDmenuMatchingArgs = ["-i"] -- case insensitivity
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- | Exported Commands -- | Exported Commands
@ -41,39 +50,21 @@ devSecrets = concatMap (\x -> ["-s", x])
, "/media/ndwar/MC3M:user=ndwarshuis3@gatech.edu,host=outlook.office365.com" , "/media/ndwar/MC3M:user=ndwarshuis3@gatech.edu,host=outlook.office365.com"
] ]
myDmenuMatchingArgs :: [String]
myDmenuMatchingArgs = ["-i"] -- case insensitivity
runDevMenu :: X () runDevMenu :: X ()
runDevMenu = spawnCmd "rofi-dev" $ devSecrets ++ rofiArgs runDevMenu = spawnCmd "rofi-dev" $ devSecrets ++ rofiArgs
where where
rofiArgs = rofiArgs = "--" : themeArgs "#999933" ++ myDmenuMatchingArgs
[ "--"
, "-theme-str"
, "'#element.selected.normal { background-color: #999933; }'"
] ++
myDmenuMatchingArgs
runBwMenu :: X () runBwMenu :: X ()
runBwMenu = spawnCmd "rofi-bw" $ runBwMenu = spawnCmd "rofi-bw" $ ["-c", "--"] ++ themeArgs "#bb6600"
[ "-c" ++ myDmenuMatchingArgs
, "--"
, "-theme-str"
, "'#element.selected.normal { background-color: #bb6600; }'"
] ++
myDmenuMatchingArgs
runShowKeys :: [((KeyMask, KeySym), NamedAction)] -> NamedAction runShowKeys :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
runShowKeys x = addName "Show Keybindings" $ do runShowKeys x = addName "Show Keybindings" $ do
(h, _, _, _) <- io $ createProcess' $ (shell' cmd) { std_in = CreatePipe } (h, _, _, _) <- io $ createProcess' $ (shell' cmd) { std_in = CreatePipe }
io $ forM_ h $ \h' -> hPutStr h' (unlines $ showKm x) >> hClose h' io $ forM_ h $ \h' -> hPutStr h' (unlines $ showKm x) >> hClose h'
where cmd = fmtCmd myDmenuCmd $ where cmd = fmtCmd myDmenuCmd $ ["-dmenu", "-p", "commands"]
[ "-dmenu" ++ themeArgs "#a200ff" ++ myDmenuMatchingArgs
, "-p", "commands"
, "-theme-str"
, "'#element.selected.normal { background-color: #a200ff; }'"
] ++
myDmenuMatchingArgs
runCmdMenu :: X () runCmdMenu :: X ()
runCmdMenu = spawnDmenuCmd ["-show", "run"] runCmdMenu = spawnDmenuCmd ["-show", "run"]
@ -82,16 +73,14 @@ runAppMenu :: X ()
runAppMenu = spawnDmenuCmd ["-show", "drun"] runAppMenu = spawnDmenuCmd ["-show", "drun"]
runClipMenu :: X () runClipMenu :: X ()
runClipMenu = spawnDmenuCmd runClipMenu = spawnDmenuCmd $
[ "-modi", "\"clipboard:greenclip print\"" [ "-modi", "\"clipboard:greenclip print\""
, "-show", "clipboard" , "-show", "clipboard"
, "-run-command", "'{cmd}'" , "-run-command", "'{cmd}'"
, "-theme-str", "'#element.selected.normal { background-color: #00c44e; }'" ] ++ themeArgs "#00c44e"
]
runWinMenu :: X () runWinMenu :: X ()
runWinMenu = spawnDmenuCmd ["-show", "window"] runWinMenu = spawnDmenuCmd ["-show", "window"]
runNetMenu :: X () runNetMenu :: X ()
runNetMenu = spawnCmd "networkmanager_dmenu" [] runNetMenu = spawnCmd "networkmanager_dmenu" $ themeArgs "#ff3333"