
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!

I used to simulate it with a wrapper, but that was a decade ago when I
was jumping between xmonad+KDE and bare xmonad according to need.
There's no built-in mechanism for it, and one might be difficult to
add these days because of how the cabal and stack-based setups work.
On Wed, Dec 15, 2021 at 2:51 PM nyam
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@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
-- brandon s allbery kf8nh allbery.b@gmail.com

On Wed, Dec 15 2021 14:57, Brandon Allbery wrote:
There's no built-in mechanism for it, and one might be difficult to add these days because of how the cabal and stack-based setups work.
Indeed, I think the main problem lies here; especially since we're now providing more or less frictionless (i.e., no build script necessary) stack support out of the box. A `--file` option that only makes sense in case of a specific setup would feel a bit unsatisfying (at least to me). Though, I would imagine something like this shouldn't be too difficult to hack together via a shell-script wrapper.

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#... 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@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
participants (4)
-
Brandon Allbery
-
nyam
-
Platon Pronko
-
Solid