sway: Add swaylock and swayidle
This commit is contained in:
parent
be49bc0169
commit
d4ee062827
|
@ -70,6 +70,7 @@ in
|
||||||
pavucontrol
|
pavucontrol
|
||||||
playerctl
|
playerctl
|
||||||
jq
|
jq
|
||||||
|
psmisc
|
||||||
|
|
||||||
swaylock
|
swaylock
|
||||||
swayidle
|
swayidle
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{ pkgs, nixosConfig, lib, ... }:
|
{ pkgs, nixosConfig, lib, ... }:
|
||||||
|
let
|
||||||
|
lockCmd = "${pkgs.swaylock}/bin/swaylock -c 100000ff";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -41,6 +44,16 @@
|
||||||
|
|
||||||
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
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 =
|
keybindings =
|
||||||
let
|
let
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
|
@ -105,7 +118,7 @@
|
||||||
"XF86AudioRaiseVolume" =
|
"XF86AudioRaiseVolume" =
|
||||||
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
# Tools, AudioMute, AudioLowerVolume
|
# Tools, AudioMute, AudioLowerVolume
|
||||||
"XF86Tools" = "exec loginctl lock-session";
|
"XF86Tools" = "exec killall -USR1 swayidle";
|
||||||
"XF86AudioMute" =
|
"XF86AudioMute" =
|
||||||
"exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
"exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
"XF86AudioLowerVolume" =
|
"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/earlyoom.nix
|
||||||
../modules/fonts.nix
|
../modules/fonts.nix
|
||||||
../modules/opengl.nix
|
../modules/opengl.nix
|
||||||
|
../modules/pam.nix
|
||||||
../modules/sound.nix
|
../modules/sound.nix
|
||||||
../modules/ssh.nix
|
../modules/ssh.nix
|
||||||
../modules/docker.nix
|
../modules/docker.nix
|
||||||
|
|
Loading…
Reference in a new issue