Allow swaynag to be disabled

This commit is contained in:
Brian Ashworth 2018-10-08 09:56:34 -04:00
parent 45f2cd0c73
commit 09c3c33081
4 changed files with 23 additions and 6 deletions

View file

@ -11,6 +11,10 @@
bool swaynag_spawn(const char *swaynag_command,
struct swaynag_instance *swaynag) {
if (!swaynag_command) {
return true;
}
if (swaynag->detailed) {
if (pipe(swaynag->fd) != 0) {
wlr_log(WLR_ERROR, "Failed to create pipe for swaynag");
@ -58,6 +62,10 @@ void swaynag_kill(struct swaynag_instance *swaynag) {
void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag,
const char *fmt, ...) {
if (!swaynag_command) {
return;
}
if (!swaynag->detailed) {
wlr_log(WLR_ERROR, "Attempting to write to non-detailed swaynag inst");
return;