niri: split configs often being edited.

- unable to split them completely into different parts: some visual effect may not functional.
This commit is contained in:
2025-12-13 23:32:04 +08:00
parent fe4232ec8e
commit 3a1b467e5c
3 changed files with 286 additions and 286 deletions

View File

@@ -173,70 +173,8 @@ animations {
} }
} }
window-rule { include "config.window.kdl"
geometry-corner-radius 6 include "config.keyboard.kdl"
clip-to-geometry true
}
window-rule {
match app-id="QQ"
match app-id="Electron" title="yacd" // Yet Another Clash Daemon (webui)
match app-id="wechat"
match app-id="org.telegram.desktop"
match app-id="nwjs" // mainly for rpgmaker games.
// open-on-output "eDP-1"
block-out-from "screencast"
}
window-rule {
match app-id="com.obsproject.Studio"
match app-id="Electron" title="Test" // frg2089.BiliLive.Observer
match app-id="Electron" title="Blivechat-Openlive" // blivechat
default-column-display "tabbed"
open-on-output "eDP-1"
}
window-rule {
match title="^(图片查看器|.*记录)$" app-id="QQ"
match app-id="pavucontrol-qt"
default-column-width { proportion 0.6; }
default-window-height { proportion 0.85; }
open-floating true
}
window-rule {
match app-id="nwjs"
match app-id="krita"
default-column-width { proportion 0.85; }
default-window-height { proportion 0.9; }
open-floating true
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
match app-id=r#"^org\.kde\.ksecretd$"#
open-floating true
}
window-rule {
match title=r#"Code - OSS$"#
match title=r#"Visual Studio Code$"#
match app-id=r#"^code"#
open-maximized true
}
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="steam" title="Friends List"
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 "waybar"
spawn-at-startup "swww-daemon" spawn-at-startup "swww-daemon"
@@ -264,225 +202,3 @@ prefer-no-csd
screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png" screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png"
// screenshot-path null // screenshot-path null
binds {
Mod+F1 { show-hotkey-overlay; }
Mod+Return hotkey-overlay-title="Terminal (foot)" { spawn "foot"; }
Mod+F9 hotkey-overlay-title="Browser (chrome)" { spawn "ykrun" "google-chrome-stable"; }
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; }
XF86PowerOff hotkey-overlay-title="Exit niri" { quit; }
Super+Escape hotkey-overlay-title="Lock the Screen (gtklock)" { spawn "gtklock" "-d"; }
Mod+Delete hotkey-overlay-title="Lock screen and Hibernate ..." allow-when-locked=true {
spawn-sh "(pgrep gtklock || gtklock -d) && sleep 1 && systemctl hibernate";
}
XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
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-screen; }
Mod+Shift+S { screenshot; }
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; }
}

View File

@@ -0,0 +1,221 @@
binds {
Mod+F1 { show-hotkey-overlay; }
Mod+Return hotkey-overlay-title="Terminal (foot)" { spawn "foot"; }
Mod+F9 hotkey-overlay-title="Browser (chrome)" { spawn "ykrun" "google-chrome-stable"; }
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; }
XF86PowerOff hotkey-overlay-title="Exit niri" { quit; }
Super+Escape hotkey-overlay-title="Lock the Screen (gtklock)" { spawn "gtklock" "-d"; }
Mod+Delete hotkey-overlay-title="Lock screen and Hibernate ..." allow-when-locked=true {
spawn-sh "(pgrep gtklock || gtklock -d) && sleep 1 && systemctl hibernate";
}
XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
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-screen; }
Mod+Shift+S { screenshot; }
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; }
}

View File

@@ -0,0 +1,63 @@
window-rule {
geometry-corner-radius 6
clip-to-geometry true
}
window-rule {
match app-id="QQ"
match app-id="Electron" title="yacd" // Yet Another Clash Daemon (webui)
match app-id="wechat"
match app-id="org.telegram.desktop"
match app-id="nwjs" // mainly for rpgmaker games.
// open-on-output "eDP-1"
block-out-from "screencast"
}
window-rule {
match app-id="com.obsproject.Studio"
match app-id="Electron" title="Test" // frg2089.BiliLive.Observer
match app-id="Electron" title="Blivechat-Openlive" // blivechat
default-column-display "tabbed"
open-on-output "eDP-1"
}
window-rule {
match title="^(图片查看器|.*记录)$" app-id="QQ"
match app-id="pavucontrol-qt"
default-column-width { proportion 0.6; }
default-window-height { proportion 0.85; }
open-floating true
}
window-rule {
match app-id="nwjs"
default-column-width { proportion 0.85; }
default-window-height { proportion 0.9; }
open-floating true
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
match app-id=r#"^org\.kde\.ksecretd$"#
open-floating true
}
window-rule {
// match title=r#"Code - OSS$"#
match title=r#"Visual Studio Code$"# app-id=r#"^code"#
match app-id="krita"
open-maximized true
}
window-rule {
// match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="steam" title="Friends List"
open-floating true
default-floating-position x=8 y=8 relative-to="bottom-right"
open-focused false
open-on-output "eDP-1"
}