XMonad在不同的工作区启动 [英] XMonad startup on different workspaces

查看:106
本文介绍了XMonad在不同的工作区启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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 classNames might vary, though.

这篇关于XMonad在不同的工作区启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆