fix swaylock for allegro

This commit is contained in:
Antoine Vaure 2024-10-21 01:21:29 +02:00 committed by ant
parent e84a8ae2ef
commit 28336a7951

17
ui.nix
View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, variant, ... }:
let
defaultTerminal = "alacritty";
alacrittyLightTheme = "${pkgs.alacritty-theme}/night_owlish_light.toml";
@ -108,12 +108,17 @@ in
mimeApps.defaultApplications."TerminalEmulator" = "Alacritty.desktop";
};
services.swayidle = {
services.swayidle =
let swaylock-bin = (if variant == "allegro"
then "/usr/bin/swaylock"
else "${config.programs.swaylock.package}/bin/swaylock");
in
{
enable = true;
events = [
{
event = "before-sleep";
command = "${config.programs.swaylock.package}/bin/swaylock -defF";
command = "${swaylock-bin} -defF";
}
{
event = "after-resume";
@ -121,14 +126,14 @@ in
}
{
event = "lock";
command = "${config.programs.swaylock.package}/bin/swaylock -defF";
command = "${swaylock-bin} -defF";
}
];
timeouts = [
{
timeout = 900;
command = "${config.programs.swaylock.package}/bin/swaylock -defF";
command = "${swaylock-bin} -defF";
}
{
timeout = 900;
@ -138,7 +143,7 @@ in
};
programs.swaylock = {
enable = true;
enable = (variant != "allegro");
package = pkgs.swaylock-effects;
settings = {
screenshots = true;