qol(Hibernate/Sleep): Now works 🎉
This commit is contained in:
@@ -7,6 +7,18 @@
|
||||
}:
|
||||
let
|
||||
cfg = config.modules.Hyprland;
|
||||
suspend = pkgs.writeShellScript "hyprland_suspend" ''
|
||||
#!/bin/bash
|
||||
|
||||
case "$1" in
|
||||
suspend)
|
||||
killall -STOP Hyprland
|
||||
;;
|
||||
resume)
|
||||
killall -CONT Hyprland
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -17,33 +29,76 @@ in
|
||||
options.modules.Hyprland = {
|
||||
enable = lib.mkEnableOption "Hyprland";
|
||||
};
|
||||
config.wayland.windowManager.hyprland = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
# set the flake package
|
||||
# settings = { };
|
||||
systemd.variables = [ "--all" ];
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
# TODO, split this into its own module;
|
||||
config.programs = lib.mkIf cfg.enable {
|
||||
wlogout = {
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
# set the flake package
|
||||
# settings = { };
|
||||
systemd.variables = [ "--all" ];
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
programs = {
|
||||
wlogout = {
|
||||
enable = true;
|
||||
};
|
||||
foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
||||
font = "CaskaydiaCove Nerd Font Mono:size=12";
|
||||
};
|
||||
font = "CaskaydiaCove Nerd Font Mono:size=12";
|
||||
};
|
||||
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.services."hyprland_suspend" = {
|
||||
Unit = {
|
||||
Description = "Suspend hyprland";
|
||||
Before = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
"nvidia-suspend.service"
|
||||
"nvidia-hibernate.service"
|
||||
];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${suspend} suspend";
|
||||
};
|
||||
};
|
||||
systemd.user.services."hyprland_resume" = {
|
||||
Unit = {
|
||||
Description = "Resume hyprland";
|
||||
After = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
"nvidia-resume.service"
|
||||
];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${suspend} resume";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user