mzteinit refactors

This commit is contained in:
LordMZTE 2024-07-09 18:24:01 +02:00
parent 39615bf693
commit c70ddf74dc
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
2 changed files with 15 additions and 2 deletions

View file

@ -27,12 +27,23 @@ pub fn build(b: *std.Build) !void {
e.root_module.addImport("common", common_mod);
}
// TODO: Broken, see: https://github.com/ziglang/zig/issues/20525
//const cg_opt = try common.confgenGet(struct {
// gtk_theme: []const u8,
// mzteinit_entries: []const struct {
// key: []const u8,
// label: []const u8,
// cmd: []const []const u8,
// quit: bool = false,
// },
//}, b.allocator);
const cg_opt = try common.confgenGet(struct {
gtk_theme: []const u8,
}, b.allocator);
const opts = b.addOptions();
opts.addOption([]const u8, "gtk_theme", cg_opt.gtk_theme);
opts.addOption(@TypeOf(cg_opt), "cg", cg_opt);
exe.root_module.addImport("opts", opts.createModule());
b.installArtifact(exe);

View file

@ -1,4 +1,6 @@
const std = @import("std");
const cg = @import("opts").cg;
const sysdaemon = @import("sysdaemon.zig");
const util = @import("util.zig");
@ -156,7 +158,7 @@ pub fn populateEnvironment(env: *std.process.EnvMap) !bool {
// GUI options
{
try env.put("QT_QPA_PLATFORMTHEME", "qt5ct");
try env.put("GTK_THEME", @import("opts").gtk_theme); // gtk theme from confgen
try env.put("GTK_THEME", cg.gtk_theme); // gtk theme from confgen
// this stops GTK from dbus-launching the mid-bogglingly pointless at-spi daemon
try env.put("NO_AT_BRIDGE", "1");