Config.zig (768B)
1 const fcft = @import("fcft"); 2 const pixman = @import("pixman"); 3 4 const Config = @This(); 5 6 height: u16, 7 backgroundColor: pixman.Color, 8 foregroundColor: pixman.Color, 9 border: u15, 10 font: *fcft.Font, 11 clockFormat: [*:0]const u8, 12 13 pub fn init() !Config { 14 var font_names = [_][*:0]const u8{"monospace:size=16"}; 15 16 return Config{ 17 .height = 32, 18 .backgroundColor = .{ 19 .red = 0, 20 .green = 0, 21 .blue = 0, 22 .alpha = 0xffff, 23 }, 24 .foregroundColor = .{ 25 .red = 0xffff, 26 .green = 0xffff, 27 .blue = 0xffff, 28 .alpha = 0xffff, 29 }, 30 .border = 2, 31 .font = try fcft.Font.fromName(&font_names, null), 32 .clockFormat = "%d/%m %R", 33 }; 34 }