sway: Add swaylock and swayidle
This commit is contained in:
parent
be49bc0169
commit
d4ee062827
|
@ -70,6 +70,7 @@ in
|
|||
pavucontrol
|
||||
playerctl
|
||||
jq
|
||||
psmisc
|
||||
|
||||
swaylock
|
||||
swayidle
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
{ pkgs, nixosConfig, lib, ... }:
|
||||
let
|
||||
lockCmd = "${pkgs.swaylock}/bin/swaylock -c 100000ff";
|
||||
in
|
||||
{
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
|
@ -41,6 +44,16 @@
|
|||
|
||||
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
||||
|
||||
startup = [
|
||||
{ command = ''${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 300 "${lockCmd}" \
|
||||
timeout 600 "${pkgs.sway}/bin/swaymsg output * dpms off" \
|
||||
resume "${pkgs.sway}/bin/swaymsg output * dpms on" \
|
||||
before-sleep "${lockCmd}"''; }
|
||||
];
|
||||
|
||||
|
||||
|
||||
keybindings =
|
||||
let
|
||||
mod = "Mod4";
|
||||
|
@ -105,7 +118,7 @@
|
|||
"XF86AudioRaiseVolume" =
|
||||
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
# Tools, AudioMute, AudioLowerVolume
|
||||
"XF86Tools" = "exec loginctl lock-session";
|
||||
"XF86Tools" = "exec killall -USR1 swayidle";
|
||||
"XF86AudioMute" =
|
||||
"exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioLowerVolume" =
|
||||
|
|
4
modules/pam.nix
Normal file
4
modules/pam.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# Allow swaylock to talk to PAM
|
||||
security.pam.services.swaylock = {};
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
../modules/earlyoom.nix
|
||||
../modules/fonts.nix
|
||||
../modules/opengl.nix
|
||||
../modules/pam.nix
|
||||
../modules/sound.nix
|
||||
../modules/ssh.nix
|
||||
../modules/docker.nix
|
||||
|
|
Loading…
Reference in a new issue