integrate ConfgenFS

This commit is contained in:
LordMZTE 2024-03-08 13:04:40 +01:00
parent 93cb13e06b
commit c3fd340fa6
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
5 changed files with 40 additions and 8 deletions

View File

@ -81,6 +81,8 @@ env = __GLX_VENDOR_LIBRARY_NAME, nvidia
env = WLR_NO_HARDWARE_CURSORS, 1
<! end !>
exec-once = echo 'cg.opt.setCurrentWaylandCompositor "hyprland"' >~/confgenfs/_cgfs/eval
exec-once = waybar
exec-once = wlbg
exec-once = sleep 1 && randomwallpaper

View File

@ -0,0 +1,9 @@
[Unit]
Description=ConfgenFS dotfiles
[Service]
Type=exec
ExecStart=<% opt.system "which confgenfs" %> "<% opt.dev_dir %>/dotfiles/confgen.lua" "<% os.getenv "HOME" %>/confgenfs"
[Install]
WantedBy=default.target

View File

@ -41,9 +41,6 @@ opts.cursor = {
-- hwmon temperature path for CPU temp used by waybar
opts.cpu_temp_hwmon = "/sys/class/hwmon/hwmon0/temp1_input"
-- used in waybar config
opts.wayland_compositor = nil
opts.gtk_theme = "Catppuccin-Mocha-Standard-Red-Dark"
opts.icon_theme = "candy-icons"

View File

@ -19,11 +19,6 @@ cg.onDone(function(errors)
cg.opt.system("gsettings set org.gnome.desktop.interface cursor-theme " .. cg.opt.cursor.theme)
cg.opt.system("gsettings set org.gnome.desktop.interface cursor-size " .. cg.opt.cursor.size)
cg.opt.system('gsettings set org.gnome.desktop.interface font-name "' .. cg.opt.font .. ' 11"')
if cg.opt.wayland_compositor == "river" then
cg.opt.system 'gsettings set org.gnome.desktop.wm.preferences button-layout ""'
else
cg.opt.system "gsettings reset org.gnome.desktop.wm.preferences button-layout"
end
end
end)
@ -102,6 +97,16 @@ cg.opt.fileExists = function(path)
return false
end
-- Set the currently active wayland compositor. Updates options for templates as well as gsettings.
cg.opt.setCurrentWaylandCompositor = function(comp)
cg.opt.wayland_compositor = comp
if comp == "river" then
cg.opt.system 'gsettings set org.gnome.desktop.wm.preferences button-layout ""'
else
cg.opt.system "gsettings reset org.gnome.desktop.wm.preferences button-layout"
end
end
cg.opt = merge(cg.opt, require "cg_opts")
local local_opts = loadfile(os.getenv "HOME" .. "/.config/mzte_localconf/opts.lua")

View File

@ -177,6 +177,25 @@ pub fn init(alloc: std.mem.Allocator) !void {
log.info("configuration finished, spawning processes", .{});
// tell confgenfs we're now using river
confgenfs: {
const cgfs_eval_path = try std.fs.path.join(
alloc,
&.{ home, "confgenfs", "_cgfs", "eval" },
);
defer alloc.free(cgfs_eval_path);
const evalf = std.fs.cwd().openFile(cgfs_eval_path, .{ .mode = .write_only }) catch {
std.log.warn("unable to open confgenfs eval file", .{});
break :confgenfs;
};
defer evalf.close();
try evalf.writeAll(
\\cg.opt.setCurrentWaylandCompositor "river"
);
}
var child_arena = std.heap.ArenaAllocator.init(alloc);
defer child_arena.deinit();