XMonad在不同的工作区启动 [英] XMonad startup on different workspaces
问题描述
我想在xmonad启动时在不同的工作区启动一些应用程序(这很重要)。所以,我写了下面的 startupHook
:
I want to startup some applications in different workspaces(it is important) on xmonad start. So, I wrote following startupHook
:
startupApps :: [String]
startupApps = ["konsole", "emacs", "firefox", "gvim", "konsole"]
startupSpawn :: X ()
startupSpawn = zipWithM_ id (map (spawnOn . show) [1..]) startupApps
但是,它会首先生成所有应用程序工作区。它似乎是更普遍问题的一部分 - 如果我启动应用程序,它不会在实际启动时得到工作区,而会在加载时得到工作区。
所以,如果我在WS1上启动firefox,然后切换到WS2,firefox将在WS2上产生。
But, it spawns all apps in first workspace. It seems to be part of more general problem -- if I start application, it get workspace not when it actually started, but when it loaded. So, if I start firefox on WS1, then switch to WS2, firefox will spawn on WS2.
然而,我可以对我的意图做些什么?
Still, what can I do about my intention?
推荐答案
您可以使用 manageHook
告诉xmonad将某些应用程序移动到某些桌面。
You can use the manageHook
to tell xmonad to move certain applications to certain desktops.
myManageHook = composeAll . concat $ [
[ className =? "Firefox" --> doF (shiftToWs 2) ]
, [ className =? "gvim" --> doF (shiftToWs 3) ]
-- and so on
]
不过, className
可能会有所不同。
The className
s might vary, though.
这篇关于XMonad在不同的工作区启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!