How can I have over 9 workspaces in xmonad?

I can change the names of the workspaces and supposedly just add more by changing this constant:

myWorkspaces = ["1","2","3⌂","4","5","6","7✉","8☺","9♫"] 

If I add something to the array, there will be more workspaces, but how do I bind them? Mod-1-Mod-9 is by default, but I cannot find documentation on how to change this default value.

+7
haskell desktop xmonad
source share
2 answers

I found the answer buried in this sample configuration and, along with a list of key names , it looks like this:

Definition of the tenth workspace:

 myExtraWorkspaces = [(xK_0, "0"),(xK_minus, "tmp"),(xK_equal, "swap")] myWorkspaces = ["1","2","3⌂","4","5","6","7✉","8☺","9♫"] ++ (map snd myExtraWorkspaces) 

Then the key binding looks like this:

 myKeys = [ -- ... some more keys ... ] ++ [ ((myModMask, key), (windows $ W.greedyView ws)) | (key,ws) <- myExtraWorkspaces ] ++ [ ((myModMask .|. shiftMask, key), (windows $ W.shift ws)) | (key,ws) <- myExtraWorkspaces ] 

In this example, a slash key is used, but any other key from the list above can be used instead.

And finally:

 main = do xmonad $ config { workspaces = myWorkspaces } `additionalKeys` (myKeys) 
+9
source share
 -- | The default number of workspaces (virtual screens) and their names. -- By default we use numeric strings, but any string may be used as a -- workspace name. The number of workspaces is determined by the length -- of this list. -- -- A tagging example: -- -- > workspaces = ["web", "irc", "code" ] ++ map show [4..9] -- workspaces :: [WorkspaceId] workspaces = map show [1 .. 9 :: Int] 

Change the list length in Config.hs

0
source share

All Articles