From 9f469589b400ddb104cc83f73ae36224be78cd7c Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sun, 30 Nov 2025 14:21:09 +0100 Subject: [PATCH] update niri --- config/niri/.config/niri/apply-color | 4 +- config/niri/.config/niri/config.kdl | 477 +----------------- config/niri/.config/niri/config/binds.kdl | 162 ++++++ config/niri/.config/niri/config/envs.kdl | 22 + config/niri/.config/niri/config/execs.kdl | 37 ++ config/niri/.config/niri/config/input.kdl | 29 ++ config/niri/.config/niri/config/misc.kdl | 12 + config/niri/.config/niri/config/monitors.kdl | 22 + config/niri/.config/niri/config/rules.kdl | 89 ++++ config/niri/.config/niri/config/styles.kdl | 86 ++++ .../.config/quickshell/Services/Niri.qml | 4 +- .../quickshell/Services/Screenshot.qml | 3 +- 12 files changed, 475 insertions(+), 472 deletions(-) create mode 100644 config/niri/.config/niri/config/binds.kdl create mode 100644 config/niri/.config/niri/config/envs.kdl create mode 100644 config/niri/.config/niri/config/execs.kdl create mode 100644 config/niri/.config/niri/config/input.kdl create mode 100644 config/niri/.config/niri/config/misc.kdl create mode 100644 config/niri/.config/niri/config/monitors.kdl create mode 100644 config/niri/.config/niri/config/rules.kdl create mode 100644 config/niri/.config/niri/config/styles.kdl diff --git a/config/niri/.config/niri/apply-color b/config/niri/.config/niri/apply-color index 58aa7e8..1c2f8ba 100755 --- a/config/niri/.config/niri/apply-color +++ b/config/niri/.config/niri/apply-color @@ -6,9 +6,9 @@ } . "$HOME/.local/snippets/apply-color-helper" -file="$path"/config.kdl +file="$path"/config/styles.kdl -sed -i -E "s/^(\s*active-color\s+\"#)([0-9A-Fa-f]{6})(\")/\1${colorHex}\3/" "$file" || { +sed -i -E "s/^(\s*active-color\s+\"#)([0-9A-Fa-f]{6})(\")/\1${colorHex}\3/g" "$file" || { log_error "Failed to edit ${file}" exit 1 } diff --git a/config/niri/.config/niri/config.kdl b/config/niri/.config/niri/config.kdl index 2b4daf0..0026361 100644 --- a/config/niri/.config/niri/config.kdl +++ b/config/niri/.config/niri/config.kdl @@ -1,467 +1,10 @@ -/************************Input************************/ - -input { - keyboard { - xkb { - layout "de" - } - - numlock - } - - touchpad { - tap - natural-scroll - scroll-method "two-finger" - } - - mouse { - accel-speed 0.25 - } - - trackpoint { - off - } - - // 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. - focus-follows-mouse max-scroll-amount="100%" -} - -/************************Output************************/ - -output "eDP-1" { - // off - mode "2560x1600@60.002" - scale 1.25 - background-color "#1e1e2e" - backdrop-color "#1e1e2e" -} - -output "eDP-2" { - mode "2560x1600@60" - scale 1.25 - background-color "#1e1e2e" - backdrop-color "#1e1e2e" -} - -output "DP-1" { - mode "2560x1440@179.845" - scale 1.0 - background-color "#1e1e2e" - backdrop-color "#1e1e2e" - // transform "90" -} - - -/************************Layout************************/ - -layout { - gaps 0 - - center-focused-column "never" - - preset-column-widths { - proportion 0.3 - proportion 0.5 - proportion 0.7 - } - - preset-window-heights { - proportion 0.5 - proportion 0.75 - proportion 1.0 - } - - default-column-width { proportion 0.7; } - - focus-ring { - width 2 - active-color "#89b4fa" - inactive-color "#1e1e2e" - } - - border { - off - } - - shadow { - on - - softness 30 - spread 5 - offset x=0 y=5 - color "#0007" - } - - struts { - top 2 - right 2 - bottom 3 - left 2 - } - - background-color "#1e1e2e" -} - -// Disable the "Important Hotkeys" pop-up at startup. -hotkey-overlay { - skip-at-startup -} - -prefer-no-csd - -animations { - // off - // slowdown 3.0 -} - -layer-rule { - match namespace="^swww-daemonbackdrop$" - place-within-backdrop true - -} - - -/************************Autostart************************/ - -// Switch configs -spawn-at-startup "config-switch" "niri" - -// Wallpaper -spawn-at-startup "wallpaper-daemon" - -// Not necessary maybe ... -spawn-at-startup "fcitx5" - -// Core -spawn-at-startup "nm-applet" -spawn-at-startup "gnome-keyring-daemon" "--start" "--components=secrets" -spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" - -// Clipboard history -spawn-at-startup "wl-paste" "--type" "text" "--watch" "cliphist" "store" -spawn-at-startup "wl-paste" "--type" "image" "--watch" "cliphist" "store" - -// wlsunset -// spawn-at-startup "sunset" - -// Logitech -spawn-at-startup "solaar" "-w" "hide" - -// Some other heavy apps -spawn-at-startup "sunshine" -// spawn-at-startup "spotify" -// spawn-at-startup "thunderbird" - -// Idle -spawn-at-startup "hypridle" - -// QuickShell -spawn-at-startup "quickshell" - -// According to (https://ghostty.org/docs/linux/systemd#starting-ghostty-at-login) -spawn-sh-at-startup "systemctl start --user app-com.mitchellh.ghostty.service" - -/************************Envs************************/ - -environment { - // Input Method - QT_IM_MODULE "fcitx" - XMODIFIERS "@im=fcitx" - SDL_IM_MODULE "fcitx" - GLFW_IM_MODULE "ibus" - INPUT_METHOD "fcitx" - - // Themes - QT_QPA_PLATFORM "wayland" - QT_QPA_PLATFORMTHEME "kde" - QT_STYLE_OVERRIDE "Kvantum" - - // Nvidia - LIBVA_DRIVER_NAME "nvidia" - __GLX_VENDOR_LIBRARY_NAME "nvidia" - NVD_BACKEND "nvidia" - - // Others - XCURSOR_SIZE "24" - ELECTRON_OZONE_PLATFORM_HINT "wayland" -} - -/************************Rules************************/ - -// Picture-in-Picture -window-rule { - match title="^([Pp]icture[-\\s]?[Ii]n[-\\s]?[Pp]icture)(.*)$" - open-floating true -} - -// Dialog windows -window-rule { - match title="^(Open File)(.*)$" - match title="^(Select a File)(.*)$" - match title="^(Choose wallpaper)(.*)$" - match title="^(Open Folder)(.*)$" - match title="^(Save As)(.*)$" - match title="^(Library)(.*)$" - match title="^(File Upload)(.*)$" - open-floating true -} - -// FLoating terminal -window-rule { - match app-id="kitty" - open-floating true - default-column-width { proportion 0.5; } -} - -// Normal terminal -window-rule { - match app-id="com.mitchellh.ghostty" - default-column-width { proportion 0.3; } -} - -// Scrcpy -window-rule { - match app-id="scrcpy" - default-column-width { proportion 0.3; } -} - -// Editor -window-rule { - match app-id="org.gnome.TextEditor" - default-column-width { proportion 0.3; } -} - -// Other floating -window-rule { - match app-id="blueberry" - match app-id="blueman-manager" - match app-id="org.pulseaudio.pavucontrol" - match app-id="com.saivert.pwvucontrol" - match app-id="Waydroid" - match app-id="^waydroid" - match app-id="org.kde.kcalc" - match app-id="org.kde.kalk" - match app-id="org.gnome.NautilusPreviewer" - match app-id="coin" - match app-id="wallpaper-carousel" - match app-id="be.alexandervanhee.gradia" - match title="^(图片查看器)(.*)$" // QQ - open-floating true -} - -// Block from recording -window-rule { - match app-id="thunderbird" - - block-out-from "screen-capture" -} - - -// workspace "first" -// workspace "second" - -// Startup in "second" workspace -window-rule { - // match at-startup=true app-id="Spotify" - // match at-startup=true app-id="thunderbird" - - - open-on-workspace "second" -} - -window-rule { - match app-id="at.yrlf.wl_mirror" - - // default-column-width { proportion 1.0; } - open-floating true - // open-maximized-to-edges true - // open-on-output "HDMI-A-1" -} - -// I love round corners -window-rule { - geometry-corner-radius 14 - clip-to-geometry true -} - - -/************************Others************************/ - -cursor { - xcursor-theme "Bibata-Modern-Ice" - xcursor-size 24 - hide-when-typing -} - -debug { - render-drm-device "/dev/dri/card0" -} - -// screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" -screenshot-path "~/Pictures/Screenshots/.niri_screenshot.png" - -// gestures { -// hot-corners { -// off -// } -// } - -/************************Keybindings************************/ - -binds { - // Apps - Mod+C { spawn "code"; } - Mod+E { spawn "dolphin" "--new-window"; } - Mod+W { spawn-sh "zen || zen-browser"; } - Mod+X { spawn "gnome-text-editor" "--new-window"; } - Mod+B { spawn-sh "pkill -x -n btop || kitty -e btop"; } - Mod+T { spawn "ghostty" "+new-window"; } - Mod+Return { spawn "ghostty" "+new-window"; } - Mod+Shift+T { spawn "kitty"; } - Mod+Shift+Return { spawn "kitty"; } - Mod+Shift+W { spawn "wallpaper-carousel"; } - Mod+O { spawn-sh "pkill -x -n pwvucontrol || pwvucontrol"; } - - // Quickshell - Mod+Space { spawn "qs" "ipc" "call" "panels" "toggleControlCenter"; } - Mod+Shift+D { spawn "qs" "ipc" "call" "panels" "toggleCalendar"; } - Mod+Shift+L { spawn "qs" "ipc" "call" "lyrics" "toggleBarLyrics"; } - Mod+Shift+K { spawn-sh "quickshell-kill || quickshell"; } - Mod+I { spawn "qs" "ipc" "call" "idleInhibitor" "toggleInhibitor"; } - Mod+Alt+R { spawn "qs" "ipc" "call" "recording" "startOrStopRecording"; } - Mod+Shift+E { spawn "qs" "ipc" "call" "sunset" "toggleSunset"; } - - // Rofi - Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; } - Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; } - - // Actions - Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; } - Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; } - Ctrl+Alt+Delete { spawn "pkill -x wlogout || wlogout -p layer-shell"; } - Print { spawn "screenshot-script" "full"; } - Mod+Shift+S { spawn "screenshot-script" "area"; } - Mod+Ctrl+Shift+S { spawn "screenshot-script" "window"; } - Mod+Shift+C { spawn "hyprpicker" "-a"; } - - // Session - Mod+L { spawn "loginctl" "lock-session"; } - - // Media - XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-"; } - XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } - XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } - XF86AudioPause allow-when-locked=true { spawn-sh "playerctl play-pause"; } - XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } - XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } - - // Brightness - XF86MonBrightnessUp allow-when-locked=true { spawn "set-brightness" "+10%"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "set-brightness" "10%-"; } - - // Window management - Mod+Tab repeat=false { toggle-overview; } - - Mod+Q repeat=false { close-window; } - - Mod+Left { focus-column-left; } - Mod+Down { focus-window-or-workspace-down; } - Mod+Up { focus-window-or-workspace-up; } - Mod+Right { focus-column-right; } - - Mod+Shift+Left { move-column-left; } - Mod+Shift+Down { move-window-down-or-to-workspace-down; } - Mod+Shift+Up { move-window-up-or-to-workspace-up; } - Mod+Shift+Right { move-column-right; } - - Mod+Home { focus-column-first; } - Mod+End { focus-column-last; } - Mod+Shift+Home { move-column-to-first; } - Mod+Shift+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+Shift+Ctrl+Left { move-window-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-window-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-window-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-window-to-monitor-right; } - - Mod+Page_Down { focus-workspace-down; } - Mod+Page_Up { focus-workspace-up; } - Mod+Shift+Page_Down { move-window-to-workspace-down; } - Mod+Shift+Page_Up { move-window-to-workspace-up; } - - Mod+Ctrl+Shift+Page_Down { move-workspace-down; } - Mod+Ctrl+Shift+Page_Up { 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 cooldown-ms=150 { focus-column-right; } - Mod+WheelScrollLeft cooldown-ms=150 { focus-column-left; } - Mod+Shift+WheelScrollRight { move-column-right; } - Mod+Shift+WheelScrollLeft { move-column-left; } - - 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+Alt+1 { move-window-to-workspace 1; } - Mod+Alt+2 { move-window-to-workspace 2; } - Mod+Alt+3 { move-window-to-workspace 3; } - Mod+Alt+4 { move-window-to-workspace 4; } - Mod+Alt+5 { move-window-to-workspace 5; } - Mod+Alt+6 { move-window-to-workspace 6; } - Mod+Alt+7 { move-window-to-workspace 7; } - Mod+Alt+8 { move-window-to-workspace 8; } - Mod+Alt+9 { move-window-to-workspace 9; } - - Mod+Alt+Left { consume-or-expel-window-left; } - Mod+Alt+Right { consume-or-expel-window-right; } - - Mod+Shift+Comma { consume-window-into-column; } - Mod+Shift+Period { expel-window-from-column; } - Mod+Shift+M { toggle-column-tabbed-display; } - - Mod+R { switch-preset-column-width; } - Mod+Shift+R { switch-preset-window-height; } - Mod+Ctrl+R { reset-window-height; } - Mod+F { maximize-column; } - Mod+Shift+F { fullscreen-window; } - Mod+Ctrl+F { expand-column-to-available-width; } - - Mod+Y { center-column; } - - Mod+Minus { set-column-width "-10%"; } - Mod+Plus { set-column-width "+10%"; } - - Mod+Shift+Minus { set-window-height "-10%"; } - Mod+Shift+Plus { set-window-height "+10%"; } - - Mod+Alt+Space { toggle-window-floating; } - Alt+Tab { switch-focus-between-floating-and-tiling; } - - Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } - - Mod+M allow-inhibiting=false { quit; } - - Mod+Shift+P { spawn-sh "(hyprlock &) && niri msg action power-off-monitors"; } - - Mod+P repeat=false { spawn-sh "wl-mirror $(niri msg --json focused-output | jq -r .name)"; } -} +include "config/input.kdl" +include "config/monitors.kdl" +include "config/styles.kdl" +include "config/execs.kdl" +include "config/envs.kdl" +include "config/rules.kdl" +include "config/binds.kdl" +include "config/misc.kdl" + +/************************Misc************************/ diff --git a/config/niri/.config/niri/config/binds.kdl b/config/niri/.config/niri/config/binds.kdl new file mode 100644 index 0000000..e265398 --- /dev/null +++ b/config/niri/.config/niri/config/binds.kdl @@ -0,0 +1,162 @@ +recent-windows { + binds { + Alt+Tab { next-window; } + Alt+Shift+Tab { previous-window; } + Alt+dead_circumflex { next-window filter="app-id"; } + Alt+Shift+dead_circumflex { previous-window filter="app-id"; } + } +} + +binds { + // Apps + Mod+C { spawn "code"; } + Mod+E { spawn "dolphin" "--new-window"; } + Mod+W { spawn-sh "zen || zen-browser"; } + Mod+X { spawn "gnome-text-editor" "--new-window"; } + Mod+B { spawn-sh "pkill -x -n btop || kitty -e btop"; } + Mod+T { spawn "ghostty" "+new-window"; } + Mod+Return { spawn "ghostty" "+new-window"; } + Mod+Shift+T { spawn "kitty"; } + Mod+Shift+Return { spawn "kitty"; } + Mod+Shift+W { spawn "wallpaper-carousel"; } + Mod+O { spawn-sh "pkill -x -n pwvucontrol || pwvucontrol"; } + + // Quickshell + Mod+Space { spawn "qs" "ipc" "call" "panels" "toggleControlCenter"; } + Mod+Shift+D { spawn "qs" "ipc" "call" "panels" "toggleCalendar"; } + Mod+Shift+L { spawn "qs" "ipc" "call" "lyrics" "toggleBarLyrics"; } + Mod+Shift+K { spawn-sh "quickshell-kill || quickshell"; } + Mod+I { spawn "qs" "ipc" "call" "idleInhibitor" "toggleInhibitor"; } + Mod+Alt+R { spawn "qs" "ipc" "call" "recording" "startOrStopRecording"; } + Mod+Shift+E { spawn "qs" "ipc" "call" "sunset" "toggleSunset"; } + + // Rofi + Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; } + Alt+Space { spawn-sh "pkill -x rofi || rofi -show drun"; } + + // Actions + Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; } + Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; } + Ctrl+Alt+Delete { spawn "pkill -x wlogout || wlogout -p layer-shell"; } + Print { spawn "niri" "msg" "action" "screenshot-screen"; } + Mod+Shift+S { spawn "niri" "msg" "action" "screenshot"; } + Mod+Ctrl+Shift+S { spawn "niri" "msg" "action" "screenshot-window"; } + Mod+Shift+C { spawn "hyprpicker" "-a"; } + + // Session + Mod+L { spawn "loginctl" "lock-session"; } + + // Media + XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-"; } + XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } + XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } + XF86AudioPause allow-when-locked=true { spawn-sh "playerctl play-pause"; } + XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } + XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } + + // Brightness + XF86MonBrightnessUp allow-when-locked=true { spawn "set-brightness" "+10%"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "set-brightness" "10%-"; } + + // Window management + Mod+Tab repeat=false { toggle-overview; } + + Mod+Q repeat=false { close-window; } + + Mod+Left { focus-column-left; } + Mod+Down { focus-window-or-workspace-down; } + Mod+Up { focus-window-or-workspace-up; } + Mod+Right { focus-column-right; } + + Mod+Shift+Left { move-column-left; } + Mod+Shift+Down { move-window-down-or-to-workspace-down; } + Mod+Shift+Up { move-window-up-or-to-workspace-up; } + Mod+Shift+Right { move-column-right; } + + Mod+Home { focus-column-first; } + Mod+End { focus-column-last; } + Mod+Shift+Home { move-column-to-first; } + Mod+Shift+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+Shift+Ctrl+Left { move-window-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-window-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-window-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-window-to-monitor-right; } + + Mod+Page_Down { focus-workspace-down; } + Mod+Page_Up { focus-workspace-up; } + Mod+Shift+Page_Down { move-window-to-workspace-down; } + Mod+Shift+Page_Up { move-window-to-workspace-up; } + + Mod+Ctrl+Shift+Page_Down { move-workspace-down; } + Mod+Ctrl+Shift+Page_Up { 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 cooldown-ms=150 { focus-column-right; } + Mod+WheelScrollLeft cooldown-ms=150 { focus-column-left; } + Mod+Shift+WheelScrollRight { move-column-right; } + Mod+Shift+WheelScrollLeft { move-column-left; } + + 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+Alt+1 { move-window-to-workspace 1; } + Mod+Alt+2 { move-window-to-workspace 2; } + Mod+Alt+3 { move-window-to-workspace 3; } + Mod+Alt+4 { move-window-to-workspace 4; } + Mod+Alt+5 { move-window-to-workspace 5; } + Mod+Alt+6 { move-window-to-workspace 6; } + Mod+Alt+7 { move-window-to-workspace 7; } + Mod+Alt+8 { move-window-to-workspace 8; } + Mod+Alt+9 { move-window-to-workspace 9; } + + Mod+Alt+Left { consume-or-expel-window-left; } + Mod+Alt+Right { consume-or-expel-window-right; } + + Mod+Shift+Comma { consume-window-into-column; } + Mod+Shift+Period { expel-window-from-column; } + Mod+Shift+M { toggle-column-tabbed-display; } + + Mod+R { switch-preset-column-width; } + Mod+Shift+R { switch-preset-window-height; } + Mod+Ctrl+R { reset-window-height; } + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + Mod+Ctrl+F { expand-column-to-available-width; } + + Mod+Y { center-column; } + + Mod+Minus { set-column-width "-10%"; } + Mod+Plus { set-column-width "+10%"; } + + Mod+Shift+Minus { set-window-height "-10%"; } + Mod+Shift+Plus { set-window-height "+10%"; } + + Mod+Alt+Space { toggle-window-floating; } + // Alt+Tab { switch-focus-between-floating-and-tiling; } + + Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } + + Mod+M allow-inhibiting=false { quit; } + + Mod+Shift+P { spawn-sh "(hyprlock &) && niri msg action power-off-monitors"; } + + Mod+P repeat=false { spawn-sh "wl-mirror $(niri msg --json focused-output | jq -r .name)"; } +} diff --git a/config/niri/.config/niri/config/envs.kdl b/config/niri/.config/niri/config/envs.kdl new file mode 100644 index 0000000..2e3d0c4 --- /dev/null +++ b/config/niri/.config/niri/config/envs.kdl @@ -0,0 +1,22 @@ +environment { + // Input Method + QT_IM_MODULE "fcitx" + XMODIFIERS "@im=fcitx" + SDL_IM_MODULE "fcitx" + GLFW_IM_MODULE "ibus" + INPUT_METHOD "fcitx" + + // Themes + QT_QPA_PLATFORM "wayland" + QT_QPA_PLATFORMTHEME "kde" + QT_STYLE_OVERRIDE "Kvantum" + + // Nvidia + LIBVA_DRIVER_NAME "nvidia" + __GLX_VENDOR_LIBRARY_NAME "nvidia" + NVD_BACKEND "nvidia" + + // Others + XCURSOR_SIZE "24" + ELECTRON_OZONE_PLATFORM_HINT "wayland" +} \ No newline at end of file diff --git a/config/niri/.config/niri/config/execs.kdl b/config/niri/.config/niri/config/execs.kdl new file mode 100644 index 0000000..c071ca9 --- /dev/null +++ b/config/niri/.config/niri/config/execs.kdl @@ -0,0 +1,37 @@ +// Switch configs +spawn-at-startup "config-switch" "niri" + +// Wallpaper +spawn-at-startup "wallpaper-daemon" + +// Not necessary maybe ... +spawn-at-startup "fcitx5" + +// Core +spawn-at-startup "nm-applet" +spawn-at-startup "gnome-keyring-daemon" "--start" "--components=secrets" +spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" + +// Clipboard history +spawn-at-startup "wl-paste" "--type" "text" "--watch" "cliphist" "store" +spawn-at-startup "wl-paste" "--type" "image" "--watch" "cliphist" "store" + +// wlsunset +// spawn-at-startup "sunset" + +// Logitech +spawn-at-startup "solaar" "-w" "hide" + +// Some other heavy apps +spawn-at-startup "sunshine" +// spawn-at-startup "spotify" +// spawn-at-startup "thunderbird" + +// Idle +spawn-at-startup "hypridle" + +// QuickShell +spawn-at-startup "quickshell" + +// According to (https://ghostty.org/docs/linux/systemd#starting-ghostty-at-login) +spawn-sh-at-startup "systemctl start --user app-com.mitchellh.ghostty.service" \ No newline at end of file diff --git a/config/niri/.config/niri/config/input.kdl b/config/niri/.config/niri/config/input.kdl new file mode 100644 index 0000000..26046ce --- /dev/null +++ b/config/niri/.config/niri/config/input.kdl @@ -0,0 +1,29 @@ +input { + keyboard { + xkb { + layout "de" + } + + numlock + } + + touchpad { + tap + natural-scroll + scroll-method "two-finger" + } + + mouse { + accel-speed 0.25 + } + + trackpoint { + off + } + + // 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. + focus-follows-mouse max-scroll-amount="100%" +} diff --git a/config/niri/.config/niri/config/misc.kdl b/config/niri/.config/niri/config/misc.kdl new file mode 100644 index 0000000..8754766 --- /dev/null +++ b/config/niri/.config/niri/config/misc.kdl @@ -0,0 +1,12 @@ +debug { + render-drm-device "/dev/dri/card0" +} + +screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" +// screenshot-path "~/Pictures/Screenshots/.niri_screenshot.png" + +// gestures { +// hot-corners { +// off +// } +// } diff --git a/config/niri/.config/niri/config/monitors.kdl b/config/niri/.config/niri/config/monitors.kdl new file mode 100644 index 0000000..ce259a8 --- /dev/null +++ b/config/niri/.config/niri/config/monitors.kdl @@ -0,0 +1,22 @@ +output "eDP-1" { + // off + mode "2560x1600@60.002" + scale 1.25 + background-color "#1e1e2e" + backdrop-color "#1e1e2e" +} + +output "eDP-2" { + mode "2560x1600@60" + scale 1.25 + background-color "#1e1e2e" + backdrop-color "#1e1e2e" +} + +output "DP-1" { + mode "2560x1440@179.845" + scale 1.0 + background-color "#1e1e2e" + backdrop-color "#1e1e2e" + // transform "90" +} \ No newline at end of file diff --git a/config/niri/.config/niri/config/rules.kdl b/config/niri/.config/niri/config/rules.kdl new file mode 100644 index 0000000..81272a6 --- /dev/null +++ b/config/niri/.config/niri/config/rules.kdl @@ -0,0 +1,89 @@ +// Picture-in-Picture +window-rule { + match title="^([Pp]icture[-\\s]?[Ii]n[-\\s]?[Pp]icture)(.*)$" + open-floating true +} + +// Dialog windows +window-rule { + match title="^(Open File)(.*)$" + match title="^(Select a File)(.*)$" + match title="^(Choose wallpaper)(.*)$" + match title="^(Open Folder)(.*)$" + match title="^(Save As)(.*)$" + match title="^(Library)(.*)$" + match title="^(File Upload)(.*)$" + open-floating true +} + +// FLoating terminal +window-rule { + match app-id="kitty" + open-floating true + default-column-width { proportion 0.5; } +} + +// Normal terminal +window-rule { + match app-id="com.mitchellh.ghostty" + default-column-width { proportion 0.3; } +} + +// Scrcpy +window-rule { + match app-id="scrcpy" + default-column-width { proportion 0.3; } +} + +// Editor +window-rule { + match app-id="org.gnome.TextEditor" + default-column-width { proportion 0.3; } +} + +// Other floating +window-rule { + match app-id="blueberry" + match app-id="blueman-manager" + match app-id="org.pulseaudio.pavucontrol" + match app-id="com.saivert.pwvucontrol" + match app-id="Waydroid" + match app-id="^waydroid" + match app-id="org.kde.kcalc" + match app-id="org.kde.kalk" + match app-id="org.gnome.NautilusPreviewer" + match app-id="coin" + match app-id="wallpaper-carousel" + match app-id="be.alexandervanhee.gradia" + match title="^(图片查看器)(.*)$" // QQ + open-floating true +} + +// Block from recording +window-rule { + match app-id="thunderbird" + + block-out-from "screen-capture" +} + + +// workspace "first" +// workspace "second" + +// Startup in "second" workspace +window-rule { + // match at-startup=true app-id="Spotify" + // match at-startup=true app-id="thunderbird" + + + open-on-workspace "second" +} + +window-rule { + match app-id="at.yrlf.wl_mirror" + + // default-column-width { proportion 1.0; } + open-floating true + // open-maximized-to-edges true + // open-on-output "HDMI-A-1" +} diff --git a/config/niri/.config/niri/config/styles.kdl b/config/niri/.config/niri/config/styles.kdl new file mode 100644 index 0000000..b347243 --- /dev/null +++ b/config/niri/.config/niri/config/styles.kdl @@ -0,0 +1,86 @@ +layout { + gaps 0 + + center-focused-column "never" + + preset-column-widths { + proportion 0.3 + proportion 0.5 + proportion 0.7 + } + + preset-window-heights { + proportion 0.5 + proportion 0.75 + proportion 1.0 + } + + default-column-width { proportion 0.7; } + + focus-ring { + width 2 + active-color "#89b4fa" + inactive-color "#1e1e2e" + } + + border { + off + } + + shadow { + on + + softness 30 + spread 5 + offset x=0 y=5 + color "#0007" + } + + struts { + top 2 + right 2 + bottom 3 + left 2 + } + + background-color "#1e1e2e" +} + + +// Disable the "Important Hotkeys" pop-up at startup. +hotkey-overlay { + skip-at-startup +} + +prefer-no-csd + +animations { + // off + // slowdown 3.0 +} + +layer-rule { + match namespace="^swww-daemonbackdrop$" + place-within-backdrop true + +} + +cursor { + xcursor-theme "Bibata-Modern-Ice" + xcursor-size 24 + hide-when-typing +} + +// I love round corners +window-rule { + geometry-corner-radius 14 + clip-to-geometry true +} + +recent-windows { + highlight { + active-color "#89b4fa" + urgent-color "#f38ba8" + corner-radius 14 + } +} \ No newline at end of file diff --git a/config/quickshell/.config/quickshell/Services/Niri.qml b/config/quickshell/.config/quickshell/Services/Niri.qml index 410fc19..24ef8c5 100644 --- a/config/quickshell/.config/quickshell/Services/Niri.qml +++ b/config/quickshell/.config/quickshell/Services/Niri.qml @@ -172,9 +172,9 @@ Singleton { Logger.error("Niri", "Error parsing window opened/changed event:", e); } } - if (event.windowClosed) { + if (event.WindowClosed) { try { - const closedId = event.windowClosed.id; + const closedId = event.WindowClosed.id; if (closedId && (root.windows && root.windows[closedId])) { delete root.windows[closedId]; if (root.focusedWindowId === closedId) { diff --git a/config/quickshell/.config/quickshell/Services/Screenshot.qml b/config/quickshell/.config/quickshell/Services/Screenshot.qml index cdcdd02..d69139e 100644 --- a/config/quickshell/.config/quickshell/Services/Screenshot.qml +++ b/config/quickshell/.config/quickshell/Services/Screenshot.qml @@ -10,7 +10,8 @@ Singleton { if (!path || typeof path !== "string") return ; - Quickshell.execDetached(["~/.local/scripts/screenshot-script", "edit", path]); + console.log("Screenshot captured at path:", path); + Quickshell.execDetached(["screenshot-script", "edit", path]); } }