polybar-dwm/include/utils
Patrick Ziegler 3356188056
Use sockets for IPC (#2539)
Deprecates not using `polybar-msg` for IPC.

Fixes #2532
Closes #2465
Fixes #2504

* Create FIFO specific NamedPipeHandle subclass to PipeHandle

* Prototype SocketHandle

* Move mainloop up to main.cpp

* Pass eventloop to ipc class

* Deprecate sending ipc over the named pipe

Unfortunately, we can only show the warning in the polybar log and not
give the user any feedback because the pipe is one-way

* Move eventloop into its own namespace

* Prototype ipc socket handling

* Remove handles from ipc_client

Should be independent from eventloop logic

* Remove ipc clients when finished

* Add tests for ipc_client decoding

* Add callback for complete ipc messages

* Remove template param from mixins

* Move signal handler to new callback system

* Move poll handle to new callback system

* Move FSEventHandle to new callback system

* Move TimerHandle and AsyncHandle to new callback system

* Move PipeHandle to new callback system

* Implement socket functionality in new callback system

* Correctly reset ipc named pipe handle

* Let client close handles in error callback

* Wrap client pipe and ipc::client in connection class

* Better decoder log messages

* Socket path logic

* Fix CI warnings

* Remove UVHandleGeneric

* Fix error when socket folder already exists

* Proof of concept message writeback

* Restructure ipc files

* polybar-msg: Use sockets

* polybar-msg: Better syntax for actions

* Fix memory leak with fifo

After EOF, the pipe wasn't closed and EOF was called all the time, each
time allocating a new pipe.

* Make polybar-msg compile on its own

* Rudimentary writeback for polybar-msg

* Fix payload reference going out of scope.

* Add IPC documentation

* Cleanup polybar-msg code

* Specify the v0 ipc message format

* Close ipc connection after message

* Fix ipc tests

* Properly close ipc connections

* Fix polybar-msg not working with action string

* Write polybar-msg manpage

* polybar-msg: Stop using exit()

* ipc: Print log message with PID

* Add tests for ipc util

* polybar-msg: Print PID with success message

* ipc: Propagate message errors

* Rename ipc::client to ipc::decoder

* Rename ipc.cpp to polybar-msg.cpp

* ipc: Write encoder function and fix decoder bugs

* ipc: Use message format for responses

* ipc: Handle wrong message types

* ipc: Write back error message if ipc message cannot be processed

This only happens for commands and empty actions.
Non-empty actions are not immediately executed, but deferred until the
next loop iteration.

* Remove TODO about deleting runtime directory

The socket file is not deleted after socket.close() is called, only
after libuv executes the close callback.
So we can't just call rmdir because it will probably always fail.

* CLeanup WriteRequest

* Update manpage authors

* Cleanup
2022-01-22 20:35:37 +01:00
..
action_router.hpp fix(modules): Avoid downcast in module constructor 2021-10-03 03:18:39 +02:00
actions.hpp Use sockets for IPC (#2539) 2022-01-22 20:35:37 +01:00
bspwm.hpp refactor: Cleanup 2017-01-11 03:07:28 +01:00
color.hpp fix(color): Rename type() function to get_type 2021-03-01 00:05:44 +01:00
command.hpp Include fd_stream in command.hpp (#2533) 2021-10-12 19:33:15 +02:00
concurrency.hpp Remove unused spin_lock 2021-09-21 21:43:27 +02:00
env.hpp refactor(file_util): Expand tilde manually 2017-01-25 17:07:55 +01:00
factory.hpp Remove factory_util unique and shared 2021-09-21 21:43:27 +02:00
file.hpp feat: Support reading config from non-regular files (#2545) 2021-10-24 11:25:05 +02:00
functional.hpp refactor: Optimize build 2016-11-20 23:04:31 +01:00
http.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
i3.hpp feat(conf): Option to always show urgent workspaces in i3 (#2378) 2021-02-15 21:31:34 +01:00
inotify.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
io.hpp script: Fix concurrency issues (#2518) 2021-10-03 01:27:11 +02:00
math.hpp fix: unbounded_percentage always rounded down 2021-03-03 22:48:17 +01:00
memory.hpp fix(build): Ignore noexcept-type for malloc_ptr_t 2019-10-26 22:28:47 +02:00
mixins.hpp Use sockets for IPC (#2539) 2022-01-22 20:35:37 +01:00
process.hpp Add env parameter to exec_sh() 2021-09-28 22:16:07 +02:00
scope.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
socket.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
string.hpp Create default config (#2511) 2021-10-05 13:07:19 +02:00
time.hpp refactor: Move all event handling to the controller 2016-12-20 05:16:04 +01:00