Prevent output of sleep cmd showing on screen

This commit is contained in:
Moritz Reinel 2024-09-30 21:47:34 +02:00
parent 1681e88c2f
commit f8a2d69c5a
1 changed files with 4 additions and 1 deletions

View File

@ -580,7 +580,10 @@ pub fn main() !void {
} else if (pressed_key == sleep_key) {
if (config.sleep_cmd) |sleep_cmd| {
var sleep = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", sleep_cmd }, allocator);
_ = sleep.spawnAndWait() catch .{};
sleep.stdout_behavior = .Ignore;
sleep.stderr_behavior = .Ignore;
_ = sleep.spawnAndWait() catch {};
}
} else if (pressed_key == brightness_down_key or pressed_key == brightness_up_key) {
const cmd = if (pressed_key == brightness_down_key) config.brightness_down_cmd else config.brightness_up_cmd;