I don't know what messages iwmon sends to iwd. But could we send those messages over a socket?
Say, iwd creates a socket at /tmp/iwd-sock and polls it periodically for messages. And when we run some iwmon commands, it sends the messages to that socket. (This is the way bspc talks to the bspwm window manager, IIRC)
Or, if we wouldn't want to poll, then we could simply catch the SIGUSR1 signal to make iwd poll on the socket. But in that case, we would need to implement a PID file for getting the process id to send the signal to. (I think this is more messier approach. I prefer polling.)
Why don't we use a unix socket?
I don't know what messages
iwmon
sends toiwd
. But could we send those messages over a socket?Say,
iwd
creates a socket at/tmp/iwd-sock
and polls it periodically for messages. And when we run someiwmon
commands, it sends the messages to that socket. (This is the waybspc
talks to thebspwm
window manager, IIRC)Or, if we wouldn't want to poll, then we could simply catch the
SIGUSR1
signal to makeiwd
poll on the socket. But in that case, we would need to implement a PID file for getting the process id to send the signal to. (I think this is more messier approach. I prefer polling.)🤷