jay icon indicating copy to clipboard operation
jay copied to clipboard

Add live reloading for config.toml

Open thepragmaticmero opened this issue 1 year ago • 2 comments

A competing compositor has this function~. When the user modifies the config file, it automatically reloads. It doesn't slow down the computer at all, I have it on my purposefully slow machine (N2840 processor) and it works amazingly, I usually compare live reloading to CHAD: Gnome live-reloading config CUCK: KDE Apply button for everything.

This has the potential to improve the UX significantly for new users. Editing text files to change configurations has always been tedious; that's part of why newbs look at tiling window managers as being exclusively for experts. Adding this feature would be a huge improvement.

thepragmaticmero avatar Oct 30 '24 23:10 thepragmaticmero

I'd be interested to take a look at this to get familiar with the code structure. I assume we would use the inotify api? Afaik it provides both a blocking and a non-blocking interface, but I'm sot sure how to best integrate that into the existing code without introducing a bunch of locking / atomics

TrueDoctor avatar Mar 01 '25 21:03 TrueDoctor

The problem with automatic reloads is that they are destructive. If you make a manual change on the command line, reloading the config might overwrite them.

If you wanted to implement this, you would do it entirely within the toml-config crate by using https://docs.rs/jay-config/latest/jay_config/tasks/index.html and https://docs.rs/jay-config/latest/jay_config/io/struct.Async.html.

mahkoh avatar Mar 01 '25 21:03 mahkoh