简体   繁体   English

XMonad在指定的工作区中启动时生成程序

[英]XMonad spawn programs on startup in specified workspace

I am trying to configure my xmonad.hs so that when I start my session I start an array of different programs on different workspaces (like Terminal in 1 ; Firefox in 2 ; Pidgin in 3). 我正在尝试配置我的xmonad.hs这样当我开始我的会话时,我会在不同的工作区上启动一系列不同的程序(例如1中的终端; 2中的Firefox; 3中的Pidgin)。

I already looked into the XMonad.Actions.SpawnOn , but as spawnOn returns with an X () and not with a common m () I can not use it in main = do ... . 我已经查看了XMonad.Actions.SpawnOn ,但是当spawnOn返回X ()而不是公共m ()我不能在main = do ...使用它。

Is there a function that takes an X -monad and returns with IO () or is there another workaround? 是否有一个函数采用X -monad并返回IO ()或是否有另一种解决方法?

The common way is to use startupHook which takes X () action and performs it on each startup. 常见的方法是使用startupHook ,它采取X ()动作并在每次启动时执行。 Eg 例如

main = xmonad $ defaultConfig
  { startupHook = do
      spawnOn "workspace1" "program1"
      …
      spawnOn "workspaceN" "programN"
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM