我可以更改工作区的名称,并且可能只是通过更改此常量来添加更多:
myWorkspaces = ["1","2","3⌂","4","5","6","7✉","8☺","9♫"]
如果我向数组添加内容,将会有更多工作空间,但我如何键入它们? Mod-1到Mod-9是默认设置,但我找不到有关如何更改默认设置的文档。
答案 0 :(得分:10)
我发现答案隐藏在this example configuration并与key names list一起,如下所示:
定义第十个工作区:
myExtraWorkspaces = [(xK_0, "0"),(xK_minus, "tmp"),(xK_equal, "swap")]
myWorkspaces = ["1","2","3⌂","4","5","6","7✉","8☺","9♫"] ++ (map snd myExtraWorkspaces)
然后键绑定看起来像这样:
myKeys =
[ -- ... some more keys ...
] ++ [
((myModMask, key), (windows $ W.greedyView ws))
| (key,ws) <- myExtraWorkspaces
] ++ [
((myModMask .|. shiftMask, key), (windows $ W.shift ws))
| (key,ws) <- myExtraWorkspaces
]
在此示例中,使用了斜杠键,但可以使用上面列表中的任何其他键。
最后:
main = do
xmonad $ config {
workspaces = myWorkspaces
} `additionalKeys` (myKeys)
答案 1 :(得分:0)
-- | 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]
修改Config.hs中列表的长度
答案 2 :(得分:0)
另一种方式是dynamic workspaces。 添加
import XMonad.Actions.DynamicWorkspaces
import XMonad.Actions.CopyWindow(copy)
到您的xmonad.hs
文件并添加
, ((modm, xK_v), selectWorkspace myXPConfig)
到该文件中的键绑定。 然后按mod + v可以按名称切换到工作区,或者如果不存在则创建它。