feat: niri keybind

sway lock + sileneces lights and sounds
This commit is contained in:
WinterEkisha committed 2026-11-15 16:55:34 -08:00
1 parent 4f5f3322e4
commit 3796bd26c6
2 files changed
+35 -3

No files matched your search

+33 -3
View File
@@ -1,12 +1,42 @@
{ config, pkgs, ... }:
let
lockNTurnOffScript = pkgs.writeShellApplication {
name = "lockNTurnOffScreen";
runtimeInputs = with pkgs; [
wireplumber # provides wpctl
swaylock
niri
];
text = ''
# Check if already muted so we don't accidentally unmute a manually muted system
WAS_MUTED=false
if wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q '\[MUTED\]'; then
WAS_MUTED=true
fi
# Mute audio and power off monitors
wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
niri msg action power-off-monitors
# Run swaylock in the foreground (blocks until unlocked)
swaylock
# Restore mute state upon unlock
if [ "$WAS_MUTED" = false ]; then
wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
fi
'';
};
in
{
xdg.configFile."niri/config.kdl".source = ./config.kdl;
# --- Niri-Extras ---
programs.fuzzel.enable = true;
xdg.mime.enable = true;
services.playerctld.enable = true;
# home.packages = with pkgs; [
# mako
# ];
home.packages = with pkgs; [
#mako
lockNTurnOffScript
];
}