XMonad在指定工作区启动时产生程序 [英] XMonad spawn programs on startup in specified workspace

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

问题描述

我正在尝试配置我的 xmonad.hs ,这样当我开始我的会话时,我会在不同的工作空间上启动一组不同的程序(例如1中的终端; Firefox中的2; Pidgin in 3)。

我已经看过 XMonad.Actions.SpawnOn ,但是作为 spawnOn 返回一个 X()而不是一个普通的 m()我不能在 main = do ... 中使用它。



是否有一个函数需要 X -monad并返回 IO()或者是否有另一种解决方法?

解决方案

常用的方法是使用 startupHook ,它执行 X()操作并在每次启动时执行它。
Eg

  main = xmonad $ defaultConfig 
{startupHook = do
spawnOnworkspace1 program1
...
spawnOnworkspaceNprogramN
}


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).

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 ....

Is there a function that takes an X-monad and returns with IO () or is there another workaround?

解决方案

The common way is to use startupHook which takes X () action and performs it on each startup. E.g.

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

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

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