add hibernate option

This commit is contained in:
tristan 2023-05-18 08:21:36 +01:00
parent a4e239898c
commit 6b601bfa4b
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,14 @@
{
description = "A very basic flake";
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs {system = "x86_64-linux";};
in {
packages.x86_64-linux.hello = pkgs.callPackage ./default.nix {};
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}

View file

@ -226,10 +226,12 @@ in
name = "lock"; name = "lock";
text = '' text = ''
res=$(echo "lock res=$(echo "lock
sleep" | ${my-deps.menu}) sleep
hibernate" | ${my-deps.menu})
case $res in case $res in
lock) swaylock;; lock) swaylock;;
sleep) systemctl suspend;; sleep) systemctl suspend;;
hibernate) systemctl hibernate;;
esac esac
''; '';
hotkeys = [ hotkeys = [