ft: hyprland to home manager, mostly
This commit is contained in:
44
modules/desktop/hypr-plugins.nix
Normal file
44
modules/desktop/hypr-plugins.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ hyprLib, mainMod, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (hyprLib)
|
||||
bind
|
||||
exec
|
||||
;
|
||||
|
||||
# automatically discover shaders in the relative hypr shaders directory
|
||||
shaders = lib.mapAttrsToList (name: _: lib.strings.removeSuffix ".glsl" "${name}")
|
||||
(lib.attrsets.filterAttrs
|
||||
(name: type: type == "regular")
|
||||
(builtins.readDir ./windowShaders)
|
||||
);
|
||||
loadShader = name: "hl.plugin.darkwindow.load_shader('${name}', { path = './windowShaders/${name}.glsl'})";
|
||||
in
|
||||
{
|
||||
users.users.djai.packages = with pkgs.hyprlandPlugins; [
|
||||
hypr-darkwindow
|
||||
];
|
||||
|
||||
# supposed to map to hl.plugin.darkwindow.load_shader("${shader}" { path = "./windowShaders/${shader}.glsl"})
|
||||
home-manager.users."djai".wayland.windowManager.hyprland.extraConfig = ''
|
||||
if hl.plugin.darkwindow ~= nil then
|
||||
${lib.strings.join "\n " (map loadShader shaders)}
|
||||
end
|
||||
'';
|
||||
|
||||
home-manager.users."djai".wayland.windowManager.hyprland.settings = {
|
||||
bind = [
|
||||
(bind "${mainMod} + SHIFT + B" (exec "~/.config/hypr/scripts/shader_picker_window.sh") "Pick a shader for active window")
|
||||
];
|
||||
|
||||
window_rule = [
|
||||
{ match.tag = "shader/muted"; "darkwindow:shade" = "grey";}
|
||||
{ match.tag = "muted"; "darkwindow:shade" = "grey";}
|
||||
] ++ map (name: { match.tag = "shader/${name}"; "darkwindow:shade" = "${name}";}) shaders;
|
||||
};
|
||||
|
||||
|
||||
|
||||
# TODO: symlink ./windowShaders into ~/.config/hypr/
|
||||
# TODO: symlink ./shaders into ~/.config/hypr/ <- should happen in desktop/hypr.nix prolly
|
||||
}
|
||||
Reference in New Issue
Block a user