Commit Graph

23 Commits

Author SHA1 Message Date
patrick96 3b6a950380 Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
patrick96 2512123a6c
Merge remote-tracking branch 'origin/hotfix/3.5.7' 2021-09-21 18:22:57 +02:00
patrick96 a8cba9c43c fix(ipc): Replace all %pid% tokens
Fixes #2500
2021-09-13 14:18:18 +02:00
Vincent Bernat 5f3462240c
feat(ipc): allow receiving arbitrary text on IPC socket (#2463)
This adds the 'send' action to the ipc module that can be used to send arbitrary text to the module:

    polybar-msg action "#ipc.send.%{F#4444ff}hello%{F-}"

* feat(ipc): allow receiving arbitrary text on IPC socket

Instead of just allowing hook numbers to be executed, the user can
send arbitrary text and the IPC module will put it in the bar. The IPC
payload format is extended to accept an arbitrary string if the first
character after the module name is ':'.

    polybar-msg hook test :'%{F#4444ff}hello%{F-}'

Fix #2455

* Use actions for sending data to ipc module

* ipc: Don't use exceptions when no hooks are defined

* Update src/modules/ipc.cpp

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-07-11 20:42:28 +02:00
Jérôme BOULMIER 529843b6ba
Remove undefined behaviors and clean code (#1769)
* fix: avoid memory leaks in case of exceptions.

* fix(fs): remove undefined behavior when removing mounts in m_mounts

* cleanup: remove double checks

* fix: remove memory leaks

* cleanup(xresources): capture exception by reference

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-02-15 23:32:56 +01:00
patrick96 ae2350167b actions: Switch all modules over to new system
All modules now expose their actions as public static constants

Issues: The menu module no longer closes when an item is clicked (before
it would intercept any executed command and look if it matches one of
its exec commands)
2020-11-26 20:53:53 +01:00
Jérôme BOULMIER 5e5d8faf04 fix(command): broken pipe when ignoring output. 2020-05-08 23:24:29 +02:00
patrick96 1fe679d6b3 fix(ipc): Clear content if no output is produced
Before, if the command produced no output, the `m_output` field would
not have been overwritten and the old output was displayed.

But since this is an explicit trigger of the hook, the user would expect
the output to be updated to whatever the script produces (even if that
is nothing).

Ref: https://www.reddit.com/r/Polybar/comments/e9a8ww
2019-12-23 01:23:40 +01:00
Michael Carlberg 53772e9c32 feat(ipc): Add pid token 2017-01-14 00:56:43 +01:00
Michael Carlberg dacf36b981 refactor(ipc): Cleanup 2017-01-14 00:27:29 +01:00
Michael Carlberg ed87a8924f fix(ipc): And double-click handlers 2017-01-14 00:10:55 +01:00
Michael Carlberg 8d355f8255 fix(ipc): Avoid clearing module content
Refs #324
2017-01-13 05:33:34 +01:00
Michael Carlberg 7a26254844 feat(ipc): Initial exec of configured hook
Adds a new config parameter `initial = N` that will
make the hook at defined index N execute on start.
2017-01-09 23:06:41 +01:00
Michael Carlberg 78bb3695e6 refactor(config): Deduce return type from default value 2016-12-30 23:32:05 +01:00
Michael Carlberg baaba4adf9 refactor(ipc): Rename signals 2016-12-26 10:36:14 +01:00
Michael Carlberg 788a7ca3a3 refactor(modules): Get rid of .inl files 2016-12-21 09:21:35 +01:00
Michael Carlberg c01f111e34 refactor(modules): Move setup to constructor 2016-12-21 08:00:09 +01:00
Michael Carlberg 3854515521 fix: Wrap format pre/suffix within cmd 2016-12-05 05:32:10 +01:00
Michael Carlberg ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
Michael Carlberg d76003256f fix: Do not parse module tags twice
Ref #192
2016-11-25 07:14:27 +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 e3065d0e6c feat(ipc): New ipc module
Add a new module that allow users to configure hooks
on received ipc messages. The hook will execute the defined
shell script and the output of the script will be used
as the module content.

Ref #84
2016-11-14 09:26:40 +01:00