Commit Graph

24 Commits

Author SHA1 Message Date
patrick96 432e19df01 build: Add missing headers in common.hpp 2023-11-12 15:18:34 +01:00
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
patrick96 e1e28f09f3 refactor(build): Remove version number namespace
I don't know the original intention behind this but it clutters up debug
traces and basically makes ccache useless.

The only benefit it has, giving version info in stacktraces, is kind of
void since we already ask for version information on github issues.
2019-05-17 16:49:47 +02:00
László Várady 8a98fb78b6 fix(version): Follow APP_VERSION in POLYBAR_NS 2017-01-29 15:16:00 +01:00
Michael Carlberg e1dbd98c40 feat(string_util): Custom stringstream 2017-01-13 13:01:22 +01:00
Michael Carlberg 5b33ada576 refactor(common): Cleanup 2017-01-11 07:17:54 +01:00
Michael Carlberg 8cc885c316 refactor: Cleanup 2017-01-11 03:07:28 +01:00
Michael Carlberg 78bb3695e6 refactor(config): Deduce return type from default value 2016-12-30 23:32:05 +01:00
Michael Carlberg bc9b9f0d12 refactor: Cleanup 2016-12-21 23:22:02 +01:00
Michael Carlberg b2e8428550 wip(refactor): Improve parsing and font glyph caching 2016-12-15 17:28:58 +01:00
Michael Carlberg 0fca9a0c6e git: Remove unused headers for boost::di 2016-12-14 20:18:55 +01:00
Michael Carlberg 08be86fbe1 wip(refactor): Improve signal and event handling 2016-12-14 11:01:44 +01:00
Michael Carlberg ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
Michael Carlberg 8db3e79919 refactor(clang-format): Apply fixes 2016-11-25 14:17:41 +01:00
Michael Carlberg 84d58e7619 refactor: Cleanup handling of syntax tags 2016-11-25 04:34:24 +01:00
Michael Carlberg c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00
Michael Carlberg fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
Michael Carlberg f2bbd301f2 feat(xbacklight): Change value on scroll
- Add action handlers for scroll up/down (conf: enable-sroll = true)
- Use xcb_timestamps instead of the throttle util
2016-11-12 13:07:05 +01:00
Michael Carlberg 1075144b00 refactor(eventloop): Use concurrent queue for events
Events are now enqueued using a thread safe concurrent queue
which makes the previous eventloop locking redundant.
2016-10-29 06:48:51 +02:00
Michael Carlberg d2187f44e0 refactor(drawtypes): Cleanup and fixes 2016-10-25 07:10:05 +02:00
Michael Carlberg 82f311b695 refactor(network): Code cleanup
- Cleanup of network module and adapter
- Check operstate instead of carrier when testing the
  the current connection state, as suggested by @patrick96 in #44
- Separate signal quality and signal strength
- Log failed attempt to query device driver
2016-10-18 09:41:20 +02:00
Michael Carlberg d23119e24e fix(build): Make project compile using gcc5/gcc6 2016-10-11 12:58:26 +02:00
Michael Carlberg 20350e5fe6 fix: Make sure clickable areas are aligned properly
- Avoid odd glyph width's for center-aligned text
since it breaks the positioning of clickable area's

- Added visual hints for clickable areas for debugging
2016-10-11 03:19:53 +02:00
Michael Carlberg d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00