mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
Enable hyprlock and hypridle
This commit is contained in:
parent
61b00efc83
commit
bf792236bc
3 changed files with 180 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
@ -6,6 +7,11 @@
|
|||
}: let
|
||||
cfg = config.myConfig.de;
|
||||
in {
|
||||
imports = [
|
||||
inputs.hyprlock.homeManagerModules.hyprlock
|
||||
inputs.hypridle.homeManagerModules.hypridle
|
||||
];
|
||||
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf cfg.hyprland.enable {
|
||||
|
|
@ -16,6 +22,34 @@ in {
|
|||
splash=false
|
||||
'';
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.hypridle = let
|
||||
hyprlockExe = "${lib.getExe inputs.hyprlock.packages.${pkgs.system}.default}";
|
||||
in {
|
||||
enable = true;
|
||||
lockCmd = "pidof ${hyprlockExe} || ${hyprlockExe}";
|
||||
beforeSleepCmd = "loginctl lock-session";
|
||||
afterSleepCmd = "hyprctl dispatch dpms on";
|
||||
listeners = [
|
||||
{
|
||||
timeout = 300;
|
||||
onTimeout = "hyprctl dispatch dpms off";
|
||||
onResume = "hyprctl dispatch dpms on";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
onTimeout = "loginctl lock-session";
|
||||
}
|
||||
{
|
||||
timeout = 1200;
|
||||
onTimeout = "systemctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
myConfig.rofi.enable = true;
|
||||
services.cliphist.enable = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue