confgen GTK theme

This commit is contained in:
LordMZTE 2023-06-27 22:31:02 +02:00
parent 371d13c0bb
commit e3034c1343
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
8 changed files with 16 additions and 10 deletions

View file

@ -1,5 +1,5 @@
[Settings]
gtk-theme-name=Catppuccin-Mocha-Standard-Red-Dark
gtk-theme-name=<% opt.gtk_theme %>
gtk-icon-theme-name=<% opt.icon_theme %>
gtk-font-name=<% opt.font %> 11
gtk-cursor-theme-name=<% opt.cursor.theme %>

View file

@ -1,5 +1,5 @@
[Settings]
gtk-theme-name=Catppuccin-Mocha-Standard-Red-Dark
gtk-theme-name=<% opt.gtk_theme %>
gtk-icon-theme-name=<% opt.icon_theme %>
gtk-font-name=<% opt.font %> 11
gtk-cursor-theme-name=<% opt.cursor.theme %>

View file

@ -1,3 +1,3 @@
gtk-icon-theme-name="<% opt.icon_theme %>"
gtk-cursor-theme-name="<% opt.cursor.theme %>"
gtk-theme-name="Catppuccin-Mocha-Standard-Red-Dark"
gtk-theme-name="<% opt.gtk_theme %>"

View file

@ -19,6 +19,7 @@ opts.cursor = {
size = 24,
}
opts.gtk_theme = "Catppuccin-Mocha-Standard-Red-dark"
opts.icon_theme = "candy-icons"
opts.commands = {

View file

@ -1,6 +1,7 @@
const std = @import("std");
const common = @import("build_common.zig");
pub fn build(b: *std.build.Builder) void {
pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
const mode = b.standardOptimizeOption(.{});
@ -15,6 +16,14 @@ pub fn build(b: *std.build.Builder) void {
exe.addModule("ansi-term", b.dependency("ansi_term", .{}).module("ansi-term"));
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);
exe.addOptions("opts", opts);
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);

View file

@ -0,0 +1 @@
../../build_common.zig

View file

@ -69,7 +69,7 @@ pub fn populateEnvironment(env: *std.process.EnvMap) !bool {
// GUI options
{
try env.put("QT_QPA_PLATFORMTHEME", "qt5ct");
try env.put("GTK_THEME", "Catppuccin-Mocha-Standard-Red-Dark");
try env.put("GTK_THEME", @import("opts").gtk_theme); // gtk theme from confgen
// use xdg-desktop-portal
try env.put("GTK_USE_PORTAL", "1");

View file

@ -10,9 +10,4 @@ export QT_QPA_PLATFORM="wayland"
# this is necessary for tray icons
export XDG_CURRENT_DESKTOP="river"
# theming
export GTK_THEME=Catppuccin-Mocha-Standard-Red-Dark
export QT_QPA_PLATFORMTHEME=gtk2
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
exec river