mirror of https://github.com/fairyglade/ly.git
				
				
				
			Update src/main.zig
Co-authored-by: ShiningLea <anerruption@disroot.org>
This commit is contained in:
		
							parent
							
								
									a24347380f
								
							
						
					
					
						commit
						a09086c2b2
					
				|  | @ -508,14 +508,15 @@ pub fn main() !void { | |||
|                         var brightness = std.ChildProcess.init(&[_][]const u8{ config.brightnessctl, "-q", "s", brightness_str }, allocator); | ||||
|                         _ = brightness.spawnAndWait() catch .{}; | ||||
|                     } | ||||
|                 } else if (pressed_key == brightness_up_key) { | ||||
|                     if (unistd.access(&config.brightnessctl[0], unistd.X_OK) == 0) { | ||||
|                         const brightness_str = std.fmt.allocPrint(allocator, "+{s}%", .{config.brightness_change}) catch unreachable; | ||||
|                 } else if (pressed_key == brightness_up_key and unistd.access(&config.brightnessctl[0], unistd.X_OK) == 0) brightness_change: { | ||||
|                     const brightness_str = std.fmt.allocPrint(allocator, "+{s}%", .{config.brightness_change}) catch { | ||||
|                         try info_line.setText(lang.err_alloc); | ||||
|                         break :brightness_change; | ||||
|                     }; | ||||
|                     defer allocator.free(brightness_str); | ||||
|                     var brightness = std.ChildProcess.init(&[_][]const u8{ config.brightnessctl, "-q", "s", brightness_str }, allocator); | ||||
|                     _ = brightness.spawnAndWait() catch .{}; | ||||
|                 } | ||||
|                 } | ||||
|             }, | ||||
|             termbox.TB_KEY_CTRL_C => run = false, | ||||
|             termbox.TB_KEY_CTRL_U => { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue