96 current 2024-03-01 14:49:06 24.05.20240228.9099616 6.6.18 *

This commit is contained in:
zackartz 2024-03-01 14:49:11 -05:00
parent 9c405ab080
commit fd133e7b5b
2 changed files with 89 additions and 0 deletions

View file

@ -11,6 +11,9 @@
imports = [
inputs.nixvim.homeManagerModules.nixvim
./swayidle.nix
../rice/hyprland
../rice/gtk.nix
../rice/kitty.nix

View file

@ -0,0 +1,86 @@
{
pkgs,
lib,
config,
theme,
...
}: let
suspendScript = pkgs.writeShellScript "suspend-script" ''
${pkgs.pipewire}/bin/pw-cli i all | ${pkgs.ripgrep}/bin/rg running
# only suspend if audio isn't running
if [ $? == 1 ]; then
${pkgs.systemd}/bin/systemctl suspend
fi
'';
in {
programs.swaylock = {
package = pkgs.swaylock-effects;
settings = with theme.colors; {
clock = true;
color = base;
font = "Work Sans";
image = "${theme.wallpaper}";
show-failed-attempts = false;
indicator = true;
indicator-radius = 200;
indicator-thickness = 20;
line-color = "00000000";
ring-color = "00000000";
inside-color = "00000000";
key-hl-color = "f2cdcd";
separator-color = "00000000";
text-color = pink;
text-caps-lock-color = "";
line-ver-color = yellow;
ring-ver-color = rosewater;
inside-ver-color = base;
text-ver-color = text;
ring-wrong-color = red;
text-wrong-color = red;
inside-wrong-color = base;
inside-clear-color = base;
text-clear-color = text;
ring-clear-color = blue;
line-clear-color = base;
line-wrong-color = base;
bs-hl-color = red;
line-uses-ring = false;
grace = 2;
grace-no-mouse = true;
grace-no-touch = true;
datestr = "%d.%m";
fade-in = "0.1";
ignore-empty-password = true;
};
};
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
event = "lock";
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
event = "lock";
command = "${pkgs.gtklock}/bin/gtklock";
}
];
timeouts = [
{
timeout = 300;
command = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
resumeCommand = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on";
}
{
timeout = 310;
command = suspendScript.outPath;
}
];
};
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"];
}