XMonad: SpawnOn workspace on which the spawn keyword was clicked

I would like my programs to appear on a screen that was in focus when its snap was not pressed on the screen, which is currently in focus when it finishes downloading.

Why: My current setup is Arch Linux + XMonad, and it works for me on 6 monitors. I have been using XMonad for about a year now, and my only problem with it is the programs that take a little time to open. For example, the first time I run chrome, it takes 3 seconds to load. I press my chrome key binding and then switch to another screen to do something else. But when chrome loads it, it loads onto a screen that is currently not focusing on the screen that was focused when the link to the spike was clicked.

My haskell skills are good ... don't exist. I have programmed in Lisp before and spend a lot of time in C, python and JavaScript, so I'm sure I can raise it if necessary (so please be clear when it comes to haskell samples in the answers).

Thanks in advance.

+7
linux haskell xmonad
source share
1 answer

I found the answer to my question.

First you must add your import:

import XMonad.Actions.SpawnOn 

Then, under your main function, there is something like:

 main = do xmonad $ defaultConfig { manageHook = myManageHooks <+> manageSpawn <+> manageDocks <+> manageHook defaultConfig , startupHook = myStartupHook , ETC..... 

The key here was to add manageSpawn to the manageHook line.

Then replace spawn with spawnHere :

  , ((modMask, xK_w), spawn "chromium") 

becomes:

  , ((modMask, xK_w), spawnHere "chromium") 
+7
source share

All Articles