-
Notifications
You must be signed in to change notification settings - Fork 33
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
Implement a client for communication to the daemon via sockets #18
Conversation
What's wrong with
? While the code looks good, I'm a little hesitant to adding a default socket. One of the biggest points with xidlehook is being a general purpose timer: Not being exclusive to one instance, and not being exclusive to screen locking. |
This is because it would then resemble Also, its more concise for a user if you tell them: To run primary timer command instantly, run:
Instead of: The socket API is very simple. Each command is a single byte, sent over a unix
A common use case of echo -ne "\x2" | socat - /path/to/xidlehook.sock |
I think, a common ground between our views could be no default sockets, but the flag existing and being used with the socket flag.
|
If we have Don't get me wrong, I don't dislike this at all. I'd use something like this myself if it existed -- buuut I want to modularize as much as possible to properly follow the UNIX philosophy of having each tool do one thing, but well. Maybe this could be moved to either
|
I guess I got convinced by your argument 😛 . I have created a separate binary file for both. |
Pushed a teeny tiny change, hope that was OK! I would prefer to have xidlehook still be main.rs, as it is still the "main" program, so to speak. Let me know if you think this is ready to be merged now, and I'll merge it! |
lgtm 👍 |
Thanks for this PR! 😄 |
This commit implements
--lock-now
by enforcing a default socket file and using that for passing the\x02
byte when called with--lock-now
. Its also possible to override the socket in normal launch and--lock-now
via--socket
.