mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Merge pull request #108 from liskin/workspacenames
X.A.WorkspaceNames: add get(Current)WorkspaceName
This commit is contained in:
commit
65bbe1a995
@ -25,6 +25,8 @@ module XMonad.Actions.WorkspaceNames (
|
|||||||
renameWorkspace,
|
renameWorkspace,
|
||||||
workspaceNamesPP,
|
workspaceNamesPP,
|
||||||
getWorkspaceNames,
|
getWorkspaceNames,
|
||||||
|
getWorkspaceName,
|
||||||
|
getCurrentWorkspaceName,
|
||||||
setWorkspaceName,
|
setWorkspaceName,
|
||||||
setCurrentWorkspaceName,
|
setCurrentWorkspaceName,
|
||||||
|
|
||||||
@ -97,6 +99,17 @@ getWorkspaceNames = do
|
|||||||
Nothing -> wks
|
Nothing -> wks
|
||||||
Just s -> wks ++ ":" ++ s
|
Just s -> wks ++ ":" ++ s
|
||||||
|
|
||||||
|
-- | Gets the name of a workspace, if set, otherwise returns nothing.
|
||||||
|
getWorkspaceName :: WorkspaceId -> X (Maybe String)
|
||||||
|
getWorkspaceName w = do
|
||||||
|
WorkspaceNames m <- XS.get
|
||||||
|
return $ M.lookup w m
|
||||||
|
|
||||||
|
-- | Gets the name of the current workspace. See 'getWorkspaceName'
|
||||||
|
getCurrentWorkspaceName :: X (Maybe String)
|
||||||
|
getCurrentWorkspaceName = do
|
||||||
|
getWorkspaceName =<< gets (W.currentTag . windowset)
|
||||||
|
|
||||||
-- | Sets the name of a workspace. Empty string makes the workspace unnamed
|
-- | Sets the name of a workspace. Empty string makes the workspace unnamed
|
||||||
-- again.
|
-- again.
|
||||||
setWorkspaceName :: WorkspaceId -> String -> X ()
|
setWorkspaceName :: WorkspaceId -> String -> X ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user