aboutsummaryrefslogtreecommitdiff
path: root/niri
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2026-10-23 23:45:35 +0200
committerbozo.kopic <bozo@kopic.xyz>2026-10-23 23:45:35 +0200
commit7ba2f3494fbf93c06364858d6bddd4aefc9924c7 (patch)
tree16c66392edef4b2625a7f93c81b180d38e047270 /niri
parentbb2dae2aaafab0bb7f1c1d03dc6ebe10deee0b24 (diff)
.
Diffstat (limited to 'niri')
-rw-r--r--niri/config.kdl180
-rwxr-xr-xniri/init.sh28
-rwxr-xr-xniri/run-niri.sh15
-rwxr-xr-xniri/swayidle.sh3
-rwxr-xr-xniri/terminal.sh25
5 files changed, 251 insertions, 0 deletions
diff --git a/niri/config.kdl b/niri/config.kdl
new file mode 100644
index 0000000..aa67b93
--- /dev/null
+++ b/niri/config.kdl
@@ -0,0 +1,180 @@
+input {
+ keyboard {
+ numlock
+ }
+
+ touchpad {
+ tap
+ natural-scroll
+ }
+
+ warp-mouse-to-focus
+ focus-follows-mouse max-scroll-amount="0%"
+}
+
+cursor {
+ xcursor-theme "default"
+ xcursor-size 32
+}
+
+layout {
+ gaps 0
+
+ default-column-width {
+ proportion 0.5
+ }
+
+ preset-column-widths {
+ proportion 0.33333
+ proportion 0.5
+ proportion 0.66667
+ proportion 1.0
+ }
+
+ focus-ring {
+ off
+ }
+
+ border {
+ on
+ width 4
+ active-color "#ffc87f"
+ inactive-color "#505050"
+ urgent-color "#9b0000"
+ }
+}
+
+prefer-no-csd
+
+animations {
+ workspace-switch {
+ off
+ }
+}
+
+hotkey-overlay {
+ skip-at-startup
+}
+
+screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
+
+workspace "1:1"
+workspace "2:2"
+workspace "3:3"
+workspace "4:4"
+workspace "5:a"
+workspace "6:s"
+workspace "7:d"
+workspace "8:f"
+workspace "9:term"
+
+window-rule {
+ match app-id="tmux_term"
+
+ open-on-workspace "9:term"
+ open-maximized-to-edges true
+ open-focused true
+}
+
+spawn-sh-at-startup "~/.config/niri/init.sh"
+
+binds {
+ XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
+ XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
+
+ Print { screenshot; }
+ Ctrl+Print { screenshot-screen; }
+ Alt+Print { screenshot-window; }
+
+ F12 { spawn "~/.config/niri/terminal.sh"; }
+
+ Mod+Return { spawn "foot"; }
+ Mod+Space { spawn "wofi"; }
+
+ Mod+Tab { toggle-column-tabbed-display; }
+
+ Mod+Shift+Q repeat=false { close-window; }
+ Mod+Shift+E { quit; }
+ Mod+Shift+Space { toggle-window-floating; }
+ Mod+Shift+Return { fullscreen-window; }
+
+ Mod+H { focus-column-left; }
+ Mod+J { focus-window-down; }
+ Mod+K { focus-window-up; }
+ Mod+L { focus-column-right; }
+ Mod+Left { focus-column-left; }
+ Mod+Down { focus-window-down; }
+ Mod+Up { focus-window-up; }
+ Mod+Right { focus-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; }
+ 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+Slash { consume-or-expel-window-left; }
+
+ Mod+1 { focus-workspace "1:1"; }
+ Mod+2 { focus-workspace "2:2"; }
+ Mod+3 { focus-workspace "3:3"; }
+ Mod+4 { focus-workspace "4:4"; }
+ Mod+A { focus-workspace "5:a"; }
+ Mod+S { focus-workspace "6:s"; }
+ Mod+D { focus-workspace "7:d"; }
+ Mod+F { focus-workspace "8:f"; }
+
+ Mod+Shift+1 { move-column-to-workspace "1:1" focus=false; }
+ Mod+Shift+2 { move-column-to-workspace "2:2" focus=false; }
+ Mod+Shift+3 { move-column-to-workspace "3:3" focus=false; }
+ Mod+Shift+4 { move-column-to-workspace "4:4" focus=false; }
+ Mod+Shift+A { move-column-to-workspace "5:a" focus=false; }
+ Mod+Shift+S { move-column-to-workspace "6:s" focus=false; }
+ Mod+Shift+D { move-column-to-workspace "7:d" focus=false; }
+ Mod+Shift+F { move-column-to-workspace "8:f" focus=false; }
+
+ 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+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+Shift+H { move-column-to-monitor-left; }
+ Mod+Ctrl+Shift+J { move-column-to-monitor-down; }
+ Mod+Ctrl+Shift+K { move-column-to-monitor-up; }
+ Mod+Ctrl+Shift+L { move-column-to-monitor-right; }
+ Mod+Ctrl+Shift+Left { move-column-to-monitor-left; }
+ Mod+Ctrl+Shift+Down { move-column-to-monitor-down; }
+ Mod+Ctrl+Shift+Up { move-column-to-monitor-up; }
+ Mod+Ctrl+Shift+Right { move-column-to-monitor-right; }
+
+ Mod+R { switch-preset-column-width; }
+ Mod+Minus { set-column-width "-10%"; }
+ Mod+Equal { set-column-width "+10%"; }
+ Mod+BracketLeft { consume-or-expel-window-left; }
+ Mod+BracketRight { consume-or-expel-window-right; }
+ Mod+C { center-column; }
+ Mod+M { maximize-window-to-edges; }
+ Mod+W { toggle-column-tabbed-display; }
+
+ Mod+O repeat=false { toggle-overview; }
+
+ Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
+
+ 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+WheelScrollUp { focus-column-right; }
+ Mod+WheelScrollDown { focus-column-left; }
+
+ Mod+Shift+WheelScrollUp { move-column-right; }
+ Mod+Shift+WheelScrollLeft { move-column-left; }
+}
diff --git a/niri/init.sh b/niri/init.sh
new file mode 100755
index 0000000..acbb88a
--- /dev/null
+++ b/niri/init.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+if command -v gsettings >/dev/null; then
+ gsettings set org.gnome.desktop.interface scaling-factor 1
+ gsettings set org.gnome.desktop.interface text-scaling-factor 1
+ gsettings set org.gnome.desktop.interface cursor-size 32
+fi
+
+os_id=$(. /etc/os-release && echo $ID)
+
+if command -v systemctl >/dev/null; then
+ systemctl --user restart plasma-kactivitymanagerd
+
+else
+ dbus-update-activation-environment WAYLAND_DISPLAY \
+ XDG_CURRENT_DESKTOP
+
+ if [ "$os_id" = "alpine" ]; then
+ /usr/libexec/pipewire-launcher &
+
+ elif [ "$os_id" = "void" ]; then
+ pipewire &
+ fi
+fi
+
+~/.config/niri/swayidle.sh &
+kanshi &
+waybar -c ~/.config/waybar/niri.conf &
diff --git a/niri/run-niri.sh b/niri/run-niri.sh
new file mode 100755
index 0000000..eae7cec
--- /dev/null
+++ b/niri/run-niri.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+exec >~/.niri.log 2>&1
+
+export QT_QPA_PLATFORM=wayland
+
+if ( command -v systemctl && systemctl --user is-system-running ) >/dev/null; then
+ exec niri-session
+
+elif pgrep -U $(id -u) dbus-daemon >/dev/null; then
+ exec niri --session
+
+else
+ exec dbus-run-session -- niri --session
+fi
diff --git a/niri/swayidle.sh b/niri/swayidle.sh
new file mode 100755
index 0000000..caa96f0
--- /dev/null
+++ b/niri/swayidle.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec swayidle -w timeout 600 'niri msg action power-off-monitors'
diff --git a/niri/terminal.sh b/niri/terminal.sh
new file mode 100755
index 0000000..ba34d5f
--- /dev/null
+++ b/niri/terminal.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+term_workspace=9:term
+term_app_id=tmux_term
+
+focused_output=$(niri msg -j workspaces |
+ jq -r '.[] | select(.is_focused == true) | .output')
+focused_workspace=$(niri msg -j workspaces |
+ jq -r '.[] | select(.is_focused == true) | .name')
+
+if [ "$focused_workspace" = "$term_workspace" ]; then
+ niri msg action focus-workspace-previous
+
+else
+ niri msg action focus-workspace $term_workspace
+ niri msg action move-workspace-to-monitor $focused_output
+ niri msg action focus-workspace $term_workspace
+
+ if ! (niri msg -j windows |
+ jq -e ".[] | select(.app_id == \"$term_app_id\")" > /dev/null); then
+
+ exec foot --app-id $term_app_id \
+ tmux new-session -A -s default
+ fi
+fi