Switch to uwsm

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-06-03 13:00:07 +01:00
parent 1f44a8b6bc
commit b12fa0e811
19 changed files with 153 additions and 190 deletions

View File

@@ -12,18 +12,6 @@ in
with lib;
with types;
{
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
};
onMonitorChange.services = mkOption {
type = listOf str;
default = [ ];
@@ -31,37 +19,29 @@ in
};
};
config = {
wayland.windowManager.hyprland.initExtraConfig =
lib.mkIf (cfg.onMonitorChange.services != [ ])
"${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "hyprland-monitor-change-services";
runtimeInputs = with pkgs; [
socat
systemd
];
runtimeEnv.SERVICES = lib.strings.concatStringsSep " " cfg.onMonitorChange.services;
text = builtins.readFile ./scripts/monitors.sh;
}
)
} &";
wayland.windowManager.hyprland.settings = {
exec-once = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
}
);
exec = lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
}
);
config.systemd.user.services.hyprland-monitor-watcher = {
Unit = {
Description = "Restarts services on monitor change";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "hyprland-monitor-watcher";
runtimeInputs = with pkgs; [
socat
systemd
];
runtimeEnv.SERVICES = lib.strings.concatStringsSep " " cfg.onMonitorChange.services;
text = builtins.readFile ./scripts/monitors.sh;
}
);
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}