Skip to content

Commit

Permalink
feat: use plain swaylock for non-swayfx
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Sep 8, 2024
1 parent 0ae9142 commit 3db5914
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
74 changes: 41 additions & 33 deletions home/apps/rice.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
config,
lib,
osConfig,
pkgs,
...
}:
Expand All @@ -14,6 +15,7 @@ let
red = "#f38ba8";
mauve = "#cba6f7";
};
isSwayFx = osConfig.dotfiles.desktop == "swayfx";
in
{
config = lib.mkIf config.isGraphical {
Expand Down Expand Up @@ -86,47 +88,53 @@ in

programs.swaylock = lib.mkIf isLinux {
enable = true;
package = pkgs.swaylock-effects;
settings = {
ignore-empty-password = false;
font = "IBM Plex Sans";
fade-in = "0.2";
screenshots = true;
package = lib.mkIf isSwayFx pkgs.swaylock-effects;
settings =
{
ignore-empty-password = false;
font = "IBM Plex Sans";

clock = true;
timestr = "%H:%M";
datestr = "%A, %d %B";
indicator-radius = "100";
indicator-thickness = "10";

indicator = true;
indicator-radius = "100";
indicator-thickness = "10";
color = lib.mkIf (!isSwayFx) "000000";

effect-blur = "30x2";
effect-vignette = "0.5:0.5";
text-color = "cdd6f4";
text-clear-color = "11111b";
text-ver-color = "11111b";
text-wrong-color = "11111b";

text-color = "cdd6f4";
text-clear-color = "11111b";
text-ver-color = "11111b";
text-wrong-color = "11111b";
ring-color = "1e1e2e";
key-hl-color = "f5c2e7";
line-color = "f5c2e7";
inside-color = "00000088";
separator-color = "00000000";

ring-color = "1e1e2e";
key-hl-color = "f5c2e7";
line-color = "f5c2e7";
inside-color = "00000088";
separator-color = "00000000";
inside-clear-color = "f2cdcd88";
line-clear-color = "f2cdcd";
ring-clear-color = "f2cdcd";

inside-clear-color = "f2cdcd88";
line-clear-color = "f2cdcd";
ring-clear-color = "f2cdcd";
inside-ver-color = "89dceb88";
line-ver-color = "89dceb";
ring-ver-color = "89dceb";

inside-ver-color = "89dceb88";
line-ver-color = "89dceb";
ring-ver-color = "89dceb";
inside-wrong-color = "f38ba888";
line-wrong-color = "f38ba8";
ring-wrong-color = "f38ba8";
}
// (lib.optionalAttrs isSwayFx) {
indicator = true;
screenshots = true;

inside-wrong-color = "f38ba888";
line-wrong-color = "f38ba8";
ring-wrong-color = "f38ba8";
};
clock = true;
timestr = "%H:%M";
datestr = "%A, %d %B";

effect-blur = "30x2";
effect-vignette = "0.5:0.5";

fade-in = "0.2";
};
};
};
}
5 changes: 2 additions & 3 deletions home/apps/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ in
{
command = ''
swayidle -w \
timeout 180 'swaylock -f' \
timeout 360 'swaymsg "output * dpms off"' \
timeout 300 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f'
'';
Expand Down Expand Up @@ -217,7 +216,7 @@ in
};
modes = {
"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\"";
r = "exec --no-startup-id systemctl reboot, mode \"default\"";
s = "exec --no-startup-id systemctl suspend, mode \"default\"";
Expand Down

0 comments on commit 3db5914

Please sign in to comment.