Commit Graph

19 Commits

Author SHA1 Message Date
a2968127d1 fix typos (#2524) 2021-10-04 23:46:38 +02:00
444120e664 script: Fix concurrency issues (#2518)
Fixes #1978

* Move tail and non-tail handler to method

Defining them in the constructor is ugly.

* script: Iterate over defined actions instead of fixed list

* Separate running logic and lock m_output

* Include POLYBAR_FLAGS in linker flags

* Stop using m_prev in script_runner

* Join module threads in stop function

Joining in the destructor may lead to UB because the subclass is already
deconstructed but the threads may still require it to be around (e.g.
for calling any functions on the instance)

* Cleanup script module

* Update changelog

* Remove AfterReturn class

* Remove m_stopping from script module

* Fix polybar not reading the entire line from child process.

For every `readline` call we created a new fd_streambuf. This means once
`readline` returns, the streambuf is destructed and and pending data in
its temporary buffer discarded and we never actually read it.

* Remove unused includes
2021-10-03 01:27:11 +02:00
37cd63a356 Add env parameter in command::exec() 2021-09-28 22:16:07 +02:00
47483a94f1 fix(process): fork_detached created zombie processes
Since the forked processes are still our children, we need to wait on
them, otherwise they become zombie processes.

We now fork twice, let the first fork immediately return and wait on it.
This reparents the second fork, which runs the actual code, to the init
process which then collects it.

Ref #770
2020-12-12 02:37:21 +01:00
52eee95bf8 controller: Detach shell commands from polybar
Shell commands triggered from action tags used to block polybar until
they finished.

Since we are not actually interested in the output of the commands, it
makes sense to run them completely detached from polybar and have
polybar not block when executing these commands.

Now the spawned child processes no longer get killed when polybar
exits. This is fine because polybar is not responsible for these
processes since they were explicitly started by the user through click
commands.

Ref: #770
Ref: #1680
2020-11-29 03:53:59 +01:00
f016b99e08 Redirect process output to dev null 2020-05-08 23:24:29 +02:00
5e5d8faf04 fix(command): broken pipe when ignoring output. 2020-05-08 23:24:29 +02:00
6ca4f06785 doc: Convert @ to \ doxygen commands
Ref #1377
2018-11-04 19:28:27 -08:00
1fdc742606 fix(command): Decrease log verbosity
Refs #362
2017-01-23 17:11:07 +01:00
5b33ada576 refactor(common): Cleanup 2017-01-11 07:17:54 +01:00
acb9ed910d fix(script): Unlock mutex before terminating command
Refs #281
2016-12-31 14:08:45 +01:00
a89c4ef2dd refactor: Move all event handling to the controller 2016-12-20 05:16:04 +01:00
f9062d031c refactor(clang-tidy): Apply fixes 2016-12-15 03:30:41 +01:00
5f6d73a415 fix(command): Use execlp()
Ref #214
2016-12-03 20:52:43 +01:00
ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00
fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
3edd33be99 fix(build): Include poll.h instead of sys/poll.h
- Include <poll.h> to get rid of musl warnings
2016-11-12 15:50:18 +01:00
e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00