From 77d64d781e8b56d02fec75e9b55745609f5bb212 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Sat, 30 Mar 2024 13:07:34 +0100 Subject: [PATCH] [hyprland] enabled and configured hypridle --- nix/home/hyprland/default.nix | 1 + nix/home/hyprland/hypridle.nix | 44 ++++++++++++++++++++++++ nix/home/hyprland/hyprland-execution.nix | 3 ++ nix/systems/packages.nix | 1 + 4 files changed, 49 insertions(+) create mode 100644 nix/home/hyprland/hypridle.nix diff --git a/nix/home/hyprland/default.nix b/nix/home/hyprland/default.nix index 1c69181..e4d376f 100644 --- a/nix/home/hyprland/default.nix +++ b/nix/home/hyprland/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./hypridle.nix ./hyprland.nix ./hyprland-bindings.nix ./hyprland-execution.nix diff --git a/nix/home/hyprland/hypridle.nix b/nix/home/hyprland/hypridle.nix new file mode 100644 index 0000000..296e95e --- /dev/null +++ b/nix/home/hyprland/hypridle.nix @@ -0,0 +1,44 @@ +{ config, ... }: +{ + + # include hyprland configs + home.file.".config/hypr/hypridle.conf".text = '' + + # general + general { + ignore_dbus_inhibit = false + } + + + # listeners + # notify inactivity + listener { + timeout = 45 + on-timeout = notify-send -t 4000 "Are you there ?" + } + + listener { + timeout = 50 + on-timeout = notify-send -t 4000 "Are you there ??" + } + + listener { + timeout = 55 + on-timeout = notify-send -t 4000 "Are you there ???" + } + + + # lock screen + listener { + timeout = 60 + on-timeout = hyprlock + } + + + # suspend after 5 minutes + listener { + timeout = 500 + on-timeout = systemctl suspend + } + ''; +} diff --git a/nix/home/hyprland/hyprland-execution.nix b/nix/home/hyprland/hyprland-execution.nix index 65bf4f7..2e3d038 100644 --- a/nix/home/hyprland/hyprland-execution.nix +++ b/nix/home/hyprland/hyprland-execution.nix @@ -19,6 +19,9 @@ # start blueman exec = blueman-tray + # start hypridle + exec-once = hypridle + # theming exec = ~/.dotfiles/apps/wallpaper/startup.sh diff --git a/nix/systems/packages.nix b/nix/systems/packages.nix index 3713335..a0f804d 100644 --- a/nix/systems/packages.nix +++ b/nix/systems/packages.nix @@ -25,6 +25,7 @@ brightnessctl grim unstable.grimblast + unstable.hypridle unstable.hyprlock imagemagick jq