This commit is contained in:
Antoine Phan
2025-06-28 16:29:09 -04:00
parent dbaadad869
commit fae6c7cb03
8 changed files with 167 additions and 168 deletions

View File

@@ -4,39 +4,50 @@
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
// ==== Display ====
spawn-at-startup "xwayland-satellite"
environment {
DISPLAY ":0"
XCURSOR_SIZE "12"
// QT_QPA_PLATFORMTHEME "qt5ct"
// GTK_THEME "adw-gtk3-dark:dark"
// GDK_BACKEND "wayland,x11,*"
// QT_QPA_PLATFORM "wayland;xcb"
// QT_AUTO_SCREEN_SCALE_FACTOR "1"
// QT_QPA_PLATFORM "wayland;xcb"
// LIBVA_DRIVER_NAME "nvidia"
// XDG_SESSION_TYPE "wayland"
// GBM_BACKEND "nvidia-drm"
// __GLX_VENDOR_LIBRARY_NAME "nvidia"
// WLR_NO_HARDWARE_CURSORS "1"
}
spawn-at-startup "xwayland-satellite"
// `niri msg outputs`
// Built-in laptop monitor: "eDP-1"
// HDMI out display:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
output "eDP-1" {
// Format: "<width>x<height>" or "<width>x<height>@<refresh rate>".
// If the refresh rate is omitted, niri will pick the highest refresh rate
mode "1920x1080@60"
scale 1
transform "normal"
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
transform "normal"
position x=0 y=0
// Output scale and rotation has to be taken into account for positioning:
// outputs are sized in logical, or scaled, pixels.
// E.g.: 3840×2160 + scale 2.0 = 1920×1080 logical size
// Use logical size to set position
}
output "HDMI-A-1" {
output "GIGA-BYTE TECHNOLOGY CO., LTD. G27F 2 23030B002769" {
mode "1920x1080@170"
scale 1
// Second monitor above
position x=0 y=-1080
}
output "Dell Inc. DELL U2412M YMYH14450KRL" {
position x=0 y=-1200
}
output "HDMI-A-1" {
mode "1920x1080@60"
position x=0 y=0
}
// Input device configuration.
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
@@ -86,11 +97,11 @@ input {
}
// Uncomment this to make the mouse warp to the center of newly focused windows.
warp-mouse-to-focus
// warp-mouse-to-focus
// 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="50%"
focus-follows-mouse max-scroll-amount="68%"
}
// ==== LAYOUT ====
@@ -98,7 +109,7 @@ input {
layout {
gaps 12 // logical pixel
center-focused-column "never"
center-focused-column "on-overflow"
// "never" (default): focusing an off-screen column will keep
// at the left or right edge of the screen.
// "always": the focused column will always be centered.
@@ -107,12 +118,11 @@ layout {
// Mod+R resize layout behaviors
preset-column-widths {
// Proportion sets the width as a fraction of the output width, taking gaps into account.
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
proportion 0.33333
proportion 0.5
proportion 0.8
proportion 0.66667
proportion 0.5
proportion 0.33333
proportion 0.25
// Mod+F for full-width
// fixed 1920
}
@@ -122,22 +132,12 @@ layout {
}
// The windows themselves will decide their initial width.
// default-column-width {}
default-column-width {
proportion 0.6
}
// By default focus ring and border are rendered as a solid background rectangle
// behind windows. That is, they will show up through semitransparent windows.
// This is because windows using client-side decorations can have an arbitrary shape.
//
// If you don't like that, you should uncomment `prefer-no-csd` below.
// Niri will draw focus ring and border *around* windows that agree to omit their
// client-side decorations.
//
// Alternatively, you can override it with a window rule called
// `draw-border-with-background`.
// You can change how the focus ring looks.
focus-ring {
// off // uncomment to disable focus ring
// off
width 4
// CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl(), etc.
@@ -191,7 +191,7 @@ layout {
// You can change how shadows look. The values below are in logical
// pixels and match the CSS box-shadow properties.
softness 30
softness 40
spread 5 // Spread expands the shadow.
offset x=0 y=5
color "#0007"
@@ -217,6 +217,8 @@ layout {
// spawn-at-startup "alacritty" "-e" "fish"
spawn-at-startup "waybar"
spawn-at-startup "hyprpaper"
spawn-at-startup "sudo modprobe v4l2loopback"
spawn-at-startup "blueberry-tray"
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
@@ -234,15 +236,13 @@ screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
// You can also set this to null to disable saving screenshots to disk.
// screenshot-path null
// Animation settings.
// The wiki explains how to configure individual animations:
// Animation settings
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
// slowdown 3.0
slowdown 2.0
}
// Window rules let you adjust behavior for individual windows.
@@ -259,12 +259,9 @@ window-rule {
default-column-width {}
}
// Open the Firefox picture-in-picture player as floating by default.
// Vivaldi picture-in-picture player as floating by default.
window-rule {
// This app-id regular expression will work for both:
// - host Firefox (app-id is "firefox")
// - Flatpak Firefox (app-id is "org.mozilla.firefox")
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id=r#"vivaldi$"# title="^Picture-in-Picture$"
open-floating true
}
@@ -288,9 +285,7 @@ window-rule {
}
binds {
// Keys consist of modifiers separated by + signs, followed by an XKB key name
// in the end. To find an XKB name for a particular key, you may use a program
// like wev.
// Use `wev` to get the keycodes
//
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
// when running as a winit window.
@@ -305,38 +300,46 @@ binds {
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+Return { spawn "alacritty"; }
Mod+D { spawn "wofi"; }
Super+Alt+L { spawn "swaylock"; }
Mod+Shift+L { spawn "swaylock"; }
Mod+E { spawn "nautilus"; }
// 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.
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
// 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-"; }
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"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "6%+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "6%-"; }
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"; }
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "3%+" "-e" "-q"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "2%-" "-e" "-q"; }
Mod+B { spawn "blueberry"; }
Mod+Z { spawn "playerctl" "play-pause"; }
Mod+X { spawn "playerctl" "next"; }
Mod+Period { spawn "wofi-emoji"; }
Mod+G { toggle-overview; }
Mod+Shift+Q { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
Mod+Ctrl+Left { move-column-left; }
Mod+Ctrl+Down { move-window-down; }
Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; }
Mod+Ctrl+H { move-column-left; }
Mod+Ctrl+J { move-window-down; }
Mod+Ctrl+K { move-window-up; }
Mod+Ctrl+L { move-column-right; }
Mod+Ctrl+Left { focus-monitor-left; }
Mod+Ctrl+Right { focus-monitor-right; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
@@ -350,40 +353,27 @@ binds {
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Shift+Left { focus-monitor-left; }
Mod+Shift+Down { focus-monitor-down; }
Mod+Shift+Up { focus-monitor-up; }
Mod+Shift+Right { focus-monitor-right; }
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+J { focus-monitor-down; }
Mod+Shift+K { focus-monitor-up; }
Mod+Shift+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
// Alternatively, there are commands to move just a single window:
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
// ...
// And you can also move a whole workspace to another monitor:
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
Mod+Alt+Down { move-workspace-to-monitor-down; }
Mod+Alt+Up { move-workspace-to-monitor-up; }
// ...
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
Mod+N { focus-workspace-down; }
Mod+Ctrl+WheelScrollDown cooldown-ms=250 { focus-workspace-down; }
Mod+P { focus-workspace-up; }
Mod+Ctrl+WheelScrollUp cooldown-ms=250 { focus-workspace-up; }
Mod+Shift+N { move-column-to-workspace-down; }
Mod+Shift+P { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
@@ -400,15 +390,15 @@ binds {
// To avoid scrolling through workspaces really fast, you can use
// the cooldown-ms property. The bind will be rate-limited to this value.
// You can set a cooldown on any bind, but it's most useful for the wheel.
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
// Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
// Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
// Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
// Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
// Mod+WheelScrollRight { focus-column-right; }
// Mod+WheelScrollLeft { focus-column-left; }
Mod+WheelScrollUp cooldown-ms=150 { focus-column-left; }
Mod+WheelScrollDown cooldown-ms=150 { focus-column-right; }
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
@@ -443,7 +433,7 @@ binds {
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Ctrl+1 { move-column-to-workspace 1; }
Mod+Shift+1 { move-column-to-workspace 1; }
Mod+Ctrl+2 { move-column-to-workspace 2; }
Mod+Ctrl+3 { move-column-to-workspace 3; }
Mod+Ctrl+4 { move-column-to-workspace 4; }
@@ -457,7 +447,11 @@ binds {
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
Mod+Tab { focus-monitor-next; }
Mod+Shift+Tab { move-window-to-monitor-next; }
// TODO: Swap the workspaces in different monitors
Mod+S { move-workspace-to-monitor-next; }
// The following binds move the focused window in and out of a column.
// If the window is alone, they will consume it into the nearby column to the side.
@@ -466,9 +460,9 @@ binds {
Mod+BracketRight { consume-or-expel-window-right; }
// Consume one window from the right to the bottom of the focused column.
Mod+Comma { consume-window-into-column; }
// Expel the bottom window from the focused column to the right.
Mod+Period { expel-window-from-column; }
Mod+Shift+Comma { consume-window-into-column; }
Mod+Shift+Period { expel-window-from-column; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { switch-preset-window-height; }
@@ -478,7 +472,7 @@ binds {
// Expand the focused column to space not taken up by other fully visible columns.
// Makes the column "fill the rest of the space".
Mod+Ctrl+F { expand-column-to-available-width; }
// Mod+Ctrl+F { expand-column-to-available-width; }
Mod+C { center-column; }
@@ -515,6 +509,7 @@ binds {
// Mod+Shift+Space { switch-layout "prev"; }
Print { screenshot; }
Mod+Shift+S { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
@@ -529,10 +524,10 @@ binds {
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
// The quit action will show a confirmation dialog to avoid accidental exits.
Mod+Shift+E { quit; }
Mod+Ctrl+Shift+E { quit; }
Ctrl+Alt+Delete { quit; }
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
Mod+Shift+P { power-off-monitors; }
// Mod+Shift+L { power-off-monitors; }
}