mirror of https://github.com/fairyglade/ly.git
Prevent output of brightness cmds showing on screen (fixing #695)
This commit is contained in:
parent
022d146f76
commit
1681e88c2f
21
src/main.zig
21
src/main.zig
|
@ -582,12 +582,21 @@ pub fn main() !void {
|
||||||
var sleep = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", sleep_cmd }, allocator);
|
var sleep = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", sleep_cmd }, allocator);
|
||||||
_ = sleep.spawnAndWait() catch .{};
|
_ = sleep.spawnAndWait() catch .{};
|
||||||
}
|
}
|
||||||
} else if (pressed_key == brightness_down_key) {
|
} else if (pressed_key == brightness_down_key or pressed_key == brightness_up_key) {
|
||||||
var brightness = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", config.brightness_down_cmd }, allocator);
|
const cmd = if (pressed_key == brightness_down_key) config.brightness_down_cmd else config.brightness_up_cmd;
|
||||||
_ = brightness.spawnAndWait() catch .{};
|
|
||||||
} else if (pressed_key == brightness_up_key) {
|
var brightness = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", cmd }, allocator);
|
||||||
var brightness = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", config.brightness_up_cmd }, allocator);
|
brightness.stdout_behavior = .Ignore;
|
||||||
_ = brightness.spawnAndWait() catch .{};
|
brightness.stderr_behavior = .Ignore;
|
||||||
|
|
||||||
|
handle_brightness_cmd: {
|
||||||
|
const process_result = brightness.spawnAndWait() catch {
|
||||||
|
break :handle_brightness_cmd;
|
||||||
|
};
|
||||||
|
if (process_result.Exited != 0) {
|
||||||
|
try info_line.addMessage(lang.err_brightness_change, config.error_bg, config.error_fg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
termbox.TB_KEY_CTRL_C => run = false,
|
termbox.TB_KEY_CTRL_C => run = false,
|
||||||
|
|
Loading…
Reference in New Issue