52eee95bf8
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
28 lines
709 B
C++
28 lines
709 B
C++
#pragma once
|
|
|
|
#include "common.hpp"
|
|
|
|
POLYBAR_NS
|
|
|
|
namespace process_util {
|
|
bool in_parent_process(pid_t pid);
|
|
bool in_forked_process(pid_t pid);
|
|
|
|
void redirect_stdio_to_dev_null();
|
|
|
|
pid_t fork_detached(std::function<void()> const& lambda);
|
|
|
|
void exec(char* cmd, char** args);
|
|
void exec_sh(const char* cmd);
|
|
|
|
pid_t wait_for_completion(pid_t process_id, int* status_addr = nullptr, int waitflags = 0);
|
|
pid_t wait_for_completion(int* status_addr, int waitflags = 0);
|
|
pid_t wait_for_completion_nohang(pid_t process_id, int* status);
|
|
pid_t wait_for_completion_nohang(int* status);
|
|
pid_t wait_for_completion_nohang();
|
|
|
|
bool notify_childprocess();
|
|
} // namespace process_util
|
|
|
|
POLYBAR_NS_END
|