Skip to content

Commit 374592b

Browse files
authored
Updated for niri 25.08 (#84)
1 parent 04e203b commit 374592b

File tree

2 files changed

+65
-34
lines changed

2 files changed

+65
-34
lines changed

configurations/lxqt-niri.kdl

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
// Default niri config (v25.05) with some additions and modifications
1+
// Default niri config (v25.08) with some additions and modifications
22
// for LXQt. You may find a more recent version in
33
// /usr/share/doc/niri/default-config.kdl.
44
// This config is in the KDL format: https://kdl.dev
55
// "/-" comments out the following node.
66
// Check the wiki for a full description of the configuration:
7-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
7+
// https://yalter.github.io/niri/Configuration:-Introduction
88

99

1010
// Input device configuration.
1111
// Find the full list of options on the wiki:
12-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
12+
// https://yalter.github.io/niri/Configuration:-Input
1313
input {
1414
keyboard {
1515
xkb {
1616
// You can set rules, model, layout, variant and options.
1717
// For more information, see xkeyboard-config(7).
1818

19-
// For example: layout "us,es"
20-
layout "us"
19+
// For example:
20+
// layout "us,ru"
2121
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
22+
23+
// If this section is empty, niri will fetch xkb settings
24+
// from org.freedesktop.locale1. You can control these using
25+
// localectl set-x11-keymap.
2226
}
2327

2428
// Enable numlock on startup, omitting this setting disables it.
@@ -27,6 +31,7 @@ input {
2731

2832
// Next sections include libinput settings.
2933
// Omitting settings disables them, or leaves them at their default values.
34+
// All commented-out settings here are examples, not defaults.
3035
touchpad {
3136
// off
3237
tap
@@ -56,6 +61,7 @@ input {
5661
// accel-profile "flat"
5762
// scroll-method "on-button-down"
5863
// scroll-button 273
64+
// scroll-button-lock
5965
// middle-emulation
6066
}
6167

@@ -71,7 +77,7 @@ input {
7177
// by running `niri msg outputs` while inside a niri instance.
7278
// The built-in laptop monitor is usually called "eDP-1".
7379
// Find more information on the wiki:
74-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
80+
// https://yalter.github.io/niri/Configuration:-Outputs
7581
// Remember to uncomment the node by removing "/-"!
7682
/-output "eDP-1" {
7783
// Uncomment this line to disable this output.
@@ -106,7 +112,7 @@ input {
106112

107113
// Settings that influence how windows are positioned and sized.
108114
// Find more information on the wiki:
109-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
115+
// https://yalter.github.io/niri/Configuration:-Layout
110116
layout {
111117
// Set gaps around windows in logical pixels.
112118
gaps 16
@@ -168,6 +174,9 @@ layout {
168174
active-color "#7fc8ff"
169175

170176
// Color of the ring on inactive monitors.
177+
//
178+
// The focus ring only draws around the active window, so the only place
179+
// where you can see its inactive-color is on other monitors.
171180
inactive-color "#505050"
172181

173182
// You can also use gradients. They take precedence over solid colors.
@@ -177,7 +186,7 @@ layout {
177186
// You can use any CSS linear-gradient tool on the web to set these up.
178187
// Changing the color space is also supported, check the wiki for more info.
179188
//
180-
// active-gradient from="#80c8ff" to="#bbddff" angle=45
189+
// active-gradient from="#80c8ff" to="#c7ff7f" angle=45
181190

182191
// You can also color the gradient relative to the entire view
183192
// of the workspace, rather than relative to just the window itself.
@@ -199,7 +208,11 @@ layout {
199208
// Color of the border around windows that request your attention.
200209
urgent-color "#9b0000"
201210

202-
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
211+
// Gradients can use a few different interpolation color spaces.
212+
// For example, this is a pastel rainbow gradient via in="oklch longer hue".
213+
//
214+
// active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue"
215+
203216
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
204217
}
205218

@@ -255,11 +268,21 @@ layout {
255268
}
256269

257270
// Add lines like this to spawn processes at startup.
258-
// Note that running niri as a session supports xdg-desktop-autostart,
271+
// Note that running niri with LXQt session supports xdg-desktop-autostart,
259272
// which may be more convenient to use.
273+
// Applications spawned by niri won't be handled by lxqt-session therefor using "Session Settings
274+
// → Autostart" is recommended.
260275
// See the binds section below for more spawn examples.
261-
// spawn-at-startup "alacritty" "-e" "fish"
262-
spawn-at-startup "sh" "-c" "lxqt-session && niri msg action quit -s"
276+
// spawn-at-startup "waybar"
277+
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
278+
spawn-sh-at-startup "swaybg -i /usr/share/lxqt/wallpapers/waves-logo.png"
279+
// The above sets the wallpaper for the overview.
280+
spawn-sh-at-startup "lxqt-session && niri msg action quit -s"
281+
282+
hotkey-overlay {
283+
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
284+
// skip-at-startup
285+
}
263286

264287
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
265288
// If the client will specifically ask for CSD, the request will be honored.
@@ -278,7 +301,7 @@ screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
278301

279302
// Animation settings.
280303
// The wiki explains how to configure individual animations:
281-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
304+
// https://yalter.github.io/niri/Configuration:-Animations
282305
animations {
283306
// Uncomment to turn off all animations.
284307
// off
@@ -289,7 +312,7 @@ animations {
289312

290313
// Window rules let you adjust behavior for individual windows.
291314
// Find more information on the wiki:
292-
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
315+
// https://yalter.github.io/niri/Configuration:-Window-Rules
293316

294317
// Work around WezTerm's initial configure bug
295318
// by setting an empty default-column-width.
@@ -316,6 +339,12 @@ window-rule {
316339
open-floating true
317340
}
318341

342+
// Use wallpaper set with swaybg for the overview background
343+
layer-rule {
344+
match namespace="^wallpaper$"
345+
place-within-backdrop true
346+
}
347+
319348
// Example: block out two password managers from screen capture.
320349
// (This example rule is commented out with a "/-" in front.)
321350
/-window-rule {
@@ -349,35 +378,39 @@ binds {
349378
// shows a list of important hotkeys.
350379
Mod+Shift+A { show-hotkey-overlay; }
351380

381+
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc.
382+
// Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`.
383+
// For example, this is a standard bind to toggle the screen reader (orca).
384+
// Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; }
385+
352386
// Suggested binds for running programs: terminal, app launcher, screen locker.
353387
Mod+T hotkey-overlay-title="QTerminal" { spawn "qterminal"; }
354-
F12 hotkey-overlay-title="Dropdown QTerminal" { spawn "qterminal" "-d"; }
388+
F12 hotkey-overlay-title="Dropdown QTerminal" { spawn-sh "qterminal -d"; }
355389
Alt+Space hotkey-overlay-title="lxqt-runner" { spawn "lxqt-runner"; }
356390
Mod+P hotkey-overlay-title="Filemanager" { spawn "pcmanfm-qt"; }
357391
Super+Alt+L hotkey-overlay-title="Exit Options" { spawn "lxqt-leave"; }
358-
Super+Shift+Escape hotkey-overlay-title="Lock Screen" { spawn "lxqt-leave" "--lockscreen"; }
359-
360-
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
361-
// Note: the entire command goes as a single argument in the end.
362-
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
392+
Super+Shift+Escape hotkey-overlay-title="Lock Screen" { spawn-sh "lxqt-leave --lockscreen"; }
363393

364394
// Example volume keys mappings for PipeWire & WirePlumber.
365395
// The allow-when-locked=true property makes them work even when the session is locked.
366-
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
367-
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
368-
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
369-
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
396+
// Using spawn-sh allows to pass multiple arguments together with the command.
397+
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
398+
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
399+
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
400+
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
370401

371402
// Brightness
372-
XF86MonBrightnessUp { spawn "lxqt-config-brightness" "-i"; }
373-
XF86MonBrightnessDown { spawn "lxqt-config-brightness" "-d"; }
403+
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
404+
// but you need to manually put each argument in separate "" quotes.
405+
XF86MonBrightnessUp allow-when-locked=true { spawn-sh "lxqt-config-brightness i"; }
406+
XF86MonBrightnessDown allow-when-locked=true { spawn-sh "lxqt-config-brightness -d"; }
374407

375408
// Open/close the Overview: a zoomed-out view of workspaces and windows.
376409
// You can also move the mouse into the top-left hot corner,
377410
// or do a four-finger swipe up on a touchpad.
378411
Mod+O repeat=false { toggle-overview; }
379412

380-
Mod+Q { close-window; }
413+
Mod+Q repeat=false { close-window; }
381414

382415
Mod+Left { focus-column-left; }
383416
Mod+Down { focus-window-down; }
@@ -482,8 +515,8 @@ binds {
482515
// These binds are also affected by touchpad's natural-scroll, so these
483516
// example binds are "inverted", since we have natural-scroll enabled for
484517
// touchpads by default.
485-
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
486-
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
518+
// Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; }
519+
// Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; }
487520

488521
// You can refer to workspaces by index. However, keep in mind that
489522
// niri is a dynamic workspace system, so these commands are kind of
@@ -530,6 +563,8 @@ binds {
530563

531564

532565
Mod+R { switch-preset-column-width; }
566+
// Cycling through the presets in reverse order is also possible.
567+
// Mod+R { switch-preset-column-width-back; }
533568
Mod+Shift+R { switch-preset-window-height; }
534569
Mod+Ctrl+R { reset-window-height; }
535570
Mod+F { maximize-column; }
@@ -579,7 +614,7 @@ binds {
579614
Alt+Print { screenshot-window; }
580615
// To use ScreenGrab replace with
581616
// Print { spawn "screengrab"; } // use last setting
582-
// Ctrl+Print { spawn "screengrab" "-f"; }
617+
// Ctrl+Print { spawn-sh "screengrab -f"; }
583618
// See "screengrab -h" for all options
584619

585620
// Applications such as remote-desktop clients and software KVM switches may

startlxqtwayland.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ elif [ "$COMPOSITOR" = "labwc" ]; then
115115
elif [ "$COMPOSITOR" = "niri" ]; then
116116
if [ ! -f "$XDG_CONFIG_HOME/lxqt/wayland/lxqt-niri.kdl" ]; then
117117
cp -v "$share_dir"/lxqt/wayland/lxqt-niri.kdl "$XDG_CONFIG_HOME"/lxqt/wayland/
118-
if echo "$valid_layouts" | grep -q "$trylayout"; then
119-
layout="layout \"$trylayout\""
120-
sed -i "s/layout \"us\"/$layout/" "$XDG_CONFIG_HOME/lxqt/wayland/lxqt-niri.kdl"
121-
fi
122118
fi
123119
exec $COMPOSITOR -c $XDG_CONFIG_HOME/lxqt/wayland/lxqt-niri.kdl
124120

0 commit comments

Comments
 (0)