summaryrefslogtreecommitdiff
path: root/common/modules/mango/swayidleNdLock.nix
diff options
context:
space:
mode:
Diffstat (limited to 'common/modules/mango/swayidleNdLock.nix')
-rw-r--r--common/modules/mango/swayidleNdLock.nix53
1 files changed, 0 insertions, 53 deletions
diff --git a/common/modules/mango/swayidleNdLock.nix b/common/modules/mango/swayidleNdLock.nix
deleted file mode 100644
index 2788db9..0000000
--- a/common/modules/mango/swayidleNdLock.nix
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.beeMods.mango;
- swaylock_cmd = "${pkgs.swaylock}/bin/swaylock -e -f -C ~/.config/swaylock/swaylock-colors";
-in
-{
- config = lib.mkIf cfg.enable {
- home.packages = with pkgs; [
- wlopm
- swaylock
- ];
-
- services.swayidle = {
- enable = true;
- systemdTarget = [ "mango-session.target" ];
-
- events = {
- "before-sleep" = swaylock_cmd;
- "lock" = swaylock_cmd;
- };
-
- timeouts = [
- # dim screen at 4:30
- {
- timeout = 270;
- command = "${pkgs.brightnessctl}/bin/brightnessctl g > /tmp/brightness_prev && ${pkgs.brightnessctl}/bin/brightnessctl set 10%";
- resumeCommand = "${pkgs.brightnessctl}/bin/brightnessctl set $(${pkgs.coreutils}/bin/cat /tmp/brightness_prev 2>/dev/null || echo 100%)";
- }
- # Lock at 5:00
- {
- timeout = 300;
- command = swaylock_cmd;
- }
- # Screen off at 10:00
- {
- timeout = 600;
- command = "${pkgs.wlopm}/bin/wlopm --off '*'";
- resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'";
- }
- # suspend at 15:00
- {
- timeout = 900;
- command = "systemctl suspend";
- }
- ];
- };
- };
-}