From 3b1f0f154bab14ad2606f62c543f9d53963cb479 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 31 Mar 2025 13:27:36 +0200 Subject: niri: brightness, volume, swaync keybindings + xwayland setup --- usecases/desktop/graphical/niri.kdl | 14 +++++++++++--- usecases/desktop/graphical/niri.nix | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/usecases/desktop/graphical/niri.kdl b/usecases/desktop/graphical/niri.kdl index f9ead23..aa5e610 100644 --- a/usecases/desktop/graphical/niri.kdl +++ b/usecases/desktop/graphical/niri.kdl @@ -246,7 +246,11 @@ layout { // Note that running niri as a session supports xdg-desktop-autostart, // which may be more convenient to use. // See the binds section below for more spawn examples. -// spawn-at-startup "alacritty" "-e" "fish" +spawn-at-startup "xwayland-satellite" + +environment { + DISPLAY ":0" +} // Uncomment this line to ask the clients to omit their client-side decorations if possible. // If the client will specifically ask for CSD, the request will be honored. @@ -337,6 +341,7 @@ binds { Super+Alt+L { spawn "swaylock"; } Mod+Period { spawn "swaync-client" "-t"; } + Mod+Shift+Semicolon { spawn "swaync-client" "-t"; } // You can also use a shell. Do this if you need pipes, multiple commands, etc. // Note: the entire command goes as a single argument in the end. @@ -344,11 +349,14 @@ binds { // Example volume keys mappings for PipeWire & WirePlumber. // The allow-when-locked=true property makes them work even when the session is locked. - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "--" "+10%"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "--" "-10%"; } + Mod+Q { close-window; } Mod+Left { focus-column-left; } diff --git a/usecases/desktop/graphical/niri.nix b/usecases/desktop/graphical/niri.nix index 85960dd..21c3946 100644 --- a/usecases/desktop/graphical/niri.nix +++ b/usecases/desktop/graphical/niri.nix @@ -24,7 +24,11 @@ in programs.niri.enable = true; - environment.systemPackages = [ pkgs.walker ]; + environment.systemPackages = with pkgs; [ + brightnessctl + walker + xwayland-satellite + ]; home-manager.users.minijackson.xdg.configFile."niri/config.kdl".source = ./niri.kdl; -- cgit v1.2.3