feat: use plain swaylock for non-swayfx

This commit is contained in:
winston 2024-09-08 15:04:39 +02:00
parent 0ae9142723
commit 3db5914442
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 43 additions and 36 deletions

View file

@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: }:
@ -14,6 +15,7 @@ let
red = "#f38ba8"; red = "#f38ba8";
mauve = "#cba6f7"; mauve = "#cba6f7";
}; };
isSwayFx = osConfig.dotfiles.desktop == "swayfx";
in in
{ {
config = lib.mkIf config.isGraphical { config = lib.mkIf config.isGraphical {
@ -86,47 +88,53 @@ in
programs.swaylock = lib.mkIf isLinux { programs.swaylock = lib.mkIf isLinux {
enable = true; enable = true;
package = pkgs.swaylock-effects; package = lib.mkIf isSwayFx pkgs.swaylock-effects;
settings = { settings =
ignore-empty-password = false; {
font = "IBM Plex Sans"; ignore-empty-password = false;
fade-in = "0.2"; font = "IBM Plex Sans";
screenshots = true;
clock = true; indicator-radius = "100";
timestr = "%H:%M"; indicator-thickness = "10";
datestr = "%A, %d %B";
indicator = true; color = lib.mkIf (!isSwayFx) "000000";
indicator-radius = "100";
indicator-thickness = "10";
effect-blur = "30x2"; text-color = "cdd6f4";
effect-vignette = "0.5:0.5"; text-clear-color = "11111b";
text-ver-color = "11111b";
text-wrong-color = "11111b";
text-color = "cdd6f4"; ring-color = "1e1e2e";
text-clear-color = "11111b"; key-hl-color = "f5c2e7";
text-ver-color = "11111b"; line-color = "f5c2e7";
text-wrong-color = "11111b"; inside-color = "00000088";
separator-color = "00000000";
ring-color = "1e1e2e"; inside-clear-color = "f2cdcd88";
key-hl-color = "f5c2e7"; line-clear-color = "f2cdcd";
line-color = "f5c2e7"; ring-clear-color = "f2cdcd";
inside-color = "00000088";
separator-color = "00000000";
inside-clear-color = "f2cdcd88"; inside-ver-color = "89dceb88";
line-clear-color = "f2cdcd"; line-ver-color = "89dceb";
ring-clear-color = "f2cdcd"; ring-ver-color = "89dceb";
inside-ver-color = "89dceb88"; inside-wrong-color = "f38ba888";
line-ver-color = "89dceb"; line-wrong-color = "f38ba8";
ring-ver-color = "89dceb"; ring-wrong-color = "f38ba8";
}
// (lib.optionalAttrs isSwayFx) {
indicator = true;
screenshots = true;
inside-wrong-color = "f38ba888"; clock = true;
line-wrong-color = "f38ba8"; timestr = "%H:%M";
ring-wrong-color = "f38ba8"; datestr = "%A, %d %B";
};
effect-blur = "30x2";
effect-vignette = "0.5:0.5";
fade-in = "0.2";
};
}; };
}; };
} }

View file

@ -90,8 +90,7 @@ in
{ {
command = '' command = ''
swayidle -w \ swayidle -w \
timeout 180 'swaylock -f' \ timeout 300 'swaymsg "output * dpms off"' \
timeout 360 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \ resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f' before-sleep 'swaylock -f'
''; '';
@ -217,7 +216,7 @@ in
}; };
modes = { modes = {
"power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off" = { "power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off" = {
l = "exec --no-startup-id swaylock --color 000000, mode \"default\""; l = "exec --no-startup-id swaylock, mode \"default\"";
e = "exec --no-startup-id swaymsg exit, mode \"default\""; e = "exec --no-startup-id swaymsg exit, mode \"default\"";
r = "exec --no-startup-id systemctl reboot, mode \"default\""; r = "exec --no-startup-id systemctl reboot, mode \"default\"";
s = "exec --no-startup-id systemctl suspend, mode \"default\""; s = "exec --no-startup-id systemctl suspend, mode \"default\"";