niri: keybindings and window rules

This commit is contained in:
Aleksey Samoilov 2025-06-12 23:52:15 +04:00
parent 174cb01300
commit fdb531c4a7

View file

@ -60,7 +60,7 @@ input {
// Focus windows and outputs automatically when moving the mouse into them. // 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. // 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 // You can configure outputs by their name, which you can find
@ -153,7 +153,7 @@ layout {
// off // off
// How many logical pixels the ring extends out from the windows. // How many logical pixels the ring extends out from the windows.
width 4 width 2
// Colors can be set in a variety of ways: // Colors can be set in a variety of ways:
// - CSS named colors: "red" // - CSS named colors: "red"
@ -188,7 +188,7 @@ layout {
// If you enable the border, you probably want to disable the focus ring. // If you enable the border, you probably want to disable the focus ring.
off off
width 4 width 2
active-color "#ffc87f" active-color "#ffc87f"
inactive-color "#505050" inactive-color "#505050"
@ -202,7 +202,7 @@ layout {
// You can enable drop shadows for windows. // You can enable drop shadows for windows.
shadow { shadow {
// Uncomment the next line to enable shadows. // Uncomment the next line to enable shadows.
// on on
// By default, the shadow draws only around its window, and not behind it. // By default, the shadow draws only around its window, and not behind it.
// Uncomment this setting to make the shadow draw behind its window. // 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 // Playerctl daemonize
spawn-at-startup "playerctl -a metadata --format \'{{status}} {{title}}\' --follow | while read line; do pkill -RTMIN+5 waybar; done &" 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. // 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. // 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. // 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" // block-out-from "screencast"
} }
// Example: enable rounded corners for all windows. // Start selected applications in floating mode
// (This example rule is commented out with a "/-" in front.) window-rule {
/-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 geometry-corner-radius 12
clip-to-geometry true clip-to-geometry true
} }
@ -363,9 +415,9 @@ binds {
Mod+Shift+Slash { show-hotkey-overlay; } Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker. // Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; }
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } 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: swaylock" { spawn "swaylock"; } 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. // 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. // 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"; } 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"; } 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. // Open/close the Overview: a zoomed-out view of workspaces and windows.
// You can also move the mouse into the top-left hot corner, // You can also move the mouse into the top-left hot corner,
// or do a four-finger swipe up on a touchpad. // or do a four-finger swipe up on a touchpad.
@ -566,8 +628,8 @@ binds {
Mod+Shift+Equal { set-window-height "+10%"; } Mod+Shift+Equal { set-window-height "+10%"; }
// Move the focused window between the floating and the tiling layout. // Move the focused window between the floating and the tiling layout.
Mod+V { toggle-window-floating; } Mod+Space { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; } Mod+Shift+Space { switch-focus-between-floating-and-tiling; }
// Toggle tabbed column display mode. // Toggle tabbed column display mode.
// Windows in this column will appear as vertical tabs, // Windows in this column will appear as vertical tabs,