elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.16k stars 378 forks source link

[FEATURE] Start daemon without detaching #288

Closed nib9888 closed 2 years ago

nib9888 commented 2 years ago

Description of the requested feature

Add a --no-daemon commandline option to eww daemon that would disable auto-fork. This would leave the daemon attached to the terminal, which would allow eww to be used with daemontools style process supervision suites such as s6 and daemontools-encore. \ This could also be useful for debugging purposes because sometimes I can forget which terminal I started the daemon in, so will close the terminal accidentally. Scrap that, that's not how it works. Still would be useful though for those used to working with daemons that function like this.

Personally, I don't think this option should exist for other commands that can auto start the daemon, but that's up for discussion. \ Maybe a --no-autostart-daemon option?

Personally I find eww's approach to its daemon a bit jarring and different to other programs, however convenient it may be (It is for developing and debugging, but not for anything more complicated than putting eww daemon in .xprofile).

elkowar commented 2 years ago

What would be the concrete practical benefits of using these tools over the built-in daemon handling? I made eww always daemonize to try and simplify the behavior of ewws process structure from an implementation perspective - I'm open to adding those two different execution modes again if there is some good reason for it

EuanFH commented 2 years ago

Chiming in think it would be good for debugging issues with the actual daemon code. The process of attaching to a fork is a little complicated and it would be easier just to run in no daemon mode and set break points.

Also i could think of a use case of someone running this in a systemd user unit as well. But i personally wouldn't use it that way.

nib9888 commented 2 years ago

Personally I think the systemd unit use case might become common if a distribution chooses to package eww similarly to other daemons, using said unit file, so this feature might become quite inportant. \ For example, I can't imagine debian package maintainers would ever make the install automatically append eww daemon to .xprofile or similar, however would readily include a unit file.

elkowar commented 2 years ago

I guess those are good points! I'll consider implementing this soon 👍🏻