From fdb531c4a76c2eb3188822752cfbbff429e4fd14 Mon Sep 17 00:00:00 2001 From: Aleksey Samoilov Date: Thu, 12 Jun 2025 23:52:15 +0400 Subject: [PATCH] niri: keybindings and window rules --- niri/etc/skel/.config/niri/config.kdl | 92 ++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/niri/etc/skel/.config/niri/config.kdl b/niri/etc/skel/.config/niri/config.kdl index 77d43df..f38e336 100644 --- a/niri/etc/skel/.config/niri/config.kdl +++ b/niri/etc/skel/.config/niri/config.kdl @@ -60,7 +60,7 @@ input { // Focus windows and outputs automatically when moving the mouse into them. // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - // focus-follows-mouse max-scroll-amount="0%" + focus-follows-mouse max-scroll-amount="0%" } // You can configure outputs by their name, which you can find @@ -153,7 +153,7 @@ layout { // off // How many logical pixels the ring extends out from the windows. - width 4 + width 2 // Colors can be set in a variety of ways: // - CSS named colors: "red" @@ -188,7 +188,7 @@ layout { // If you enable the border, you probably want to disable the focus ring. off - width 4 + width 2 active-color "#ffc87f" inactive-color "#505050" @@ -202,7 +202,7 @@ layout { // You can enable drop shadows for windows. shadow { // Uncomment the next line to enable shadows. - // on + on // By default, the shadow draws only around its window, and not behind it. // Uncomment this setting to make the shadow draw behind its window. @@ -276,9 +276,6 @@ spawn-at-startup "wl-paste --watch pkill -RTMIN+9 waybar &" // Playerctl daemonize spawn-at-startup "playerctl -a metadata --format \'{{status}} {{title}}\' --follow | while read line; do pkill -RTMIN+5 waybar; done &" -// This line starts waybar, a commonly used bar for Wayland compositors. -// spawn-at-startup "waybar" - // 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. // Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. @@ -340,9 +337,64 @@ window-rule { // block-out-from "screencast" } -// Example: enable rounded corners for all windows. -// (This example rule is commented out with a "/-" in front.) -/-window-rule { +// Start selected applications in floating mode +window-rule { + match app-id="nwg-look" + open-floating true +} + +window-rule { + match app-id="engrampa" + open-floating true +} + +window-rule { + match app-id="calamares" + open-floating true +} + +window-rule { + match app-id="qt5ct" + open-floating true +} + +window-rule { + match app-id="qt6ct" + open-floating true +} + +window-rule { + match app-id="pavucontrol" + open-floating true +} + +window-rule { + match app-id="xsensors" + open-floating true +} + +window-rule { + match app-id="nm-connection-editor" + open-floating true +} + +window-rule { + match app-id="wdisplays" + open-floating true +} + +window-rule { + match title="Save File" + open-floating true +} + +window-rule { + match title="(?:Open|Save) (?:File|Folder|As)" + open-floating true +} + +// Enable rounded corners for all windows. +window-rule { geometry-corner-radius 12 clip-to-geometry true } @@ -363,9 +415,9 @@ binds { Mod+Shift+Slash { show-hotkey-overlay; } // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } - Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } - Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } + Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } + Mod+D hotkey-overlay-title="Run an Application: wofi" { spawn "wofi --show drun --allow-images --allow-markup --hide-scroll --no-actions -lines 10 -width 35 --prompt "Search""; } + Super+Alt+L hotkey-overlay-title="Lock the Screen: gtklock" { spawn "/usr/share/tileos/scripts/lock.sh"; } // 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. @@ -378,6 +430,16 @@ binds { 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"; } + // Media keys + XF86AudioMedia allow-when-locked=true { spawn "playerctl play-pause"; } + XF86AudioPlay allow-when-locked=true { spawn "playerctl play-pause"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl previous"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl next"; } + + // Birghtness adjust + XF86MonBrightnessUp allow-when-locked=false { spawn "brightnessctl set +5%"; } + XF86MonBrightnessDown allow-when-locked=false { spawn "brightnessctl set -5%"; } + // Open/close the Overview: a zoomed-out view of workspaces and windows. // You can also move the mouse into the top-left hot corner, // or do a four-finger swipe up on a touchpad. @@ -566,8 +628,8 @@ binds { Mod+Shift+Equal { set-window-height "+10%"; } // Move the focused window between the floating and the tiling layout. - Mod+V { toggle-window-floating; } - Mod+Shift+V { switch-focus-between-floating-and-tiling; } + Mod+Space { toggle-window-floating; } + Mod+Shift+Space { switch-focus-between-floating-and-tiling; } // Toggle tabbed column display mode. // Windows in this column will appear as vertical tabs,