feat(hyprland): use hypridle instead of swayidle
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
aed252651f
commit
fd5a54017c
4 changed files with 31 additions and 22 deletions
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
BIN
flake.nix
BIN
flake.nix
Binary file not shown.
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
config,
|
||||
hypridle,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) optionals;
|
||||
inherit (lib) mkIf;
|
||||
inherit (config.vars) mainUser;
|
||||
|
||||
isLaptop = config.services.logind.lidSwitch == "lock";
|
||||
|
@ -16,26 +17,41 @@ in {
|
|||
security.pam.services.swaylock = {};
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
home-manager.users.${mainUser} = {
|
||||
home-manager.users.${mainUser} = let
|
||||
hmCfg = config.home-manager.users.${mainUser};
|
||||
lockPkg = pkgs.writeShellApplication {
|
||||
name = "lock";
|
||||
runtimeInputs = [
|
||||
hmCfg.programs.ags.finalPackage
|
||||
hmCfg.programs.swaylock.package
|
||||
];
|
||||
text = ''
|
||||
ags -r 'Tablet.setLaptopMode()'
|
||||
swaylock -C ${hmCfg.xdg.configHome}/swaylock/config
|
||||
'';
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
../../home/swaylock.nix
|
||||
hypridle.homeManagerModules.default
|
||||
];
|
||||
|
||||
home.packages = with pkgs; ([
|
||||
gnome.seahorse
|
||||
]
|
||||
++ optionals isLaptop [
|
||||
swayidle
|
||||
]);
|
||||
home.packages = with pkgs; [
|
||||
gnome.seahorse
|
||||
];
|
||||
|
||||
services.hypridle = mkIf isLaptop {
|
||||
enable = true;
|
||||
listeners = [];
|
||||
lockCmd = "${lockPkg}/bin/lock";
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once =
|
||||
[
|
||||
"gnome-keyring-daemon --start --components=secrets"
|
||||
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
]
|
||||
++ optionals isLaptop ["swayidle -w lock lock"];
|
||||
exec-once = [
|
||||
"gnome-keyring-daemon --start --components=secrets"
|
||||
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
];
|
||||
|
||||
windowrule = [
|
||||
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
|
||||
|
@ -48,7 +64,7 @@ in {
|
|||
];
|
||||
|
||||
bind = [
|
||||
"$mainMod, L, exec, lock"
|
||||
"$mainMod, L, exec, ${lockPkg}/bin/lock"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "lock" ''
|
||||
ags -r 'Tablet.setLaptopMode()'
|
||||
swaylock
|
||||
'')
|
||||
];
|
||||
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
package = pkgs.swaylock-effects;
|
Loading…
Reference in a new issue