Skip to content

Commit

Permalink
feat: swaylock
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed May 15, 2024
1 parent ee566bd commit 1531735
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 34 deletions.
80 changes: 47 additions & 33 deletions home/misc/lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,53 @@
${pkgs.systemd}/bin/systemctl suspend
fi
'';
font_family = "Lexend";
in {
programs.swaylock = {
package = pkgs.swaylock-effects;
settings = with theme.colors; {
clock = true;
font = "Lexend";
show-failed-attempts = false;
screenshots = true;
effect-blur = "10x5";
effect-vignette = "0.5:0.5";
indicator = true;
indicator-radius = 200;
indicator-thickness = 20;
ring-color = surface1;
key-hl-color = accent;
text-color = text;
text-caps-lock-color = "";
ring-ver-color = accent;
text-ver-color = text;
ring-wrong-color = red;
text-wrong-color = red;
text-clear-color = blue;
ring-clear-color = blue;
bs-hl-color = red;

inside-color = "00000000";
inside-clear-color = "00000000";
inside-caps-lock-color = "00000000";
inside-ver-color = "00000000";
inside-wrong-color = "00000000";
layout-bg-color = "00000000";
layout-border-color = "00000000";
line-color = "00000000";
line-clear-color = "00000000";
line-caps-lock-color = "00000000";
line-ver-color = "00000000";
line-wrong-color = "00000000";
separator-color = "00000000";
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 = [
Expand All @@ -23,7 +68,7 @@ in {
}
{
event = "lock";
command = "${pkgs.gtklock}/bin/gtklock";
command = "${config.programs.swaylock.package}/bin/swaylock";
}
];
timeouts = [
Expand All @@ -33,35 +78,4 @@ in {
}
];
};
home.packages = with pkgs; [gtklock];

xdg.configFile."gtklock/style.css".text = ''
window {
background: rgba(0,0,0,.5);
font-family: Product Sans;
}
grid > label {
color: transparent;
margin: -20rem;
}
button {
all: unset;
color: transparent;
margin: -20rem;
}
#clock-label {
font-size: 6rem;
margin-bottom: 4rem;
text-shadow: 0px 2px 10px rgba(0,0,0,.1);
}
entry {
border-radius: 16px;
margin: 6rem;
box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
'';
}
1 change: 1 addition & 0 deletions home/rice/niri/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ with theme.colors; {
"Mod+Space".action = spawn "${pkgs.fuzzel}/bin/fuzzel";
"Mod+V".action = sh "${pkgs.cliphist}/bin/cliphist list | fuzzel --dmenu | cliphist decode | wl-copy";
"Mod+Shift+Period".action = spawn "emoji";
"Mod+Shift+L".action = spawn "swaylock" "--grace" "0";

"XF86AudioRaiseVolume".action = spawn "pamixer" "-i" "5";
"XF86AudioLowerVolume".action = spawn "pamixer" "-d" "5";
Expand Down
2 changes: 1 addition & 1 deletion system/core/schizo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
packages = [pkgs.apparmor-profiles];
};
pam = {
services.gtklock.text = "auth include login";
services.swaylock.text = "auth include login";
loginLimits = [
{
domain = "@wheel";
Expand Down

0 comments on commit 1531735

Please sign in to comment.