From 6c3c722674ae2df8a74fc2dc4329c722165b9512 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 12 Dec 2025 16:53:33 -0500 Subject: [PATCH] niri: add warnings on auto-generated files --- core/internal/config/embedded/niri-alttab.kdl | 5 ++ core/internal/config/embedded/niri-binds.kdl | 5 ++ core/internal/config/embedded/niri-colors.kdl | 5 ++ core/internal/config/embedded/niri-layout.kdl | 5 ++ core/internal/config/embedded/niri.kdl | 49 +++++++++++++++++++ core/internal/keybinds/providers/niri.go | 10 +++- quickshell/Services/NiriService.qml | 11 ++++- quickshell/Services/niri-wpblur.kdl | 5 ++ 8 files changed, 92 insertions(+), 3 deletions(-) diff --git a/core/internal/config/embedded/niri-alttab.kdl b/core/internal/config/embedded/niri-alttab.kdl index 91d83378..5f9bdcd0 100644 --- a/core/internal/config/embedded/niri-alttab.kdl +++ b/core/internal/config/embedded/niri-alttab.kdl @@ -1,3 +1,8 @@ +// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + recent-windows { highlight { corner-radius 12 diff --git a/core/internal/config/embedded/niri-binds.kdl b/core/internal/config/embedded/niri-binds.kdl index 293c70ca..1b08ad7b 100644 --- a/core/internal/config/embedded/niri-binds.kdl +++ b/core/internal/config/embedded/niri-binds.kdl @@ -1,3 +1,8 @@ +// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + binds { // === System & Overview === Mod+D repeat=false { toggle-overview; } diff --git a/core/internal/config/embedded/niri-colors.kdl b/core/internal/config/embedded/niri-colors.kdl index 36ad7f71..4c8a82b8 100644 --- a/core/internal/config/embedded/niri-colors.kdl +++ b/core/internal/config/embedded/niri-colors.kdl @@ -1,3 +1,8 @@ +// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + layout { background-color "transparent" diff --git a/core/internal/config/embedded/niri-layout.kdl b/core/internal/config/embedded/niri-layout.kdl index 36c08f3e..1951500b 100644 --- a/core/internal/config/embedded/niri-layout.kdl +++ b/core/internal/config/embedded/niri-layout.kdl @@ -1,3 +1,8 @@ +// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + layout { gaps 4 diff --git a/core/internal/config/embedded/niri.kdl b/core/internal/config/embedded/niri.kdl index 45512f8d..89df6a18 100644 --- a/core/internal/config/embedded/niri.kdl +++ b/core/internal/config/embedded/niri.kdl @@ -18,15 +18,64 @@ gestures { input { keyboard { xkb { + // You can set rules, model, layout, variant and options. + // For more information, see xkeyboard-config(7). + + // For example: + // layout "us,ru" + // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps" + + // If this section is empty, niri will fetch xkb settings + // from org.freedesktop.locale1. You can control these using + // localectl set-x11-keymap. } + + // Enable numlock on startup, omitting this setting disables it. numlock } + + // Next sections include libinput settings. + // Omitting settings disables them, or leaves them at their default values. + // All commented-out settings here are examples, not defaults. 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 } + 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 + // scroll-button-lock + // middle-emulation } + + // Uncomment this to make the mouse warp to the center of newly focused windows. + // 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="0%" } // You can configure outputs by their name, which you can find // by running `niri msg outputs` while inside a niri instance. diff --git a/core/internal/keybinds/providers/niri.go b/core/internal/keybinds/providers/niri.go index da853625..7bc73653 100644 --- a/core/internal/keybinds/providers/niri.go +++ b/core/internal/keybinds/providers/niri.go @@ -461,9 +461,16 @@ func (n *NiriProvider) getBindSortPriority(action string) int { } } +const dmsWarningHeader = `// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + +` + func (n *NiriProvider) generateBindsContent(binds map[string]*overrideBind) string { if len(binds) == 0 { - return "binds {}\n" + return dmsWarningHeader + "binds {}\n" } var regularBinds, recentWindowsBinds []*overrideBind @@ -490,6 +497,7 @@ func (n *NiriProvider) generateBindsContent(binds map[string]*overrideBind) stri var sb strings.Builder + sb.WriteString(dmsWarningHeader) sb.WriteString("binds {\n") for _, bind := range regularBinds { n.writeBindNode(&sb, bind, " ") diff --git a/quickshell/Services/NiriService.qml b/quickshell/Services/NiriService.qml index 259c48b9..4d89b155 100644 --- a/quickshell/Services/NiriService.qml +++ b/quickshell/Services/NiriService.qml @@ -959,7 +959,14 @@ Singleton { const cornerRadius = typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12; const gaps = typeof SettingsData !== "undefined" ? Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)) : 4; - const configContent = `layout { + const dmsWarning = `// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + +`; + + const configContent = dmsWarning + `layout { gaps ${gaps} border { @@ -977,7 +984,7 @@ window-rule { draw-border-with-background false }`; - const alttabContent = `recent-windows { + const alttabContent = dmsWarning + `recent-windows { highlight { corner-radius ${cornerRadius} } diff --git a/quickshell/Services/niri-wpblur.kdl b/quickshell/Services/niri-wpblur.kdl index 667042fa..3d58802b 100644 --- a/quickshell/Services/niri-wpblur.kdl +++ b/quickshell/Services/niri-wpblur.kdl @@ -1,3 +1,8 @@ +// ! DO NOT EDIT ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! + layer-rule { match namespace="dms:blurwallpaper" place-within-backdrop true