mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-12 18:55:57 -07:00
X.A.WorkspaceNames: Use history for completion in renameWorkspace
This commit is contained in:
@@ -248,6 +248,10 @@
|
|||||||
- Added `orIfPrefixed`, a combinator to decide upon an action based
|
- Added `orIfPrefixed`, a combinator to decide upon an action based
|
||||||
on whether any prefix argument was given.
|
on whether any prefix argument was given.
|
||||||
|
|
||||||
|
* `XMonad.Actions.WorkspaceNames`
|
||||||
|
|
||||||
|
- Enabled prompt completion (from history) in `renameWorkspace`.
|
||||||
|
|
||||||
### Other changes
|
### Other changes
|
||||||
|
|
||||||
## 0.17.1 (September 3, 2022)
|
## 0.17.1 (September 3, 2022)
|
||||||
|
@@ -51,7 +51,7 @@ import XMonad.Actions.CycleWS (findWorkspace, WSType(..), Direction1D(..), anyWS
|
|||||||
import qualified XMonad.Actions.SwapWorkspaces as Swap
|
import qualified XMonad.Actions.SwapWorkspaces as Swap
|
||||||
import XMonad.Hooks.StatusBar.PP (PP(..))
|
import XMonad.Hooks.StatusBar.PP (PP(..))
|
||||||
import XMonad.Hooks.EwmhDesktops (addEwmhWorkspaceRename)
|
import XMonad.Hooks.EwmhDesktops (addEwmhWorkspaceRename)
|
||||||
import XMonad.Prompt (mkXPrompt, XPConfig)
|
import XMonad.Prompt (mkXPrompt, XPConfig, historyCompletionP)
|
||||||
import XMonad.Prompt.Workspace (Wor(Wor))
|
import XMonad.Prompt.Workspace (Wor(Wor))
|
||||||
import XMonad.Util.WorkspaceCompare (getSortByIndex)
|
import XMonad.Util.WorkspaceCompare (getSortByIndex)
|
||||||
|
|
||||||
@@ -137,9 +137,11 @@ setCurrentWorkspaceName name = do
|
|||||||
|
|
||||||
-- | Prompt for a new name for the current workspace and set it.
|
-- | Prompt for a new name for the current workspace and set it.
|
||||||
renameWorkspace :: XPConfig -> X ()
|
renameWorkspace :: XPConfig -> X ()
|
||||||
renameWorkspace conf =
|
renameWorkspace conf = do
|
||||||
mkXPrompt pr conf (const (return [])) setCurrentWorkspaceName
|
completion <- historyCompletionP (prompt ==)
|
||||||
where pr = Wor "Workspace name: "
|
mkXPrompt (Wor prompt) conf completion setCurrentWorkspaceName
|
||||||
|
where
|
||||||
|
prompt = "Workspace name: "
|
||||||
|
|
||||||
-- | See 'XMonad.Actions.SwapWorkspaces.swapTo'. This is the same with names.
|
-- | See 'XMonad.Actions.SwapWorkspaces.swapTo'. This is the same with names.
|
||||||
swapTo :: Direction1D -> X ()
|
swapTo :: Direction1D -> X ()
|
||||||
|
Reference in New Issue
Block a user