Skip to content

Commit

Permalink
add swaylock
Browse files Browse the repository at this point in the history
  • Loading branch information
ocfox committed Dec 9, 2023
1 parent 7f821a7 commit 1d65630
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions home-desktop/_pkgs/swaylock.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ lib, pkgs }:
pkgs.writeShellScriptBin "swaylock" ''
${lib.getExe pkgs.swaylock-effects} \
--screenshots \
--clock \
--indicator \
--indicator-radius 100 \
--indicator-thickness 7 \
--effect-blur 7x5 \
--effect-vignette 0.5:0.5 \
--ring-color bb00cc \
--key-hl-color 880033 \
--line-color 00000000 \
--inside-color 00000088 \
--separator-color 00000000 \
--grace 2 \
--fade-in 0.2
''
10 changes: 6 additions & 4 deletions home-desktop/services/swayidle.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{ lib, pkgs }:
{ lib, pkgs, root }:
let
inherit (root.pkgs) swaylock;
in
{
enable = true;
timeouts = [
{
timeout = 900;
command = "${lib.getExe pkgs.sway} output '*' dpms off";
resumeCommand = "${lib.getExe pkgs.sway} output '*' dpms on";
timeout = 300;
command = "${lib.getExe swaylock}";
}
];
}
3 changes: 2 additions & 1 deletion home-desktop/wayland/windowManager/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
inherit (root.pkgs) macshot powermenu recorder-toggle;
inherit (root.pkgs) macshot powermenu recorder-toggle swaylock;
in
pkgs.lib.mkOptionDefault {
"${modifier}+h" = "focus left";
"${modifier}+j" = "focus down";
"${modifier}+k" = "focus up";
"${modifier}+l" = "focus right";
"${modifier}+apostrophe" = "exec ${lib.getExe swaylock}";
"${modifier}+d" = "move scratchpad";
"${modifier}+i" = "scratchpad show";
"${modifier}+Shift+a" = "exec ${lib.getExe macshot}";
Expand Down
1 change: 1 addition & 0 deletions hosts/whitefox/programs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
enableSSHSupport = true;
};
dconf.enable = true;
sway.enable = true;
fish = {
useBabelfish = true;
enable = true;
Expand Down

0 comments on commit 1d65630

Please sign in to comment.