2024-02-05 06:25:43 -05:00
|
|
|
{
|
|
|
|
config,
|
2024-02-21 17:21:57 -05:00
|
|
|
hypridle,
|
2024-02-05 06:25:43 -05:00
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-02-21 17:21:57 -05:00
|
|
|
inherit (lib) mkIf;
|
2024-02-05 06:25:43 -05:00
|
|
|
inherit (config.vars) mainUser;
|
|
|
|
|
|
|
|
isLaptop = config.services.logind.lidSwitch == "lock";
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
../greetd
|
|
|
|
];
|
|
|
|
|
|
|
|
services.gnome.gnome-keyring.enable = true;
|
|
|
|
|
2024-02-21 17:21:57 -05:00
|
|
|
home-manager.users.${mainUser} = let
|
|
|
|
hmCfg = config.home-manager.users.${mainUser};
|
|
|
|
lockPkg = pkgs.writeShellApplication {
|
|
|
|
name = "lock";
|
|
|
|
runtimeInputs = [
|
|
|
|
hmCfg.programs.ags.finalPackage
|
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
ags -r 'Tablet.setLaptopMode()'
|
2024-04-19 20:43:17 -04:00
|
|
|
ags -b lockscreen -c /home/${mainUser}/.config/ags/lockscreen.js
|
2024-02-21 17:21:57 -05:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in {
|
2024-05-05 23:07:06 -04:00
|
|
|
home.packages = [
|
|
|
|
pkgs.gnome.seahorse
|
2024-04-19 20:31:17 -04:00
|
|
|
lockPkg
|
2024-02-21 17:21:57 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
services.hypridle = mkIf isLaptop {
|
|
|
|
enable = true;
|
2024-05-07 22:50:49 -04:00
|
|
|
settings.lockCmd = "${lockPkg}/bin/lock";
|
2024-02-21 17:21:57 -05:00
|
|
|
};
|
2024-02-05 06:25:43 -05:00
|
|
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
settings = {
|
2024-02-21 17:21:57 -05:00
|
|
|
exec-once = [
|
|
|
|
"gnome-keyring-daemon --start --components=secrets"
|
|
|
|
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
|
|
|
];
|
2024-02-05 06:25:43 -05:00
|
|
|
|
|
|
|
windowrule = [
|
|
|
|
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
|
|
|
|
"size 741 288,^(org.kde.polkit-kde-authentication-agent-1)$"
|
|
|
|
"center,^(org.kde.polkit-kde-authentication-agent-1)$"
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
# For GParted auth
|
|
|
|
"size 741 288,^(org.kde.ksshaskpass)$"
|
|
|
|
"move cursor -370 -144,^(org.kde.ksshaskpass)$"
|
2024-02-05 06:25:43 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
bind = [
|
2024-02-21 17:21:57 -05:00
|
|
|
"$mainMod, L, exec, ${lockPkg}/bin/lock"
|
2024-02-05 06:25:43 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|