467 lines
15 KiB
Plaintext
467 lines
15 KiB
Plaintext
// edited. thx to fizzyizzy05.
|
|
input {
|
|
keyboard {
|
|
xkb {
|
|
layout "us"
|
|
}
|
|
numlock
|
|
}
|
|
|
|
touchpad {
|
|
// off
|
|
tap
|
|
// dwt
|
|
// dwtp
|
|
// drag false
|
|
// drag-lock
|
|
natural-scroll
|
|
// accel-speed 0.2
|
|
// accel-profile "flat"
|
|
// scroll-method "two-finger"
|
|
// disabled-on-external-mouse
|
|
click-method "clickfinger"
|
|
}
|
|
|
|
mouse {
|
|
// off
|
|
// natural-scroll
|
|
accel-speed -0.2
|
|
accel-profile "flat"
|
|
// scroll-method "no-scroll"
|
|
}
|
|
|
|
trackpoint {
|
|
// off
|
|
// natural-scroll
|
|
// accel-speed 0.2
|
|
// accel-profile "flat"
|
|
// scroll-method "on-button-down"
|
|
// scroll-button 273
|
|
// middle-emulation
|
|
}
|
|
|
|
warp-mouse-to-focus
|
|
|
|
focus-follows-mouse max-scroll-amount="0%"
|
|
}
|
|
|
|
output "eDP-1" {
|
|
scale 1.25
|
|
}
|
|
|
|
output "HDMI-A-1" {
|
|
mode "1920x1080@180.000"
|
|
//position x=1920 y=0
|
|
focus-at-startup
|
|
}
|
|
|
|
layout {
|
|
gaps 6
|
|
|
|
center-focused-column "never"
|
|
|
|
preset-column-widths {
|
|
proportion 0.33333
|
|
proportion 0.5
|
|
proportion 0.66667
|
|
|
|
// Fixed sets the width in logical pixels exactly.
|
|
// fixed 1920
|
|
}
|
|
|
|
// preset-window-heights { }
|
|
|
|
default-column-width { proportion 0.5; }
|
|
// default-column-width {}
|
|
|
|
focus-ring {
|
|
off
|
|
}
|
|
|
|
border {
|
|
width 1
|
|
active-color "#56949fff"
|
|
inactive-color "#403d52ff"
|
|
|
|
urgent-color "#eb6f92ff"
|
|
|
|
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
|
|
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
|
}
|
|
|
|
shadow {
|
|
on
|
|
|
|
// draw-behind-window true
|
|
|
|
// Softness controls the shadow blur radius.
|
|
softness 15
|
|
|
|
// Spread expands the shadow.
|
|
spread 2
|
|
|
|
// Offset moves the shadow relative to the window.
|
|
offset x=0 y=0
|
|
|
|
// You can also change the shadow color and opacity.
|
|
color "#000b"
|
|
}
|
|
|
|
struts {
|
|
//left 0
|
|
//right 6
|
|
//top 3
|
|
//bottom 3
|
|
}
|
|
|
|
insert-hint {
|
|
// off
|
|
color "#31748f4c"
|
|
}
|
|
}
|
|
|
|
hotkey-overlay {
|
|
skip-at-startup
|
|
}
|
|
|
|
layer-rule {
|
|
match namespace="^swww-daemonblur$"
|
|
place-within-backdrop true
|
|
}
|
|
|
|
overview {
|
|
backdrop-color "#26233a"
|
|
zoom 0.5
|
|
}
|
|
|
|
switch-events {
|
|
lid-close { spawn "bash" "-c" "swaylock" "&&" "systemctl" "suspend"; }
|
|
}
|
|
|
|
gestures {
|
|
hot-corners {
|
|
off
|
|
}
|
|
}
|
|
|
|
prefer-no-csd
|
|
|
|
screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png"
|
|
// screenshot-path null
|
|
|
|
animations {
|
|
// off
|
|
|
|
// Slow down all animations by this factor. Values below 1 speed them up instead.
|
|
// slowdown 3.0
|
|
|
|
window-open {
|
|
spring damping-ratio=0.80 stiffness=400 epsilon=0.0001
|
|
}
|
|
|
|
window-close {
|
|
duration-ms 350
|
|
curve "ease-out-expo"
|
|
}
|
|
|
|
window-resize {
|
|
spring damping-ratio=1.0 stiffness=300 epsilon=0.0001
|
|
}
|
|
|
|
window-movement {
|
|
spring damping-ratio=1.0 stiffness=300 epsilon=0.0001
|
|
}
|
|
|
|
overview-open-close {
|
|
duration-ms 300
|
|
curve "ease-out-quad"
|
|
}
|
|
|
|
horizontal-view-movement {
|
|
duration-ms 500
|
|
curve "ease-out-expo"
|
|
}
|
|
|
|
workspace-switch {
|
|
duration-ms 500
|
|
curve "ease-out-expo"
|
|
}
|
|
|
|
screenshot-ui-open {
|
|
duration-ms 400
|
|
curve "ease-out-cubic"
|
|
}
|
|
}
|
|
|
|
window-rule {
|
|
geometry-corner-radius 6
|
|
clip-to-geometry true
|
|
}
|
|
|
|
window-rule {
|
|
match app-id="QQ"
|
|
default-column-width { proportion 0.6; }
|
|
open-on-output "eDP-1"
|
|
block-out-from "screencast"
|
|
}
|
|
|
|
window-rule {
|
|
match title="^(图片查看器|.*记录)$" app-id="QQ"
|
|
|
|
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
|
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
|
match app-id=r#"^org\.kde\.ksecretd$"#
|
|
|
|
match app-id="pavucontrol-qt"
|
|
open-floating true
|
|
}
|
|
|
|
window-rule {
|
|
match title=r#"Code - OSS$"#
|
|
match title=r#"Visual Studio Code$"#
|
|
match app-id=r#"^code"#
|
|
|
|
match app-id=r#"firefox$"#
|
|
open-maximized true
|
|
}
|
|
|
|
window-rule {
|
|
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
|
|
open-floating true
|
|
default-floating-position x=8 y=8 relative-to="bottom-right"
|
|
open-focused false
|
|
open-on-output "eDP-1"
|
|
}
|
|
|
|
spawn-at-startup "waybar"
|
|
spawn-at-startup "swww-daemon"
|
|
spawn-at-startup "swww-daemon" "--namespace" "blur"
|
|
spawn-at-startup "xwayland-satellite"
|
|
spawn-at-startup "/usr/lib/pam_kwallet_init"
|
|
|
|
environment {
|
|
DISPLAY ":0"
|
|
//QT_QPA_PLATFORMTHEME "qt6ct"
|
|
ELECTRON_OZONE_PLATFORM_HINT "auto"
|
|
}
|
|
|
|
binds {
|
|
Mod+F1 { show-hotkey-overlay; }
|
|
|
|
Mod+Return hotkey-overlay-title="Terminal (foot)" { spawn "foot"; }
|
|
Mod+F9 hotkey-overlay-title="Browser (firefox)" { spawn "firefox"; }
|
|
Mod+E hotkey-overlay-title="Explorer (yazi)" { spawn "foot" "yazi"; }
|
|
//Shift+Mod+Return hotkey-overlay-title="Steam" { spawn "steam"; }
|
|
|
|
Mod+F12 hotkey-overlay-title="Open Projects ... (VSCode)" { spawn "~/.niri-dotfiles/bin/fuzzel-vsc-entries.sh"; }
|
|
Mod+Space hotkey-overlay-title="Run a command ... (fuzzel)" { spawn "~/.niri-dotfiles/bin/fuzzel-win+r.sh"; }
|
|
|
|
// Applications such as remote-desktop clients and software KVM switches may
|
|
// request that niri stops processing the keyboard shortcuts defined here
|
|
// so they may, for example, forward the key presses as-is to a remote machine.
|
|
// It's a good idea to bind an escape hatch to toggle the inhibitor,
|
|
// so a buggy application can't hold your session hostage.
|
|
//
|
|
// The allow-inhibiting=false property can be applied to other binds as well,
|
|
// which ensures niri always processes them, even when an inhibitor is active.
|
|
Mod+Alt+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
|
|
Mod+Shift+Escape hotkey-overlay-title="Exit niri" { quit; }
|
|
Super+Escape hotkey-overlay-title="Lock the Screen (gtklock)" { spawn "gtklock" "-d"; }
|
|
XF86PowerOff hotkey-overlay-title="Lock screen and Hibernate ..." { spawn-sh "gtklock -d && sleep 3 && systemctl hibernate"; }
|
|
|
|
XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01+"; }
|
|
XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01-"; }
|
|
XF86AudioMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
|
|
XF86AudioMicMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
|
|
|
|
//Mod+Shift+M allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; }
|
|
|
|
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
|
|
XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; }
|
|
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
|
|
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
|
|
XF86AudioStop allow-when-locked=true { spawn "playerctl" "stop"; }
|
|
|
|
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+5%"; }
|
|
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "5%-"; }
|
|
|
|
Alt+Tab hotkey-overlay-title=null repeat=false { toggle-overview; }
|
|
Alt+F4 { 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+Shift+Left { move-column-left; }
|
|
Mod+Shift+Down { move-window-down; }
|
|
Mod+Shift+Up { move-window-up; }
|
|
Mod+Shift+Right { move-column-right; }
|
|
//Mod+Shift+H { move-column-left; }
|
|
//Mod+Shift+J { move-window-down; }
|
|
//Mod+Shift+K { move-window-up; }
|
|
//Mod+Shift+L { move-column-right; }
|
|
|
|
// Alternative commands that move across workspaces when reaching
|
|
// the first or last window in a column.
|
|
// Mod+J { focus-window-or-workspace-down; }
|
|
// Mod+K { focus-window-or-workspace-up; }
|
|
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
|
|
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
|
|
|
|
Mod+Home { focus-column-first; }
|
|
Mod+End { focus-column-last; }
|
|
Mod+Ctrl+Home { move-column-to-first; }
|
|
Mod+Ctrl+End { move-column-to-last; }
|
|
|
|
Mod+Ctrl+Left { focus-monitor-left; }
|
|
Mod+Ctrl+Down { focus-monitor-down; }
|
|
Mod+Ctrl+Up { focus-monitor-up; }
|
|
Mod+Ctrl+Right { focus-monitor-right; }
|
|
//Mod+Ctrl+H { focus-monitor-left; }
|
|
//Mod+Ctrl+J { focus-monitor-down; }
|
|
//Mod+Ctrl+K { focus-monitor-up; }
|
|
//Mod+Ctrl+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+Page_Down { focus-workspace-down; }
|
|
Mod+Page_Up { focus-workspace-up; }
|
|
//Mod+U { focus-workspace-down; }
|
|
//Mod+I { focus-workspace-up; }
|
|
Mod+Shift+Page_Down { move-column-to-workspace-down; }
|
|
Mod+Shift+Page_Up { move-column-to-workspace-up; }
|
|
//Mod+Shift+U { move-column-to-workspace-down; }
|
|
//Mod+Shift+I { move-column-to-workspace-up; }
|
|
|
|
// Alternatively, there are commands to move just a single window:
|
|
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
|
|
// ...
|
|
|
|
Mod+Ctrl+Page_Down { move-workspace-down; }
|
|
Mod+Ctrl+Page_Up { move-workspace-up; }
|
|
//Mod+Ctrl+U { move-workspace-down; }
|
|
//Mod+Ctrl+I { move-workspace-up; }
|
|
|
|
|
|
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
|
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
|
Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
|
|
Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
|
|
|
|
Mod+WheelScrollRight { focus-column-right; }
|
|
Mod+WheelScrollLeft { focus-column-left; }
|
|
Mod+Shift+WheelScrollRight { move-column-right; }
|
|
Mod+Shift+WheelScrollLeft { move-column-left; }
|
|
// Usually scrolling up and down with Shift in applications results in
|
|
// horizontal scrolling; these binds replicate that.
|
|
// Mod+Shift+WheelScrollDown { focus-column-right; }
|
|
// Mod+Shift+WheelScrollUp { focus-column-left; }
|
|
// Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
|
|
// Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
|
|
|
|
// Similarly, you can bind touchpad scroll "ticks".
|
|
// Touchpad scrolling is continuous, so for these binds it is split into
|
|
// discrete intervals.
|
|
// These binds are also affected by touchpad's natural-scroll, so these
|
|
// example binds are "inverted", since we have natural-scroll enabled for
|
|
// touchpads by default.
|
|
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
|
|
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
|
|
|
|
Mod+1 { focus-workspace 1; }
|
|
Mod+2 { focus-workspace 2; }
|
|
Mod+3 { focus-workspace 3; }
|
|
Mod+4 { focus-workspace 4; }
|
|
Mod+5 { focus-workspace 5; }
|
|
Mod+6 { focus-workspace 6; }
|
|
Mod+7 { focus-workspace 7; }
|
|
Mod+8 { focus-workspace 8; }
|
|
Mod+9 { focus-workspace 9; }
|
|
Mod+Shift+1 { move-column-to-workspace focus=false 1 ; }
|
|
Mod+Shift+2 { move-column-to-workspace focus=false 2 ; }
|
|
Mod+Shift+3 { move-column-to-workspace focus=false 3 ; }
|
|
Mod+Shift+4 { move-column-to-workspace focus=false 4 ; }
|
|
Mod+Shift+5 { move-column-to-workspace focus=false 5 ; }
|
|
Mod+Shift+6 { move-column-to-workspace focus=false 6 ; }
|
|
Mod+Shift+7 { move-column-to-workspace focus=false 7 ; }
|
|
Mod+Shift+8 { move-column-to-workspace focus=false 8 ; }
|
|
Mod+Shift+9 { move-column-to-workspace focus=false 9 ; }
|
|
|
|
// Alternatively, there are commands to move just a single window:
|
|
// Mod+Ctrl+1 { move-window-to-workspace 1; }
|
|
|
|
// Switches focus between the current and the previous workspace.
|
|
// Mod+Tab { focus-workspace-previous; }
|
|
|
|
Mod+Comma { consume-window-into-column; }
|
|
Mod+Period { expel-window-from-column; }
|
|
|
|
Mod+Shift+V { toggle-window-floating; }
|
|
Mod+V { switch-focus-between-floating-and-tiling; }
|
|
|
|
Mod+BracketLeft { consume-or-expel-window-left; }
|
|
Mod+BracketRight { consume-or-expel-window-right; }
|
|
|
|
Mod+R { switch-preset-column-width; }
|
|
Mod+Shift+R { switch-preset-window-height; }
|
|
Mod+Ctrl+R { reset-window-height; }
|
|
Mod+F11 { maximize-column; }
|
|
Mod+Shift+F11 { toggle-windowed-fullscreen; }
|
|
Mod+Ctrl+F11 { fullscreen-window; }
|
|
Mod+T hotkey-overlay-title="Expand column to available width" { expand-column-to-available-width; }
|
|
Mod+W hotkey-overlay-title="Tabbed Column Mode" { toggle-column-tabbed-display; }
|
|
|
|
Mod+C { center-column; }
|
|
Mod+Ctrl+C { center-visible-columns; }
|
|
|
|
// Finer width adjustments.
|
|
// This command can also:
|
|
// * set width in pixels: "1000"
|
|
// * adjust width in pixels: "-5" or "+5"
|
|
// * set width as a percentage of screen width: "25%"
|
|
// * adjust width as a percentage of screen width: "-10%" or "+10%"
|
|
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
|
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
|
Mod+Minus { set-column-width "-5%"; }
|
|
Mod+Equal { set-column-width "+5%"; }
|
|
|
|
// Finer height adjustments when in column with other windows.
|
|
Mod+Shift+Minus { set-window-height "-5%"; }
|
|
Mod+Shift+Equal { set-window-height "+5%"; }
|
|
|
|
// Actions to switch layouts.
|
|
// Note: if you uncomment these, make sure you do NOT have
|
|
// a matching layout switch hotkey configured in xkb options above.
|
|
// Having both at once on the same hotkey will break the switching,
|
|
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
|
|
// Mod+Space { switch-layout "next"; }
|
|
// Mod+Shift+Space { switch-layout "prev"; }
|
|
|
|
Print hotkey-overlay-title=null { screenshot; }
|
|
Ctrl+Print { screenshot-screen; }
|
|
Alt+Print { screenshot-window; }
|
|
|
|
// 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; }
|
|
}
|