[xmonad] Different xmonad configs?

Platon Pronko platon7pronko at gmail.com
Wed Dec 15 21:34:27 UTC 2021


Hi!

I suspect the easiest way around this might be to detect the current DE/WM at runtime somehow and change Xmonad behavior accordingly, this way a lot of code will be reused between configs for different WMs.

That said, reading through source code in Core.hs there are references to XMONAD_DATA_DIR, XMONAD_CONFIG_DIR, XMONAD_CACHE_DIR environment vars that can be used to control where xmonad gets the files from:

https://hackage.haskell.org/package/xmonad-0.17.0/docs/src/XMonad.Core.html#getDirectories

So probably you can place different xmonad.hs files into different directories and then use XMONAD_CONFIG_DIR to control what files are compiled.

Best regards,
Platon Pronko

On 2021-12-15 22:48, nyam wrote:
> Hi all!
> 
> 
> Is there an option to compile and (re)start etc. individual 'xmonad.hs',
> such as one has different DE/WMs and wants to use e. g. together with
> their own adapted xmonad? – Like:
> 
> 
> $ xmonad --file=/path/to/xmonad-de1.hs --recompile
> 
> $ exec xmonad --file=/path/to/xmonad-de1.hs
> 
> or
> 
> $ xmonad --file=/path/to/xmonad-de2.hs --recompile
> 
> $ xmonad --restart --file=/path/to/xmonad-de2.hs
> 
> or
> 
> $ xmonad --recompile --file=/path/to/xmonad-pure.hs
> 
> $ exec xmonad --file=/path/to/xmonad-pure.hs
> 
> 
> Would be a cool feature, though so far the manpage or any web resources
> don't mention it.
> 
> 
> Cheers!
> 
> 
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad


More information about the xmonad mailing list