mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
Merge pull request #601 from ssbothwell/feature/custom-xmonad-prompt-title
Add custom title to xmonad prompts
This commit is contained in:
@@ -302,6 +302,11 @@
|
||||
|
||||
* Add support for GHC 9.0.1.
|
||||
|
||||
* `XMonad.Prompt.XMonad`
|
||||
|
||||
- Added `xmonadPromptCT`, which allows you to create an XMonad
|
||||
prompt with a custom title.
|
||||
|
||||
* `XMonad.Actions.DynamicWorkspaceGroups`
|
||||
|
||||
- Add support for `XMonad.Actions.TopicSpace` through `viewTopicGroup` and
|
||||
|
@@ -17,6 +17,7 @@ module XMonad.Prompt.XMonad (
|
||||
-- $usage
|
||||
xmonadPrompt,
|
||||
xmonadPromptC,
|
||||
xmonadPromptCT,
|
||||
XMonad,
|
||||
) where
|
||||
|
||||
@@ -38,10 +39,10 @@ import XMonad.Prelude (fromMaybe)
|
||||
-- For detailed instruction on editing the key binding see
|
||||
-- "XMonad.Doc.Extending#Editing_key_bindings".
|
||||
|
||||
data XMonad = XMonad
|
||||
newtype XMonad = XMonad String
|
||||
|
||||
instance XPrompt XMonad where
|
||||
showXPrompt XMonad = "XMonad: "
|
||||
showXPrompt (XMonad str) = str <> ": "
|
||||
|
||||
xmonadPrompt :: XPConfig -> X ()
|
||||
xmonadPrompt c = do
|
||||
@@ -50,6 +51,10 @@ xmonadPrompt c = do
|
||||
|
||||
-- | An xmonad prompt with a custom command list
|
||||
xmonadPromptC :: [(String, X ())] -> XPConfig -> X ()
|
||||
xmonadPromptC commands c =
|
||||
mkXPrompt XMonad c (mkComplFunFromList' c (map fst commands)) $
|
||||
xmonadPromptC = xmonadPromptCT "XMonad"
|
||||
|
||||
-- | An xmonad prompt with a custom command list and a custom title
|
||||
xmonadPromptCT :: String -> [(String, X ())] -> XPConfig -> X ()
|
||||
xmonadPromptCT title' commands c =
|
||||
mkXPrompt (XMonad title') c (mkComplFunFromList' c (map fst commands)) $
|
||||
fromMaybe (return ()) . (`lookup` commands)
|
||||
|
Reference in New Issue
Block a user