Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmonad-like reconfigure #249

Open
KonstantinDjairo opened this issue Oct 25, 2024 · 2 comments
Open

xmonad-like reconfigure #249

KonstantinDjairo opened this issue Oct 25, 2024 · 2 comments
Labels
beginner-friendly Good for newcomers enhancement New feature or request help wanted Extra attention is needed

Comments

@KonstantinDjairo
Copy link

KonstantinDjairo commented Oct 25, 2024

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:

@cdepillabout cdepillabout added enhancement New feature or request help wanted Extra attention is needed beginner-friendly Good for newcomers labels Jan 20, 2025
@cdepillabout
Copy link
Owner

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.hs without needing to actually launch Termonad? That seems reasonable.

  • Internally Termonad uses dyre to do the whole "recompile from a Haskell source file" thing. Maybe dyre has some functionality built-in to make this easy to implement in Termonad??

  • XMonad has a restart function which will attempt to recompile your xmonad.hs file 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.)

@KonstantinDjairo
Copy link
Author

KonstantinDjairo commented Jan 21, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner-friendly Good for newcomers enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants