This commit is contained in:
2026-03-31 20:13:15 +08:00
parent 48044e957d
commit 08c513b995
1155 changed files with 79920 additions and 0 deletions

View File

@ -0,0 +1,74 @@
// Animation settings.
// The wiki explains how to configure individual animations:
// https://yalter.github.io/niri/Configuration:-Animations
// https://yalter.github.io/niri/Configuration:-Animations
animations {
// 禁用全部动画
//off
// 总体动画速度,浮点数(带小数点)默认为1小于1加快大于1减慢
slowdown 1.0
// 切换工作区的动画
workspace-switch {
// 具体动画设置代码块里的off可以单独禁用此动画
//off
// spring弹簧动画类型
// damping-ratio 设置阻尼默认1.0仅在触摸板快速滑动时产生回弹小于1.0会产生回弹大于1.0会导致bug。
// stiffness 设置刚度,数值越大动画会越硬越生涩,数值调低更容易产生回弹
// epsilon 当动画运动速度和距离小于这个值的时候会判定动画停止
spring damping-ratio=0.82 stiffness=523 epsilon=0.0001
}
// 左右切换聚焦的动画
horizontal-view-movement {
spring damping-ratio=0.86 stiffness=450 epsilon=0.0001
}
// 打开窗口的动画
window-open {
// 动画时长
duration-ms 150
// 动画曲线
curve "ease-out-expo"
// niri可用的动画曲线
// ease-out-quad 比较平缓的加速-->减速曲线,不明显,算是更生动的线性动画
// ease-out-cubic 较快加速后迅速减速
// ease-out-expo 超快加速后立马减速
// linear 纯线性
// cubic-bezier 自定义动画曲线,通过 curve "cubic-bezier" 0.05 0.7 0.1 1 的方式传入参数使用
// 设计曲线可以使用 https://easings.co/
// 预览预设曲线效果可以看 https://easings.net/
}
// 关闭窗口
window-close {
duration-ms 150
curve "ease-out-quad"
}
// 移动窗口的动画。包括合并列、上下移动窗口、合并/踢出列等。
window-movement {
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
}
// 按照预设调整窗口大小时的动画
window-resize {
spring damping-ratio=1.0 stiffness=750 epsilon=0.0001
}
// 开启截图UI的动画
screenshot-ui-open {
duration-ms 300
curve "ease-out-quad"
}
// 开关overview的动画
overview-open-close {
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
}
}

View File

@ -0,0 +1,266 @@
// 整合版 binds.kdlShorin 核心配置 + DMS 特有功能与媒体控制
binds {
// 显示快捷键教程
Mod+Shift+Slash hotkey-overlay-title="快捷键教程 Keybind tutorial" { spawn "~/.config/niri/scripts/niri-binds"; }
// alt+tab切换窗口
Alt+Tab hotkey-overlay-title="跳转窗口 swich windows" {spawn "qs" "-c" "noctalia-shell" "ipc" "call" "launcher" "windows";}
// 特殊功能
Mod+F1 hotkey-overlay-title="开关输入法 Toggle fcitx" {spawn-sh "pkill fcitx5 || fcitx5 ";}
Mod+F2 hotkey-overlay-title="设置 Settings" { spawn-sh "qs -c noctalia-shell ipc call settings toggle";}
Mod+F3 hotkey-overlay-title="录屏 Screen record" { spawn "shorin" "screenrec";}
Mod+F5 hotkey-overlay-title="快速存档 Quick save" {spawn "quicksave";}
Mod+F8 hotkey-overlay-title="快速读档 Quick load" {spawn "quickload";}
// 临时开一个浮动终端
Mod+Slash hotkey-overlay-title="临时终端 Quick Terminal" {spawn "kitty" "--single-instance" "--class" "quickterminal";}
//打开浏览器
Mod+B hotkey-overlay-title="浏览器 Browser" { spawn "firefox"; }
Mod+T hotkey-overlay-title="终端 Terminal" { spawn "kitty" "--single-instance"; }
// 文档管理器。如果有thunar的话会优先打开thunar没有的话会打开nautilus
Mod+E hotkey-overlay-title="文档管理器 Filemanager" { spawn-sh "thunar || env GSK_RENDERER=gl GTK_IM_MODULE=fcitx nautilus"; }
// 另一个打开nautilus的快捷键主要是为了在同时安装thunar和nautilus的情况下打开naultilus
Mod+Alt+E hotkey-overlay-title=null {spawn "env" "GSK_RENDERER=gl" "GTK_IM_MODULE=fcitx" "nautilus" "--new-window";}
Mod+Z hotkey-overlay-title="程序菜单 Applauncher" { spawn-sh "qs -c noctalia-shell ipc call launcher toggle || fuzzel"; }
// 壁纸选择
Mod+Alt+W hotkey-overlay-title="壁纸切换 Wallpaper" { spawn-sh "qs -c noctalia-shell ipc call wallpaper toggle";}
// 随机切换壁纸
Mod+F10 hotkey-overlay-title="随机切换壁纸 Random wallpaper" { spawn-sh "qs -c noctalia-shell ipc call wallpaper random all";}
// 随机下载壁纸
Mod+Shift+F10 hotkey-overlay-title="随机下载壁纸 Random Download wallpaper" { spawn "~/.local/bin/random-anime-wallpaper-noctalia";}
Mod+O hotkey-overlay-title="切换总览界面 toggle overview" repeat=false { toggle-overview; }
Mod+G repeat=false { toggle-overview; }
// 关闭聚焦窗口
Mod+Q hotkey-overlay-title="关闭聚焦窗口 Close focus window" repeat=false { close-window; }
Alt+F4 hotkey-overlay-title=null repeat=false { close-window; }
// niri-sidebar扩展相关
// 警告:这是实验性功能
// 切换 移动聚焦窗口至侧边栏 建议配合切换浮动聚焦的快捷键使用我设置的是super+n
Mod+Alt+S hotkey-overlay-title="收起窗口 Move to Sidebar" { spawn "niri-sidebar" "toggle-window"; }
Mod+M hotkey-overlay-title="收起窗口 Move to Sidebar" { spawn "niri-sidebar" "toggle-window"; }
// 切换 收起/展开侧边栏
Mod+Alt+Z hotkey-overlay-title="展开/收起侧边栏 Toggle Sidebar" { spawn "niri-sidebar" "toggle-visibility";}
// 反向排序侧边栏
Mod+Alt+X hotkey-overlay-title=null { spawn "niri-sidebar" "flip";}
// 重新排列侧边栏中的窗口(侧边栏中的窗口本质是一个浮动窗口,你有时候可能会把它移动到别的地方
// 例如 ctrl+c居中。此时按下此键可以重新排列
Mod+Alt+R hotkey-overlay-title="重置侧边栏 Reorder Sidebar" { spawn "niri-sidebar" "reorder"; }
// mod+鼠标中键 关闭窗口
Mod+MouseMiddle { close-window; }
// 切换聚焦
// super+方向键
Mod+Left hotkey-overlay-title=null { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
// super+vim key
Mod+H { focus-column-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
// 移动colume
// super+ctrl+方向键
Mod+Ctrl+Left hotkey-overlay-title=null { move-column-left; }
Mod+Ctrl+Right hotkey-overlay-title=null { move-column-right; }
// super+ctrl+vimkey
Mod+Ctrl+H { move-column-left; }
Mod+Ctrl+J { move-window-down; }
Mod+Ctrl+K { move-window-up; }
Mod+Ctrl+L { move-column-right; }
// super+ctrl+a/d 向左/右移动列
Mod+Ctrl+A { move-column-left; }
Mod+Ctrl+D { move-column-right; }
// mod+S/W 上下切换窗口
Mod+S { move-window-down; }
Mod+W { move-window-up; }
// 切换到第一个colume
Mod+Home { focus-column-first; }
// 切换到最后一个colume
Mod+End { focus-column-last; }
// 移动colume到第一个
Mod+Ctrl+Home { move-column-to-first; }
// 移动colume到最后一个
Mod+Ctrl+End { move-column-to-last; }
// 切换显示器聚焦
// mod+shift+方向键
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+vimkey
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+J { focus-monitor-down; }
Mod+Shift+K { focus-monitor-up; }
Mod+Shift+L { focus-monitor-right; }
// 跨显示器移动colume
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; }
Mod+Shift+Ctrl+A { move-column-to-monitor-left; }
Mod+Shift+Ctrl+S { move-column-to-monitor-down; }
Mod+Shift+Ctrl+W { move-column-to-monitor-up; }
Mod+Shift+Ctrl+D { move-column-to-monitor-right; }
// 移动整个工作区
// mod+shift跨显示器alt代表移动整个工作区再加上三组方向键
Mod+Shift+Alt+W { move-workspace-to-monitor-up; }
Mod+Shift+Alt+S { move-workspace-to-monitor-down; }
Mod+Shift+Alt+D { move-workspace-to-monitor-right; }
Mod+Shift+Alt+A { move-workspace-to-monitor-left; }
Mod+Shift+Alt+K { move-workspace-to-monitor-up; }
Mod+Shift+Alt+J { move-workspace-to-monitor-down; }
Mod+Shift+Alt+L { move-workspace-to-monitor-right; }
Mod+Shift+Alt+H { move-workspace-to-monitor-left; }
Mod+Shift+Alt+Up { move-workspace-to-monitor-up; }
Mod+Shift+Alt+Down { move-workspace-to-monitor-down; }
Mod+Shift+Alt+Right { move-workspace-to-monitor-right; }
Mod+Shift+Alt+Left { move-workspace-to-monitor-left; }
// mod+shitf+滚轮上下切换工作区
Mod+Shift+WheelScrollDown hotkey-overlay-title="切换工作区 Change workspaces" cooldown-ms=150 { focus-workspace-down; }
Mod+Shift+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
//再加上ctrl移动窗口
Mod+Ctrl+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
// mod+滚轮上下 左右切换聚焦
Mod+WheelScrollDown hotkey-overlay-title="滚轮切换聚焦 Change focus with wheel" { focus-column-right; }
Mod+WheelScrollUp { focus-column-left; }
// 再加上ctrl移动colume
Mod+Ctrl+WheelScrollDown { move-column-right; }
Mod+Ctrl+WheelScrollUp { move-column-left; }
// mod+左右方括号 移动窗口不是移动colume是允许移动到另一个colume的窗口移动
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
// mod+A/D 同效果
Mod+A hotkey-overlay-title="向左移动窗口 Move window to left between columes" { consume-or-expel-window-left; }
Mod+D hotkey-overlay-title="向右移动窗口 Move window to right between columes" { consume-or-expel-window-right; }
// mod+逗号/句号 把窗口合并或者踢出当前的colume
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
// mod+shift+A/D 同效果
Mod+Shift+A { consume-window-into-column; }
Mod+Shift+D { expel-window-from-column; }
// 开启colume的标签页模式
Mod+Shift+X { toggle-column-tabbed-display; }
//Mod+X { toggle-column-tabbed-display; }
// mod+鼠标侧键 上下切换聚焦
Mod+MouseForward { focus-window-up; }
Mod+MouseBack { focus-window-down; }
// 按照预设切换窗口宽度
Mod+R hotkey-overlay-title="按预设切换宽度 Switch width " { switch-preset-column-width; }
// 按照预设切换窗口高度
Mod+Shift+R { switch-preset-window-height; }
// 重置窗口高度
Mod+Ctrl+R { reset-window-height; }
Mod+F hotkey-overlay-title="最大化 maximize" { maximize-column; }
Mod+Alt+F hotkey-overlay-title="全屏 fullscreen" { fullscreen-window; }
// 增加窗口宽度占满空闲空间
Mod+Ctrl+F { expand-column-to-available-width; }
// 居中当前聚焦的colume
Mod+C { center-column; }
Mod+Ctrl+C { center-visible-columns; }
// mod+加减号调整窗口宽度
Mod+Minus { set-column-width "-5%"; }
Mod+Equal { set-column-width "+5%"; }
// mod+shift+加减号调整窗口高度
Mod+Shift+Minus { set-window-height "-5%"; }
Mod+Shift+Equal { set-window-height "+5%"; }
// 切换浮动模式
Mod+V hotkey-overlay-title="切换浮动 Toggle floating" { toggle-window-floating; }
// 在浮动模式和非浮动模式之间切换聚焦
Mod+Shift+V hotkey-overlay-title=null { switch-focus-between-floating-and-tiling; }
Mod+N hotkey-overlay-title="切换浮动聚焦 Change focus to floating" { switch-focus-between-floating-and-tiling; }
Alt+grave hotkey-overlay-title=null { switch-focus-between-floating-and-tiling; }
Mod+Alt+N hotkey-overlay-title=null { switch-focus-between-floating-and-tiling; }
// 截图相关
Mod+Alt+A hotkey-overlay-title="选取区域截图 Select screenshot" {spawn-sh "niri msg action screenshot --show-pointer false && pkill -f -USR1 screenshot-sound.sh";}
Mod+Alt+Ctrl+A hotkey-overlay-title="截取聚焦窗口 Focus-window screenshot" { spawn-sh "niri msg action screenshot-window && pkill -f -USR1 screenshot-sound.sh"; }
Mod+Alt+Ctrl+Shift+A hotkey-overlay-title="截取显示器 Monitor screenshot" { spawn-sh "niri msg action screenshot-screen --show-pointer false && pkill -f -USR1 screenshot-sound.sh"; }
Print hotkey-overlay-title=null {spawn-sh "niri msg action screenshot --show-pointer false && pkill -f -USR1 screenshot-sound.sh";}
Ctrl+Print hotkey-overlay-title=null { spawn-sh "niri msg action screenshot-window --show-pointer false && pkill -f -USR1 screenshot-sound.sh"; }
Shift+Print hotkey-overlay-title=null { spawn-sh "niri msg action screenshot-screen --show-pointer false && pkill -f -USR1 screenshot-sound.sh"; }
Mod+Shift+S hotkey-overlay-title="截图后按下此键进行编辑 Edit the image after screenshot" { spawn-sh "wl-paste | satty -f -";}
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
Mod+Shift+E hotkey-overlay-title="退出niri Quit niri" { quit; }
// 电源菜单
Mod+P hotkey-overlay-title="电源菜单 powermenu" {spawn "qs" "-c" "noctalia-shell" "ipc" "call" "sessionMenu" "toggle";}
// 剪贴板
Mod+Alt+V hotkey-overlay-title="剪贴板 Clipboard" {spawn-sh "qs -c noctalia-shell ipc call launcher clipboard";}
// 锁屏
Mod+Alt+L hotkey-overlay-title="锁屏 Lock Screen" {spawn "qs" "-c" "noctalia-shell" "ipc" "call" "lockScreen" "lock"; }
// 锁屏、关闭显示器、休眠
Mod+Alt+P hotkey-overlay-title="挂起 Suspend" { spawn-sh "niri msg action power-off-monitors && qs -c noctalia-shell ipc call lockScreen lock && systemctl suspend";}
// === 媒体控制 ===
XF86AudioRaiseVolume { spawn "qs" "-c" "noctalia-shell" "ipc" "call" "volume" "increase"; }
XF86AudioLowerVolume { spawn "qs" "-c" "noctalia-shell" "ipc" "call" "volume" "decrease"; }
XF86AudioMute { spawn "qs" "-c" "noctalia-shell" "ipc" "call" "volume" "muteOutput"; }
XF86MonBrightnessUp { spawn "qs" "-c" "noctalia-shell" "ipc" "call" "brightness" "increase"; }
XF86MonBrightnessDown { spawn "qs" "-c" "noctalia-shell" "ipc" "call" "brightness" "decrease"; }
// === 工作区导航补充 (无冲突项) ===
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Shift+U { move-workspace-down; }
Mod+Shift+I { move-workspace-up; }
// === 数字工作区 (1-9) ===
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+Ctrl+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; }
Mod+Ctrl+5 { move-column-to-workspace 5; }
Mod+Ctrl+6 { move-column-to-workspace 6; }
Mod+Ctrl+7 { move-column-to-workspace 7; }
Mod+Ctrl+8 { move-column-to-workspace 8; }
Mod+Ctrl+9 { move-column-to-workspace 9; }
}

View File

@ -0,0 +1,112 @@
// ██████ ██ ██ ██████ ███████ ██ ███ ██
// ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
// ███████ ███████ ██ ██ ██████ ██ ██ ██ ██
// ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
// ██████ ██ ██ ██████ ██ ██ ██ ██ ████
// 截图保存位置
screenshot-path "~/Pictures/Screenshots/Niri-screenshots/%Y-%m-%d_%H-%M-%S.png"
// 环境变量
environment {
//LC_CTYPE "zh_CN.UTF-8" 会导致输入法出现漏字
//LC_MESSAGES "zh_CN.UTF-8" 让系统全局使用英文,仅主要界面为英文时使用这个环境变量
// 设置界面语言
LANGUAGE "zh_CN.UTF-8"
LANG "zh_CN.UTF-8"
LC_CTYPE "en_US.UTF-8" //这一项可以解决漏字问题但是也许会导致steam之类的x11应用无法使用中文输入法
// 输入法环境变量
XMODIFIERS "@im=fcitx"
// qt主题
QT_QPA_PLATFORMTHEME "gtk3"
QT_QPA_PLATFORMTHEME_QT6 "gtk3"
// 解决quickshell图标主题缺失问题
QS_ICON_THEME "Adwaita"
// GTK软件使用的渲染器可以解决n卡双显卡导致的GTK应用启动缓慢问题AMD或Intel单显卡不需要这行设置可以注释掉
//GSK_RENDERER "gl"
// 默认文本编辑器
EDITOR "vim"
}
input {
keyboard {
xkb {
}
}
touchpad {
// off
tap
// dwt
// dwtp
// drag false
// drag-lock
// nautural-scroll可以翻转触摸板滚动的方向
natural-scroll
//accel-speed -0.5
// accel-profile "flat"
// scroll-method "two-finger"
// disabled-on-external-mouse
}
mouse {
// off
// natural-scroll
// 鼠标速度
accel-speed -0.15
// 禁用鼠标加速
accel-profile "flat"
// scroll-method "no-scroll"
//speed of scroll,like:
//scroll-factor horizontal=2.0 vertical=-5.0
}
trackpoint {
// off
// natural-scroll
// accel-speed 0.2
// accel-profile "flat"
// scroll-method "on-button-down"
// scroll-button 273
// scroll-button-lock
// middle-emulation
}
}
// 自动启动
spawn-sh-at-startup "qs -c noctalia-shell"
// 询问管理员权限功能(身份验证)
spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
spawn-sh-at-startup "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=niri & /usr/lib/xdg-desktop-portal-gnome"
// GNOME tracker修复
spawn-sh-at-startup "systemctl --user set-environment XDG_SESSION_CLASS=user"
// 输入法
spawn-at-startup "fcitx5"
// 截图音效的守护进程
spawn-at-startup "~/.config/niri/scripts/screenshot-sound.sh"
// 允许root通过用户的xwayland打开窗口
spawn-at-startup "xhost" "+si:localuser:root"
// 开启时自动随机更换一次壁纸
spawn-sh-at-startup "sleep 3 && qs -c noctalia-shell ipc call wallpaper random all"
// 取消启动niri时自动开启快捷键教程
hotkey-overlay {
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
skip-at-startup
}
// 隐藏窗口标题栏
prefer-no-csd
include "layout.kdl"
include "animations.kdl"
include "binds.kdl"
include "supertab.kdl"
include "windowrules.kdl"
include "cursor.kdl"
include "outputs.kdl"
include "./noctalia.kdl"

View File

@ -0,0 +1,10 @@
// 光标配置
cursor {
// 主题,存放路径在~/.local/share/icons
xcursor-theme "breeze_cursors"
// 大小
xcursor-size 30
// 闲置多少毫秒自动隐藏光标
hide-after-inactive-ms 15000
}

View File

@ -0,0 +1,160 @@
layout {
//设置工作区背景颜色
//background-color "transparent"
// Set gaps around windows in logical pixels.
// 窗口和窗口之间的间距
gaps 10
//empty-workspace-above-first
// When to center a column when changing focus, options are:
// - "never", default behavior, focusing an off-screen column will keep at the left
// or right edge of the screen.
// - "always", the focused column will always be centered.
// - "on-overflow", focusing a column will center it if it doesn't fit
// together with the previously focused column.
center-focused-column "never"
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
// 预设窗口宽度
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.66667
// Fixed sets the width in logical pixels exactly.
// fixed 1920
}
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
// preset-window-heights { }
// You can change the default width of the new windows.
// 默认的窗口宽度
default-column-width { proportion 0.5; }
// If you leave the brackets empty, the windows themselves will decide their initial width.
// default-column-width {}
// 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 {
// Uncomment this line to disable the focus ring.
// off
// How many logical pixels the ring extends out from the windows.
width 2
// Colors can be set in a variety of ways:
// - CSS named colors: "red"
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
//active-color "@primary"
//active-color "#00000000"
// Color of the ring on inactive monitors.
//
// The focus ring only draws around the active window, so the only place
// where you can see its inactive-color is on other monitors.
//inactive-color "#505050"
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
// The angle is the same as in linear-gradient, and is optional,
// defaulting to 180 (top-to-bottom gradient).
// You can use any CSS linear-gradient tool on the web to set these up.
// Changing the color space is also supported, check the wiki for more info.
//
// active-gradient from="#80c8ff" to="#c7ff7f" angle=45
// You can also color the gradient relative to the entire view
// of the workspace, rather than relative to just the window itself.
// To do that, set relative-to="workspace-view".
//
//inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can also add a border. It's similar to the focus ring, but always visible.
// 窗口边框
border {
// The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring.
off
width 4
active-color "#ffc87f"
inactive-color "#505050"
// Color of the border around windows that request your attention.
urgent-color "#9b0000"
// Gradients can use a few different interpolation color spaces.
// For example, this is a pastel rainbow gradient via in="oklch longer hue".
//
// active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue"
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can enable drop shadows for windows.
// 阴影
shadow {
// Uncomment the next line to enable shadows.
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.
//
// Note that niri has no way of knowing about the CSD window corner
// radius. It has to assume that windows have square corners, leading to
// shadow artifacts inside the CSD rounded corners. This setting fixes
// those artifacts.
//
// However, instead you may want to set prefer-no-csd and/or
// geometry-corner-radius. Then, niri will know the corner radius and
// draw the shadow correctly, without having to draw it behind the
// window. These will also remove client-side shadows if the window
// draws any.
//
//draw-behind-window true
// You can change how shadows look. The values below are in logical
// pixels and match the CSS box-shadow properties.
// Softness controls the shadow blur radius.
softness 20
// Spread expands the shadow.
spread 2
// Offset moves the shadow relative to the window.
offset x=-4 y=-4
// You can also change the shadow color and opacity.
color "rgba(0, 0, 0, 0.7)"
}
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
// You can think of them as a kind of outer gaps. They are set in logical pixels.
// Left and right struts will cause the next window to the side to always be visible.
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
// layer-shell panels and regular gaps.
//窗口距离屏幕边缘的距离
struts {
//left 64
// right 64
// top 64
// bottom 64
}
}

View File

@ -0,0 +1,35 @@
layout {
focus-ring {
active-color "#bec2ff"
inactive-color "#131316"
urgent-color "#ffb4ab"
}
border {
active-color "#bec2ff"
inactive-color "#131316"
urgent-color "#ffb4ab"
}
shadow {
color "#00000070"
}
tab-indicator {
active-color "#bec2ff"
inactive-color "#373e90"
urgent-color "#ffb4ab"
}
insert-hint {
color "#bec2ff80"
}
}
recent-windows {
highlight {
active-color "#bec2ff"
urgent-color "#ffb4ab"
}
}

View File

@ -0,0 +1,10 @@
// 这是显示器设置
// 运行niri msg outputs可以获取显示器信息
// 以下是一个配置示例
/-output "eDP-1"{
// off
mode "2560x1440@165"
scale 1.3
position x=0 y=0
focus-at-startup
}

View File

@ -0,0 +1,58 @@
#!/usr/bin/env bash
NIRI_DIR="$HOME/.config/niri"
# === 界面尺寸设置 (在这里微调,下方的所有终端会自动应用) ===
MENU_WIDTH=90
MENU_HEIGHT=20
# 检查目录
if [[ ! -d "$NIRI_DIR" ]]; then
echo "Error: 找不到配置目录 $NIRI_DIR"
exit 1
fi
# 提取并使用 column 对齐
MENU_ITEMS=$(grep -Rh 'hotkey-overlay-title=' "$NIRI_DIR" --include="*.kdl" | \
grep -v '^[ \t]*//' | \
sed -n -E 's/^[ \t]*(.*)[ \t]+hotkey-overlay-title="([^"]+)".*/\1|\2/p' | \
sed -E 's/[ \t]*\|/\|/' | \
column -t -s '|')
if [[ -z "$MENU_ITEMS" ]]; then
echo "没有找到有效的快捷键配置。"
exit 1
fi
# Fzf 核心命令
FZF_CMD="echo \"$MENU_ITEMS\" | fzf --reverse --prompt='󰌌 快捷键: ' --info=hidden --border=none > /dev/null"
# 动态检测终端并使用对应的参数启动
if command -v kitty >/dev/null 2>&1; then
kitty --class "niri-hotkey-menu" --title "快捷键菜单" \
-o remember_window_size=no -o initial_window_width=${MENU_WIDTH}c -o initial_window_height=${MENU_HEIGHT}c \
bash -c "$FZF_CMD"
elif command -v foot >/dev/null 2>&1; then
foot --app-id "niri-hotkey-menu" --title "快捷键菜单" \
--window-size-chars=${MENU_WIDTH}x${MENU_HEIGHT} \
bash -c "$FZF_CMD"
elif command -v alacritty >/dev/null 2>&1; then
alacritty --class "niri-hotkey-menu" --title "快捷键菜单" \
-o window.dimensions.columns=${MENU_WIDTH} -o window.dimensions.lines=${MENU_HEIGHT} \
-e bash -c "$FZF_CMD"
elif command -v wezterm >/dev/null 2>&1; then
wezterm start --class "niri-hotkey-menu" -- bash -c "$FZF_CMD"
elif [[ -n "$TERMINAL" ]]; then
$TERMINAL -e bash -c "$FZF_CMD"
else
echo "Error: 未检测到支持的终端模拟器。"
if command -v fuzzel >/dev/null 2>&1; then
# Fuzzel 降级方案也会自动读取顶层变量
echo "$MENU_ITEMS" | fuzzel --dmenu -i -p "󰌌 快捷键: " -w ${MENU_WIDTH} > /dev/null
fi
fi

View File

@ -0,0 +1,72 @@
#!/bin/bash
# =================配置区域=================
SOUND="/usr/share/sounds/freedesktop/stereo/camera-shutter.oga"
# 这是一个“扳机”文件,存于内存中 (/dev/shm),读写极快
TRIGGER_FILE="/dev/shm/niri_screenshot_armed"
# 有效期:按下截图键后,多少秒内产生了图片才响?(防止你取消截图后,下次复制图片误响)
TIMEOUT_SEC=15
# =========================================
# 环境检查
if ! command -v pw-play >/dev/null; then
notify-send "错误: 未找到 pw-play"
exit 1
fi
# =========================================
# 1. 定义信号处理 (收到信号 = 上膛)
# =========================================
arm_trigger() {
# 更新文件的修改时间,或者创建它
touch "$TRIGGER_FILE"
}
# 注册信号:收到 USR1 就执行 arm_trigger
trap arm_trigger SIGUSR1
# =========================================
# 2. 启动剪贴板监听 (后台运行)
# =========================================
# 只有当剪贴板真正发生变化时,这个子进程才会醒来
wl-paste --watch bash -c "
# A. 检查是不是图片
if wl-paste --list-types 2>/dev/null | grep -q 'image/'; then
# B. 检查有没有“上膛” (文件是否存在)
if [ -f \"$TRIGGER_FILE\" ]; then
# C. 检查“上膛”是否过期 (利用文件修改时间)
# $(date +%s) - stat获取的时间
NOW=\$(date +%s)
FILE_TIME=\$(stat -c %Y \"$TRIGGER_FILE\")
DIFF=\$((NOW - FILE_TIME))
if [ \$DIFF -lt $TIMEOUT_SEC ]; then
# 조건을 满足:是图片 + 已上膛 + 没过期
pw-play \"$SOUND\" &
# D. 销毁扳机 (防止连响)
rm -f \"$TRIGGER_FILE\"
fi
fi
fi
" &
# 获取 wl-paste 的 PID以便脚本退出时杀掉它
WATCHER_PID=$!
# =========================================
# 3. 守护进程主循环 (0 CPU 占用)
# =========================================
# 这里的 trap 负责在脚本退出时清理子进程
trap "kill $WATCHER_PID; exit" INT TERM EXIT
# 写入当前 PID 方便调试 (可选)
# echo $$ > /tmp/niri-sound.pid
echo "截图音效服务已启动,等待 SIGUSR1 信号..."
# 无限睡眠,只响应信号
while true; do
sleep infinity & wait $!
done

View File

@ -0,0 +1,30 @@
// 带缩略图的alt+tab切换窗口功能但是我设置的是super+tab更符合逻辑
recent-windows {
// 取消//off的注释可以禁用
// off
debounce-ms 750
open-delay-ms 150
highlight {
// 缩略图背景内间距
padding 30
// 缩略图的背景圆角
corner-radius 12
}
//设置缩略图大小
previews {
max-height 480
max-scale 0.2
}
binds {
// scope可以设置显示的窗口是当前工作区的、还是当前显示器的、或者显示全部窗口
Mod+Tab { next-window scope="workspace"; }
Mod+Shift+Tab { previous-window scope="workspace"; }
// grave是波浪键显示当前应用的所有窗口
Mod+grave { next-window filter="app-id"; }
Mod+Shift+grave { previous-window filter="app-id"; }
}
}

View File

@ -0,0 +1,175 @@
// 全局窗口规则
window-rule {
// 这一行规则可以让niri变成传统桌面那样的堆叠式桌面。
//open-floating true
// 圆角
geometry-corner-radius 8
// 去掉超出圆角的窗口内容
clip-to-geometry true
// 全局透明度
//opacity 0.99
// 禁止边框画到背景里
draw-border-with-background false
}
// Set the overview wallpaper on the backdrop.
layer-rule {
match namespace="^noctalia-overview*"
place-within-backdrop true
}
// 以浮动模式打开imv一个轻量化图片预览程序且不自动聚焦
window-rule {
match app-id="imv"
open-floating true
}
// steam 好友列表
window-rule {
match app-id="steam" title="Friends List"
match app-id="steam" title="好友列表"
default-column-width { proportion 0.20; }
}
//shorinclip剪贴板TUI
window-rule {
match app-id="shorinclip"
default-column-width { fixed 625; }
default-window-height { fixed 700; }
//min-height 800
open-floating true
default-floating-position x=0 y=18 relative-to="top"
}
// 以浮动模式打开的软件
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="com.gabm.satty"
match app-id="media_info"
match app-id="video2gif"
match app-id="floating-term"
match app-id="nm-connection-editor"
match app-id="niri-quick-switch"
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="steam" title="Friends List"
match app-id="blueberry.py" title="蓝牙"
match app-id="blueman-manager"
match app-id="flameshot"
match app-id="com.github.hluk.copyq"
match app-id="be.alexandervanhee.gradia"
match app-id="org.pulseaudio.pavucontrol" title="音量控制"
match app-id="org.gnome.clocks" title="时钟"
match app-id="fcitx" title="Fcitx5 Input Window"
match app-id="org.gnome.FileRoller"
match app-id="thunar" title="文件操作进度"
match app-id="waypaper"
match app-id="clipse-gui"
match title="群聊的聊天记录"
match title="聊天记录"
match title="日历"
match title="重命名"
match app-id="btrfs-assistant"
match app-id="markpix"
match title="Steam 设置"
match title="另存为"
match app-id="better_control.py"
match app-id="niri-hotkey-menu"
open-floating true
}
//快速终端和笔记
window-rule {
match app-id="quickterminal"
open-floating true
default-floating-position x=20 y=20 relative-to="top"
}
window-rule {
match app-id="bluetui"
match app-id="impala"
default-column-width { fixed 800; }
default-window-height { fixed 800; }
open-floating true
}
window-rule {
match app-id="clipse"
default-column-width { fixed 625; }
default-window-height { fixed 700; }
open-floating true
}
// waydroid调整
window-rule {
match title="gsr ui"
match app-id="waydroid"
open-fullscreen true
open-floating true
focus-ring {
off
}
shadow {
off
}
}
// 取消图片预览、视频播放器之类的透明度,并且以浮动模式打开
window-rule {
match title="图片查看器"
match title="画中画"
match title="图片和视频"
match title="视频播放器"
open-floating true
opacity 1.0
}
window-rule {
match app-id="mpv"
match app-id="celluloid"
opacity 1.0
}
// 默认窗口规则
window-rule {
// This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
window-rule {
match app-id=r#"^org\.gnome\."#
draw-border-with-background false
geometry-corner-radius 12
clip-to-geometry true
}
window-rule {
match app-id=r#"^gnome-control-center$"#
match app-id=r#"^pavucontrol$"#
match app-id=r#"^nm-connection-editor$"#
default-column-width { proportion 0.5; }
open-floating false
}
window-rule {
match app-id=r#"^gnome-calculator$"#
match app-id=r#"^galculator$"#
match app-id=r#"^blueman-manager$"#
match app-id=r#"^xdg-desktop-portal$"#
open-floating true
}
window-rule {
match app-id=r#"^steam$"# title=r#"^notificationtoasts_\d+_desktop$"#
default-floating-position x=10 y=10 relative-to="bottom-right"
open-focused false
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
match app-id="Alacritty"
match app-id="zen"
match app-id="com.mitchellh.ghostty"
match app-id="kitty"
draw-border-with-background false
}
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="zoom"
open-floating true
}
// Open dms windows as floating by default
window-rule {
match app-id=r#"org.quickshell$"#
open-floating true
}