xmonad-like reconfigure
is it possible to add a easier command for reconfigure? like xmonad's one
$ xmonad --recompile
something like this, or provide any way of doing it without stack or cabal, for users that rely solely on their package managers...
edit: here's the recompile function from xmonad:
Sorry for taking a while to respond to this, I completely forgot about it!
A couple random thoughts:
-
When launching Termonad, it will do a recompile, but I guess you're asking specifically for a way to try to recompile
~/.config/termonad/termonad.hswithout needing to actually launch Termonad? That seems reasonable. -
Internally Termonad uses
dyreto do the whole "recompile from a Haskell source file" thing. Maybedyrehas some functionality built-in to make this easy to implement in Termonad?? -
XMonad has a
restartfunction which will attempt to recompile yourxmonad.hsfile if it has changed, re-exec the new XMonad binary, and can also carry forward your current state (like which windows are on what workspace, window sizes, etc).Termonad doesn't have this ability, and likely can't, since it can't serialize the state of a given terminal to disk. (For instance, if you have Vim running in one terminal window, there is no way to "serialize" it's state to disk and restart it.)
no worries.
yes, Dyre has some functionalities that can help, but as we're in haskell , there's always a way to make what we want. the thing is, which path is the shortest ? and i think you're thought about Dyre can leads us to a good direction , since there are indeed some helper functions , we can maybe modify them to take another file as argument, and this file will apply transformations on Termonad's code
you'd be indirectly coding in termonad source... ;)
edit: since you've mentioned thr way that xmonad does it, there's actually a pretty easy way to make it work for termonad
you'd have a function that raises a new instance of termonad, like spawning a process after calling the recompilation
since the "old" instance is in memory, this wouldn't actually crash or break
taffybar seems like a good example on how to achieve this: https://github.com/taffybar/taffybar/blob/b256a711416036ca124fc9b3f89e7c957535e465/app/Main.hs#L46-L57