XMonad:SpawnOn工作区,当按下spawn键时,该区域具有焦点 [英] XMonad: SpawnOn workspace that had focus when spawn key was pressed
问题描述
我想让我的程序产生在焦点上的屏幕上,当它的按键绑定不在当前焦点上的屏幕上时,它在完成加载时按下。
为什么:
我目前的设置是Arch Linux + XMonad,我有6台显示器。我一直在使用XMonad大约一年,我唯一的问题是需要一些时间打开的程序。例如,我第一次启动铬时,需要3秒钟才能加载。我按下我的键盘绑定键,然后转到另一个屏幕来执行其他操作。但是,当chrome加载时,它会在屏幕上加载,而当前的注意力集中在当按下spawn键绑定时关注的屏幕上。
我的haskell技能很好... 不存在的。我之前在Lisp中编写过程,并在C,python和JavaScript上花费了大量时间,所以我确定如果需要的话我可以捡起它(所以请在回答haskell样本时加以说明)。
在此先感谢。
我找到了自己问题的答案。
首先,您必须添加到您的导入:
import XMonad.Actions.SpawnOn
然后在你的主函数下有这样的东西:
main = do
xmonad $ defaultConfig
{
manageHook = myManageHooks< +> manageSpawn< +> manageDocks< +> manageHook defaultConfig
,startupHook = myStartupHook
,ETC .....
此处的关键是在 manageHook
行中添加了 manageSpawn
。
然后用 spawnHere
替换你的 spawn
s:
,((modMask,xK_w),spawnchromium)
成为: I would like to have my programs spawn on the screen that was in focus when its keybinding was pressed not on the screen thats currently in focus when it finishes loading. Why:
My current setup is Arch Linux + XMonad and I have it running on 6 monitors. I have been using XMonad for about a year now and my only issue with it is for programs that take a little while to open. For example the very first time I start chromium it takes 3 odd seconds to load. I press my key binding for chrome and then go to a different screen to do something else. But when chrome loads it loads on the screen im currently focused on not on the screen that was focused at the time the spawn key binding was pressed. My haskell skills are well... non existent. I have programmed in Lisp before and spend a lot of time in C, python and JavaScript so im sure I can pick it up if need be (so please be clear when it comes to haskell samples in answers). Thanks in advance. I found the answer to my own question. First you must add to your imports: Then under your main function have something like: The key here was the addition of the Then replace your Becomes:
这篇关于XMonad:SpawnOn工作区,当按下spawn键时,该区域具有焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ p $ ,((modMask,xK_w),spawnHerechromium)
code> import XMonad.Actions.SpawnOn
main = do
xmonad $ defaultConfig
{
manageHook = myManageHooks <+> manageSpawn <+> manageDocks <+> manageHook defaultConfig
, startupHook = myStartupHook
, ETC.....
manageSpawn
in the manageHook
line.spawn
s with spawnHere
: , ((modMask, xK_w), spawn "chromium")
, ((modMask, xK_w), spawnHere "chromium")