From a923539c85389fdcd240a1fb51718d47336b79a0 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 27 Oct 2025 11:39:38 -0300 Subject: [PATCH 01/10] update niri config --- .dotter/aleidk-work-laptop.toml | 26 + .dotter/global.toml | 6 +- configs/mako/config | 1 + configs/niri/config.kdl | 871 +++++++++++++++------------- configs/nvim/lua/aleidk/options.lua | 1 + kdlfmt.kdl | 3 + 6 files changed, 494 insertions(+), 414 deletions(-) create mode 100644 kdlfmt.kdl diff --git a/.dotter/aleidk-work-laptop.toml b/.dotter/aleidk-work-laptop.toml index 05fd1ac..b1fe098 100644 --- a/.dotter/aleidk-work-laptop.toml +++ b/.dotter/aleidk-work-laptop.toml @@ -4,4 +4,30 @@ packages = ["default"] [files] "configs/hypr/work-laptop/hyprland.conf" = "~/.config/hypr/include/work-laptop.conf" + +[files."configs/niri/config.kdl"] +target = "~/.config/niri/config.kdl" +type = "template" +append = """ +window-rule { + match app-id="brave-work" + open-on-workspace "1" + open-focused true + + default-column-width { + proportion 0.5 + } +} +window-rule { + match app-id="brave-personal" + open-on-workspace "2" + open-focused false + + default-column-width { + proportion 0.5 + } +} + +""" + [variables] diff --git a/.dotter/global.toml b/.dotter/global.toml index a137e13..9fe01c6 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -4,7 +4,7 @@ default_target_type = "symbolic" [helpers] [default] -depends = [] +depends = ["niri"] [default.files] "configs/fish" = "~/.config/fish" @@ -21,7 +21,6 @@ depends = [] "configs/mako" = "~/.config/mako" "configs/mise" = "~/.config/mise" "configs/mpv" = "~/.config/mpv" -"configs/niri" = "~/.config/niri" "configs/nvim" = "~/.config/nvim" "configs/rofi" = "~/.config/rofi" "configs/swappy" = "~/.config/swappy" @@ -37,3 +36,6 @@ depends = [] [default.variables] + +[niri.files] +"configs/niri" = "~/.config/niri" diff --git a/configs/mako/config b/configs/mako/config index 1b7531f..7a78949 100644 --- a/configs/mako/config +++ b/configs/mako/config @@ -1,4 +1,5 @@ default-timeout=5000 +anchor=top-center # Colors diff --git a/configs/niri/config.kdl b/configs/niri/config.kdl index 06185e2..9581911 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/config.kdl @@ -1,37 +1,455 @@ +// ╭─────────────────────────────────────────────────────────╮ +// │ Windows Rules │ +// ╰─────────────────────────────────────────────────────────╯ +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="^org\\.wezfurlong\\.wezterm$" + default-column-width { + + } +} +// Floatin Windows +window-rule { + match app-id="firefox$" title="^Picture-in-Picture$" + match app-id="^brave-.*-Default$" + // Extensions popup open-floating true +} +window-rule { + match app-id="^org\\.keepassxc\\.KeePassXC$" + match app-id="^org\\.gnome\\.World\\.Secrets$" + // block-out-from "screen-capture" + // Use this instead if you want them visible on third-party screenshot tools. + block-out-from "screencast" +} +window-rule { + match app-id="brave-browser" + match at-startup=true + default-column-width { + proportion 0.75 + } +} +window-rule { + match title="^Meet: .*" app-id="brave-browser" + open-floating true +} +window-rule { + geometry-corner-radius 4 + clip-to-geometry true +} +// ╭─────────────────────────────────────────────────────────╮ +// │ Auto Start Apps │ +// ╰─────────────────────────────────────────────────────────╯ +spawn-at-startup "/usr/lib/pam_kwallet_init" +spawn-at-startup "udieskie" +spawn-at-startup "brave" +// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: +// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" +// ╭─────────────────────────────────────────────────────────╮ +// │ System Config │ +// ╰─────────────────────────────────────────────────────────╯ +// ── Layout Config ─────────────────────────────────────────────────── +layout { + gaps 10 + always-center-single-column + center-focused-column "never" + preset-column-widths { + // The default preset widths are 1/3, 1/2 and 2/3 of the output. + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + preset-window-heights { + + } + default-column-width { + proportion 0.5 + } + focus-ring { + // Uncomment this line to disable the focus ring. + // off + // How many logical pixels the ring extends out from the windows. + width 2 + active-color "#7fc8ff" + inactive-color "#505050" + } +} +// ── Keybindings ───────────────────────────────────────────────────── +binds { + Mod+Shift+Slash { + show-hotkey-overlay + } + Mod+Return hotkey-overlay-title="Open a Terminal: kitty" { + spawn "kitty" + } + Mod+D hotkey-overlay-title="Run an Application: Rofi" { + spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}" + } + XF86AudioRaiseVolume allow-when-locked=true { + spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+" + } + XF86AudioLowerVolume allow-when-locked=true { + spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-" + } + 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" + } + XF86MonBrightnessUp allow-when-locked=true { + spawn "brightnessctl" "--class=backlight" "set" "+10%" + } + XF86MonBrightnessDown allow-when-locked=true { + spawn "brightnessctl" "--class=backlight" "set" "10%-" + } + // Open/close the Overview: a zoomed-out view of workspaces and windows. + // You can also move the mouse into the top-left hot corner, + // or do a four-finger swipe up on a touchpad. + Mod+A repeat=false { + toggle-overview + } + Mod+Shift+Q repeat=false { + close-window + } + Mod+Tab { + focus-column-right-or-first + } + Mod+shift+Tab { + focus-column-left-or-last + } + 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+H { + focus-column-left + } + Mod+J { + focus-window-or-workspace-down + } + Mod+K { + focus-window-or-workspace-up + } + Mod+L { + 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+Shift+H { + move-column-left + } + Mod+Shift+J { + move-window-down-or-to-workspace-down + } + Mod+Shift+K { + move-window-up-or-to-workspace-up + } + Mod+Shift+L { + move-column-right + } + 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+WheelScrollDown cooldown-ms=150 { + focus-column-right + } + Mod+WheelScrollUp cooldown-ms=150 { + focus-column-left + } + Mod+Ctrl+WheelScrollDown cooldown-ms=150 { + move-column-to-workspace-down + } + Mod+Ctrl+WheelScrollUp cooldown-ms=150 { + move-column-to-workspace-up + } + Mod+WheelScrollRight { + focus-column-right + } + Mod+WheelScrollLeft { + focus-column-left + } + Mod+Ctrl+WheelScrollRight { + move-column-right + } + Mod+Ctrl+WheelScrollLeft { + move-column-left + } + Mod+Shift+WheelScrollDown cooldown-ms=150 { + focus-workspace-down + } + Mod+Shift+WheelScrollUp cooldown-ms=150 { + focus-workspace-up + } + Mod+Ctrl+Shift+WheelScrollDown { + move-column-right + } + Mod+Ctrl+Shift+WheelScrollUp { + move-column-left + } + // Similarly, you can bind touchpad scroll "ticks". + // Touchpad scrolling is continuous, so for these binds it is split into + // discrete intervals. + // These binds are also affected by touchpad's natural-scroll, so these + // example binds are "inverted", since we have natural-scroll enabled for + // touchpads by default. + // Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; } + // Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; } + 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+Shift+1 { + move-window-to-workspace 1 + } + Mod+Shift+2 { + move-window-to-workspace 2 + } + Mod+Shift+3 { + move-window-to-workspace 3 + } + Mod+Shift+4 { + move-window-to-workspace 4 + } + Mod+Shift+5 { + move-window-to-workspace 5 + } + Mod+Shift+6 { + move-window-to-workspace 6 + } + Mod+Shift+7 { + move-window-to-workspace 7 + } + Mod+Shift+8 { + move-window-to-workspace 8 + } + Mod+Shift+9 { + move-window-to-workspace 9 + } + // Switches focus between the current and the previous workspace. + Mod+Bar { + focus-workspace-previous + } + // The following binds move the focused window in and out of a column. + // If the window is alone, they will consume it into the nearby column to the side. + // If the window is already in a column, they will expel it out. + Mod+BraceLeft { + consume-or-expel-window-left + } + Mod+BraceRight { + consume-or-expel-window-right + } + // Consume one window from the right to the bottom of the focused column. + Mod+Comma { + consume-window-into-column + } + // Expel the bottom window from the focused column to the right. + Mod+Period { + expel-window-from-column + } + Mod+R { + switch-preset-column-width + } + // Cycling through the presets in reverse order is also possible. + // Mod+R { switch-preset-column-width-back; } + Mod+Shift+R { + switch-preset-window-height + } + Mod+Ctrl+R { + reset-window-height + } + Mod+F { + maximize-column + } + Mod+Shift+F { + fullscreen-window + } + // Expand the focused column to space not taken up by other fully visible columns. + // Makes the column "fill the rest of the space". + Mod+Ctrl+F { + expand-column-to-available-width + } + Mod+C { + center-column + } + // Center all fully visible columns on screen. + Mod+Ctrl+C { + center-visible-columns + } + // Finer width adjustments. + // This command can also: + // * set width in pixels: "1000" + // * adjust width in pixels: "-5" or "+5" + // * set width as a percentage of screen width: "25%" + // * adjust width as a percentage of screen width: "-10%" or "+10%" + // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + // set-column-width "100" will make the column occupy 200 physical screen pixels. + Mod+Minus { + set-column-width "-10%" + } + Mod+Plus { + set-column-width "+10%" + } + // Finer height adjustments when in column with other windows. + Mod+Shift+Minus { + set-window-height "-10%" + } + Mod+Shift+Equal { + set-window-height "+10%" + } + // Move the focused window between the floating and the tiling layout. + Mod+Shift+Space { + toggle-window-floating + } + Mod+Space { + switch-focus-between-floating-and-tiling + } + // Toggle tabbed column display mode. + // Windows in this column will appear as vertical tabs, + // rather than stacked on top of each other. + Mod+W { + toggle-column-tabbed-display + } + Print { + screenshot + } + Shift+Print { + screenshot-window + } + Shift+Ctrl+Print hotkey-overlay-title="Edit image in Clipboard" { + spawn-sh "wl-paste | swappy -f -" + } + // Applications such as remote-desktop clients and software KVM switches may + // request that niri stops processing the keyboard shortcuts defined here + // so they may, for example, forward the key presses as-is to a remote machine. + // It's a good idea to bind an escape hatch to toggle the inhibitor, + // so a buggy application can't hold your session hostage. + // + // The allow-inhibiting=false property can be applied to other binds as well, + // which ensures niri always processes them, even when an inhibitor is active. + Mod+Escape allow-inhibiting=false { + toggle-keyboard-shortcuts-inhibit + } + // The quit action will show a confirmation dialog to avoid accidental exits. + Mod+Shift+E { + quit + } + Ctrl+Alt+Delete { + quit + } +} +// ── Environment Variables ─────────────────────────────────────────── +environment { + QT_STYLE_OVERRIDE "kvantum" + QT_AUTO_SCREEN_SCALE_FACTOR "1" + QT_QPA_PLATFORM "wayland;xcb" + QT_WAYLAND_DISABLE_WINDOWDECORATION "1" + QT_QPA_PLATFORMTHEME "qt5ct" + MOZ_ENABLE_WAYLAND "1" + XCURSOR_SIZE "24" + GTK_THEME "catppuccin-macchiato-teal-standard-default" + SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket" + EDITOR "nvim" + VISUAL "nvim" + TERMINAL "/usr/bin/kitty" +} +// ── Display Options ───────────────────────────────────────────────── +output "eDP-1" { + off +} +output "HDMI-A-1" { + scale 1 + mode "3440x1440" +} +output "DP-1" { + variable-refresh-rate on-demand=true +} +// ── Input Options ─────────────────────────────────────────────────── input { - keyboard { - xkb { - layout "latam" - options "caps:escape" - } - // Enable numlock on startup, omitting this setting disables it. - numlock + keyboard { + xkb { + layout "latam" + options "caps:escape" } - // 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 + // 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 { + } + mouse { // off // natural-scroll // accel-speed 0.2 // accel-profile "flat" // scroll-method "no-scroll" - } - trackpoint { + } + trackpoint { // off // natural-scroll // accel-speed 0.2 @@ -41,53 +459,11 @@ input { // scroll-button-lock // middle-emulation - } - // warp-mouse-to-focus - focus-follows-mouse + } + // warp-mouse-to-focus + focus-follows-mouse } -output "DP-1" { - variable-refresh-rate on-demand=true -} -layout { - gaps 10 - always-center-single-column - center-focused-column "never" - preset-column-widths { - // The default preset widths are 1/3, 1/2 and 2/3 of the output. - proportion 0.33333 - proportion 0.5 - proportion 0.66667 - } - preset-window-heights { - - } - default-column-width { - - } - focus-ring { - // Uncomment this line to disable the focus ring. - // off - // How many logical pixels the ring extends out from the windows. - width 2 - active-color "#7fc8ff" - inactive-color "#505050" - } -} -spawn-at-startup "/usr/lib/pam_kwallet_init" -spawn-at-startup "udieskiiw" -spawn-at-startup "brave" -// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: -// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" -hotkey-overlay { - skip-at-startup -} -// Uncomment this line to ask the clients to omit their client-side decorations if possible. -// If the client will specifically ask for CSD, the request will be honored. -// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. -// This option will also fix border/focus ring drawing behind some semitransparent windows. -// After enabling or disabling this, you need to restart the apps for this to take effect. -// prefer-no-csd -screenshot-path null +// ── Animations ────────────────────────────────────────────────────── animations { // Uncomment to turn off all animations. // off @@ -96,348 +472,19 @@ animations { // slowdown 3.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="^org\\.wezfurlong\\.wezterm$" - default-column-width { - - } -} -window-rule { - match app-id="firefox$" title="^Picture-in-Picture$" - open-floating true -} -window-rule { - match app-id="^org\\.keepassxc\\.KeePassXC$" - match app-id="^org\\.gnome\\.World\\.Secrets$" - // block-out-from "screen-capture" - // Use this instead if you want them visible on third-party screenshot tools. - block-out-from "screencast" -} -window-rule { - match app-id="brave-browser" - match at-startup=true - default-column-width { - proportion 0.75 - } -} -window-rule { - geometry-corner-radius 4 - clip-to-geometry true -} -binds { - Mod+Shift+Slash { - show-hotkey-overlay - } - Mod+Return hotkey-overlay-title="Open a Terminal: kitty" { - spawn "kitty" - } - Mod+D hotkey-overlay-title="Run an Application: Rofi" { - spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}" - } - XF86AudioRaiseVolume allow-when-locked=true { - spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+" - } - XF86AudioLowerVolume allow-when-locked=true { - spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-" - } - 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" - } - XF86MonBrightnessUp allow-when-locked=true { - spawn "brightnessctl" "--class=backlight" "set" "+10%" - } - XF86MonBrightnessDown allow-when-locked=true { - spawn "brightnessctl" "--class=backlight" "set" "10%-" - } - // Open/close the Overview: a zoomed-out view of workspaces and windows. - // You can also move the mouse into the top-left hot corner, - // or do a four-finger swipe up on a touchpad. - Mod+A repeat=false { - toggle-overview - } - Mod+Shift+Q repeat=false { - close-window - } - Mod+Tab { - focus-column-right-or-first - } - Mod+shift+Tab { - focus-column-left-or-last - } - 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+H { - focus-column-left - } - Mod+J { - focus-window-or-workspace-down - } - Mod+K { - focus-window-or-workspace-up - } - Mod+L { - 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+Shift+H { - move-column-left - } - Mod+Shift+J { - move-window-down-or-to-workspace-down - } - Mod+Shift+K { - move-window-up-or-to-workspace-up - } - Mod+Shift+L { - move-column-right - } - 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+WheelScrollDown cooldown-ms=150 { - focus-column-right - } - Mod+WheelScrollUp cooldown-ms=150 { - focus-column-left - } - Mod+Ctrl+WheelScrollDown cooldown-ms=150 { - move-column-to-workspace-down - } - Mod+Ctrl+WheelScrollUp cooldown-ms=150 { - move-column-to-workspace-up - } - Mod+WheelScrollRight { - focus-column-right - } - Mod+WheelScrollLeft { - focus-column-left - } - Mod+Ctrl+WheelScrollRight { - move-column-right - } - Mod+Ctrl+WheelScrollLeft { - move-column-left - } - Mod+Shift+WheelScrollDown cooldown-ms=150 { - focus-workspace-down - } - Mod+Shift+WheelScrollUp cooldown-ms=150 { - focus-workspace-up - } - Mod+Ctrl+Shift+WheelScrollDown { - move-column-right - } - Mod+Ctrl+Shift+WheelScrollUp { - move-column-left - } - // Similarly, you can bind touchpad scroll "ticks". - // Touchpad scrolling is continuous, so for these binds it is split into - // discrete intervals. - // These binds are also affected by touchpad's natural-scroll, so these - // example binds are "inverted", since we have natural-scroll enabled for - // touchpads by default. - // Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; } - // Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; } - 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+Shift+1 { - move-window-to-workspace 1 - } - Mod+Shift+2 { - move-window-to-workspace 2 - } - Mod+Shift+3 { - move-window-to-workspace 3 - } - Mod+Shift+4 { - move-window-to-workspace 4 - } - Mod+Shift+5 { - move-window-to-workspace 5 - } - Mod+Shift+6 { - move-window-to-workspace 6 - } - Mod+Shift+7 { - move-window-to-workspace 7 - } - Mod+Shift+8 { - move-window-to-workspace 8 - } - Mod+Shift+9 { - move-window-to-workspace 9 - } - // Switches focus between the current and the previous workspace. - Mod+Bar { - focus-workspace-previous - } - // The following binds move the focused window in and out of a column. - // If the window is alone, they will consume it into the nearby column to the side. - // If the window is already in a column, they will expel it out. - Mod+BraceLeft { - consume-or-expel-window-left - } - Mod+BraceRight { - consume-or-expel-window-right - } - // Consume one window from the right to the bottom of the focused column. - Mod+Comma { - consume-window-into-column - } - // Expel the bottom window from the focused column to the right. - Mod+Period { - expel-window-from-column - } - Mod+R { - switch-preset-column-width - } - // Cycling through the presets in reverse order is also possible. - // Mod+R { switch-preset-column-width-back; } - Mod+Shift+R { - switch-preset-window-height - } - Mod+Ctrl+R { - reset-window-height - } - Mod+F { - maximize-column - } - Mod+Shift+F { - fullscreen-window - } - // Expand the focused column to space not taken up by other fully visible columns. - // Makes the column "fill the rest of the space". - Mod+Ctrl+F { - expand-column-to-available-width - } - Mod+C { - center-column - } - // Center all fully visible columns on screen. - Mod+Ctrl+C { - center-visible-columns - } - // Finer width adjustments. - // This command can also: - // * set width in pixels: "1000" - // * adjust width in pixels: "-5" or "+5" - // * set width as a percentage of screen width: "25%" - // * adjust width as a percentage of screen width: "-10%" or "+10%" - // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, - // set-column-width "100" will make the column occupy 200 physical screen pixels. - Mod+Minus { - set-column-width "-10%" - } - Mod+Plus { - set-column-width "+10%" - } - // Finer height adjustments when in column with other windows. - Mod+Shift+Minus { - set-window-height "-10%" - } - Mod+Shift+Equal { - set-window-height "+10%" - } - // Move the focused window between the floating and the tiling layout. - Mod+Shift+Space { - toggle-window-floating - } - Mod+Space { - switch-focus-between-floating-and-tiling - } - // Toggle tabbed column display mode. - // Windows in this column will appear as vertical tabs, - // rather than stacked on top of each other. - Mod+W { - toggle-column-tabbed-display - } - Print { - screenshot - } - Shift+Ctrl+Print { - screenshot-screen - } - Shift+Print { - screenshot-window - } - // Applications such as remote-desktop clients and software KVM switches may - // request that niri stops processing the keyboard shortcuts defined here - // so they may, for example, forward the key presses as-is to a remote machine. - // It's a good idea to bind an escape hatch to toggle the inhibitor, - // so a buggy application can't hold your session hostage. - // - // The allow-inhibiting=false property can be applied to other binds as well, - // which ensures niri always processes them, even when an inhibitor is active. - Mod+Escape allow-inhibiting=false { - toggle-keyboard-shortcuts-inhibit - } - // The quit action will show a confirmation dialog to avoid accidental exits. - Mod+Shift+E { - quit - } - Ctrl+Alt+Delete { - quit - } -} +// ── Misc ──────────────────────────────────────────────────────────── +cursor { + xcursor-theme "catppuccin-macchiato-lavender-cursors" + xcursor-size 24 +} +hotkey-overlay { + skip-at-startup +} +// Uncomment this line to ask the clients to omit their client-side decorations if possible. +// If the client will specifically ask for CSD, the request will be honored. +// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. +// This option will also fix border/focus ring drawing behind some semitransparent windows. +// After enabling or disabling this, you need to restart the apps for this to take effect. +// prefer-no-csd +screenshot-path null diff --git a/configs/nvim/lua/aleidk/options.lua b/configs/nvim/lua/aleidk/options.lua index 2334a40..da04eeb 100644 --- a/configs/nvim/lua/aleidk/options.lua +++ b/configs/nvim/lua/aleidk/options.lua @@ -36,6 +36,7 @@ opt.pumblend = 10 -- Popup blend opt.pumheight = 10 -- Maximum number of entries in a popup -- opt.relativenumber = true -- Relative line numbers opt.scrolloff = 15 -- Lines of context +opt.sidescrolloff = 25 -- Columns of context opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } opt.shiftround = true -- Round indent opt.shiftwidth = 2 -- Size of an indent diff --git a/kdlfmt.kdl b/kdlfmt.kdl new file mode 100644 index 0000000..69d621c --- /dev/null +++ b/kdlfmt.kdl @@ -0,0 +1,3 @@ +indent_size 2 +use_tabs #false + From e9edfb922a530703deb90bfb0889d024dd1e86a9 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 3 Nov 2025 09:37:13 -0300 Subject: [PATCH 02/10] add quick term support --- configs/ghostty/config | 5 +- configs/kitty/quick-access-terminal.conf | 120 +++++++++++++++++++++++ configs/lazygit/config.yml | 26 ++--- configs/niri/config.kdl | 20 +++- 4 files changed, 153 insertions(+), 18 deletions(-) create mode 100644 configs/kitty/quick-access-terminal.conf diff --git a/configs/ghostty/config b/configs/ghostty/config index 4d1ff59..fa8602d 100644 --- a/configs/ghostty/config +++ b/configs/ghostty/config @@ -1,7 +1,10 @@ -theme = catppuccin-macchiato +theme = Catppuccin Macchiato +font-family = JetBrainsMono Nerd Font # Common +keybind = global:ctrl+shift+x=toggle_quick_terminal + keybind = ctrl+space>o=write_selection_file:open keybind = ctrl+space>shift+o=write_selection_file:paste diff --git a/configs/kitty/quick-access-terminal.conf b/configs/kitty/quick-access-terminal.conf new file mode 100644 index 0000000..3d3949b --- /dev/null +++ b/configs/kitty/quick-access-terminal.conf @@ -0,0 +1,120 @@ +lines 30 + +#: The number of lines shown in the panel. Ignored for background, +#: centered, and vertical panels. If it has the suffix px then it sets +#: the height of the panel in pixels instead of lines. + +columns 200 + +#: The number of columns shown in the panel. Ignored for background, +#: centered, and horizontal panels. If it has the suffix px then it +#: sets the width of the panel in pixels instead of columns. + +edge top + +#: Which edge of the screen to place the panel on. Note that some +#: window managers (such as i3) do not support placing docked windows +#: on the left and right edges. The value background means make the +#: panel the "desktop wallpaper". Note that when using sway if you set +#: a background in your sway config it will cover the background drawn +#: using this kitten. Additionally, there are three more values: +#: center, center-sized and none. The value center anchors the panel +#: to all sides and covers the entire display (on macOS the part of +#: the display not covered by titlebar and dock). The panel can be +#: shrunk and placed using the margin parameters. The value none +#: anchors the panel to the top left corner and should be placed using +#: the margin parameters. Its size is set by lines and columns. The +#: value center-sized is just like none except that the panel is +#: centered instead of in the top left corner and the margins have no +#: effect. + +background_opacity 1 + +#: The background opacity of the window. This works the same as the +#: kitty option of the same name, it is present here as it has a +#: different default value for the quick access terminal. + +# hide_on_focus_loss no + +#: Hide the window when it loses keyboard focus automatically. Using +#: this option will force focus_policy to on-demand. + +# grab_keyboard no + +#: Grab the keyboard. This means global shortcuts defined in the OS +#: will be passed to kitty instead. Useful if you want to create an OS +#: modal window. How well this works depends on the OS/window +#: manager/desktop environment. On Wayland it works only if the +#: compositor implements the inhibit-keyboard-shortcuts protocol +#: . On macOS Apple doesn't allow applications to grab the +#: keyboard without special permissions, so it doesn't work. + +margin_left 50 + +#: Set the left margin for the panel, in pixels. Has no effect for +#: right edge panels. Only works on macOS and Wayland compositors that +#: supports the wlr layer shell protocol. + +margin_right 50 + +#: Set the right margin for the panel, in pixels. Has no effect for +#: left edge panels. Only works on macOS and Wayland compositors that +#: supports the wlr layer shell protocol. + +margin_top 10 + +#: Set the top margin for the panel, in pixels. Has no effect for +#: bottom edge panels. Only works on macOS and Wayland compositors +#: that supports the wlr layer shell protocol. + +# margin_bottom 0 + +#: Set the bottom margin for the panel, in pixels. Has no effect for +#: top edge panels. Only works on macOS and Wayland compositors that +#: supports the wlr layer shell protocol. + +# kitty_conf + +#: Path to config file to use for kitty when drawing the window. Can +#: be specified multiple times. By default, the normal kitty.conf is +#: used. Relative paths are resolved with respect to the kitty config +#: directory. + +kitty_override window_padding_width=0 8 + +#: Override individual kitty configuration options, can be specified +#: multiple times. Syntax: kitty_override name=value. For example: +#: kitty_override font_size=20. + +app_id kitty-quick-access + +#: On Wayland set the namespace of the layer shell surface. On X11 set +#: the WM_CLASS assigned to the quick access window. (Linux only) + +# output_name + +#: The panel can only be displayed on a single monitor (output) at a +#: time. This allows you to specify which output is used, by name. If +#: not specified the compositor will choose an output automatically, +#: typically the last output the user interacted with or the primary +#: monitor. Run kitten panel --output-name list to get a list of +#: available outputs. Use listjson for a json encoded output. Note +#: that on Wayland the output can only be set at panel creation time, +#: it cannot be changed after creation, nor is there anyway to display +#: a single panel on all outputs. Please complain to the Wayland +#: developers about this. + +# start_as_hidden no + +#: Whether to start the quick access terminal hidden. Useful if you +#: are starting it as part of system startup. + +# focus_policy exclusive + +#: On a Wayland compositor that supports the wlr layer shell protocol, +#: specify the focus policy for keyboard interactivity with the panel. +#: Please refer to the wlr layer shell protocol documentation for more +#: details. Note that different Wayland compositors behave very +#: differently with exclusive, your mileage may vary. On macOS, +#: exclusive and on-demand are currently the same. diff --git a/configs/lazygit/config.yml b/configs/lazygit/config.yml index d596e42..2d38e28 100644 --- a/configs/lazygit/config.yml +++ b/configs/lazygit/config.yml @@ -155,18 +155,18 @@ gui: # Config relating to git git: # See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md - paging: - # Value of the --color arg in the git diff command. Some pagers want this to be set to 'always' and some want it set to 'never' - colorArg: always - # e.g. - # diff-so-fancy - # delta --dark --paging=never - # ydiff -p cat -s --wrap --width={{columnWidth}} - pager: "" - # If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager). - useConfig: true - # e.g. 'difft --color=always' - externalDiffCommand: "" + pagers: + - # Value of the --color arg in the git diff command. Some pagers want this to be set to 'always' and some want it set to 'never' + colorArg: always + # e.g. + # diff-so-fancy + # delta --dark --paging=never + # ydiff -p cat -s --wrap --width={{columnWidth}} + pager: "" + # If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager). + useConfig: true + # e.g. 'difft --color=always' + externalDiffCommand: "" # Config relating to committing commit: # If true, pass '--signoff' flag when committing @@ -406,7 +406,7 @@ keybinding: viewResetOptions: D fetch: f toggleTreeView: '`' - openMergeTool: M + openMergeOptions: M openStatusFilter: copyFileInfoToClipboard: "y" branches: diff --git a/configs/niri/config.kdl b/configs/niri/config.kdl index 9581911..c33f17d 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/config.kdl @@ -38,6 +38,16 @@ window-rule { geometry-corner-radius 4 clip-to-geometry true } +layer-rule { + match namespace="kitty-quick-access" + geometry-corner-radius 12 + shadow { + on + spread 10 + softness 20 + offset x=-10 y=10 + } +} // ╭─────────────────────────────────────────────────────────╮ // │ Auto Start Apps │ // ╰─────────────────────────────────────────────────────────╯ @@ -83,6 +93,12 @@ binds { Mod+Return hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty" } + Mod+Shift+Return hotkey-overlay-title="Open Quick Terminal" { + spawn "kitten" "quick_access_terminal" + } + Mod+Shift+E hotkey-overlay-title="Open Code Editor" { + spawn-sh "kitten quick_access_terminal --instance-group editor-choice fish -c \"zeditor (zoxide query -i)\"" + } Mod+D hotkey-overlay-title="Run an Application: Rofi" { spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}" } @@ -381,10 +397,6 @@ binds { Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit } - // The quit action will show a confirmation dialog to avoid accidental exits. - Mod+Shift+E { - quit - } Ctrl+Alt+Delete { quit } From 14d8aed4a224b1991ca21e2908f02651e727f342 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 5 Nov 2025 09:44:48 -0300 Subject: [PATCH 03/10] update hypridle for niri --- configs/hypr/base/hypridle.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/hypr/base/hypridle.conf b/configs/hypr/base/hypridle.conf index a4b4f88..d96ac12 100644 --- a/configs/hypr/base/hypridle.conf +++ b/configs/hypr/base/hypridle.conf @@ -1,7 +1,7 @@ general { - lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. - before_sleep_cmd = loginctl lock-session # lock before suspend. - after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. + lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = niri msg action power-on-monitors # to avoid having to press a key twice to turn on the display. } listener { @@ -23,9 +23,9 @@ listener { } listener { - timeout = 330 # 5.5min - on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed - on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired. + timeout = 330 # 5.5min + on-timeout = niri msg action power-off-monitors # screen off when timeout has passed + on-resume = niri msg action power-on-monitors && brightnessctl -r # screen on when activity is detected after timeout has fired. } listener { From 47deec465646e8e38d7909ad6e99214e2d7c360a Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 6 Nov 2025 11:03:57 -0300 Subject: [PATCH 04/10] minor niri updates --- configs/niri/config.kdl | 6 ++ configs/niri/fix_float.py | 124 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 configs/niri/fix_float.py diff --git a/configs/niri/config.kdl b/configs/niri/config.kdl index c33f17d..190037a 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/config.kdl @@ -16,6 +16,11 @@ window-rule { match app-id="^brave-.*-Default$" // Extensions popup open-floating true } +// Full width window +window-rule { + match app-id="beekeeper-studio" + open-maximized true +} window-rule { match app-id="^org\\.keepassxc\\.KeePassXC$" match app-id="^org\\.gnome\\.World\\.Secrets$" @@ -51,6 +56,7 @@ layer-rule { // ╭─────────────────────────────────────────────────────────╮ // │ Auto Start Apps │ // ╰─────────────────────────────────────────────────────────╯ +spawn-at-startup "./fix_float.py" spawn-at-startup "/usr/lib/pam_kwallet_init" spawn-at-startup "udieskie" spawn-at-startup "brave" diff --git a/configs/niri/fix_float.py b/configs/niri/fix_float.py new file mode 100644 index 0000000..7090668 --- /dev/null +++ b/configs/niri/fix_float.py @@ -0,0 +1,124 @@ +#!/usr/bin/python3 +""" +Like open-float, but dynamically. Floats a window when it matches the rules. + +Some windows don't have the right title and app-id when they open, and only set +them afterward. This script is like open-float for those windows. + +Usage: fill in the RULES array below, then run the script. +""" + +import json +import os +import re +from dataclasses import dataclass, field +from socket import AF_UNIX, SHUT_WR, socket + + +@dataclass(kw_only=True) +class Match: + title: str | None = None + app_id: str | None = None + + def matches(self, window): + if self.title is None and self.app_id is None: + return False + + matched = True + + if self.title is not None: + matched &= re.search(self.title, window["title"]) is not None + if self.app_id is not None: + matched &= re.search(self.app_id, window["app_id"]) is not None + + return matched + + +@dataclass +class Rule: + match: list[Match] = field(default_factory=list) + exclude: list[Match] = field(default_factory=list) + + def matches(self, window): + if len(self.match) > 0 and not any(m.matches(window) for m in self.match): + return False + if any(m.matches(window) for m in self.exclude): + return False + + return True + + +# Write your rules here. One Rule() = one window-rule {}. +RULES = [ + # window-rule {} with one match. + Rule([Match(title="Bitwarden", app_id="^brave-.*-Default$")]), + # window-rule {} with one match and one exclude. + # Rule( + # [Match(title="rs")], + # exclude=[Match(app_id="Alacritty")], + # ), + # window-rule {} with two matches. + # Rule( + # [ + # Match(app_id="^foot$"), + # Match(app_id="^mpv$"), + # ] + # ), +] + + +if len(RULES) == 0: + print("fill in the RULES list, then run the script") + exit() + + +niri_socket = socket(AF_UNIX) +niri_socket.connect(os.environ["NIRI_SOCKET"]) +file = niri_socket.makefile("rw") + +_ = file.write('"EventStream"') +file.flush() +niri_socket.shutdown(SHUT_WR) + +windows = {} + + +def send(request): + with socket(AF_UNIX) as niri_socket: + niri_socket.connect(os.environ["NIRI_SOCKET"]) + file = niri_socket.makefile("rw") + _ = file.write(json.dumps(request)) + file.flush() + + +def float(id: int): + send({"Action": {"MoveWindowToFloating": {"id": id}}}) + send({"Action": {"SetWindowWidth": {"id": id, "change": {"SetProportion": 20}}}}) + send({"Action": {"SetWindowHeight": {"id": id, "change": {"SetProportion": 50}}}}) + + +def update_matched(win): + win["matched"] = False + if existing := windows.get(win["id"]): + win["matched"] = existing["matched"] + + matched_before = win["matched"] + win["matched"] = any(r.matches(win) for r in RULES) + if win["matched"] and not matched_before: + print(f"floating title={win['title']}, app_id={win['app_id']}") + float(win["id"]) + + +for line in file: + event = json.loads(line) + + if changed := event.get("WindowsChanged"): + for win in changed["windows"]: + update_matched(win) + windows = {win["id"]: win for win in changed["windows"]} + elif changed := event.get("WindowOpenedOrChanged"): + win = changed["window"] + update_matched(win) + windows[win["id"]] = win + elif changed := event.get("WindowClosed"): + del windows[changed["id"]] From d0ffade8ce8c250155f10323920e7487895826bc Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 12 Nov 2025 13:45:07 -0300 Subject: [PATCH 05/10] update lsp config --- configs/nvim/lazy-lock.json | 5 +++-- configs/nvim/lua/aleidk/options.lua | 18 ++---------------- configs/nvim/lua/aleidk/plugins/init.lua | 11 +++++++---- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index 35fbf0e..f7066e1 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -11,7 +11,8 @@ "hardtime.nvim": { "branch": "main", "commit": "3541ad24faff78274669eceaf130502eb7f1261a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }, "neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, @@ -19,7 +20,7 @@ "nvim-dap-view": { "branch": "main", "commit": "390dae6bf67f3342ebb481159932ef0fe54822ba" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, - "nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, + "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" }, "nvim-treesitter": { "branch": "main", "commit": "802195d8f1980db25a7a39a55f9a25df21756c73" }, "nvim-treesitter-context": { "branch": "master", "commit": "66a9b5fa9e806918b5fe3dba00c6cce7e230abd2" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, diff --git a/configs/nvim/lua/aleidk/options.lua b/configs/nvim/lua/aleidk/options.lua index da04eeb..3e2a011 100644 --- a/configs/nvim/lua/aleidk/options.lua +++ b/configs/nvim/lua/aleidk/options.lua @@ -142,6 +142,8 @@ vim.filetype.add({ pattern = { -- INFO: Match filenames like - ".env.example", ".env.local" and so on ["%.env%.[%w_.-]+"] = "dotenv", + ["compose.*%.ya?ml"] = "yaml.docker-compose", + ["docker-compose.*%.ya?ml"] = "yaml.docker-compose", [".*%.blade%.php"] = "blade", [".*%.hurl.*"] = "hurl", [".*/hypr/.*%.conf"] = "hyprlang", @@ -160,22 +162,6 @@ vim.lsp.config("rust-analyzer", { } }) -vim.lsp.enable({ - "bashls", - "biome", - "fish_lsp", - "gleam", - "gopls", - "hyprls", - "intelephense", - "jsonls", - "kotlin_lsp", - "lua_ls", - "nushell", - "pyright", - "ruff", - -- "rust_analyzer", -- managed by rustacean.nvim -}) vim.lsp.inlay_hint.enable(true) diff --git a/configs/nvim/lua/aleidk/plugins/init.lua b/configs/nvim/lua/aleidk/plugins/init.lua index 948f2b3..245f048 100644 --- a/configs/nvim/lua/aleidk/plugins/init.lua +++ b/configs/nvim/lua/aleidk/plugins/init.lua @@ -1,10 +1,13 @@ return { - 'neovim/nvim-lspconfig', - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically { - "mason-org/mason.nvim", - opts = {} + "mason-org/mason-lspconfig.nvim", + opts = {}, + dependencies = { + { "mason-org/mason.nvim", opts = {} }, + "neovim/nvim-lspconfig", + }, }, + 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically { "ckolkey/ts-node-action", dependencies = { "nvim-treesitter" }, From 0c60392b1f992e4bc9fee9375694f72eb2c63f1c Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 21 Nov 2025 09:08:15 -0300 Subject: [PATCH 06/10] minor update --- configs/niri/config.kdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/niri/config.kdl b/configs/niri/config.kdl index 190037a..68c2792 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/config.kdl @@ -32,7 +32,7 @@ window-rule { match app-id="brave-browser" match at-startup=true default-column-width { - proportion 0.75 + proportion 0.5 } } window-rule { From fc134591c2413fdd86cfb7c48733ff99453bce36 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 26 Nov 2025 10:05:55 -0300 Subject: [PATCH 07/10] add function to source .env files in fish --- configs/fish/functions/envsource.fish | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 configs/fish/functions/envsource.fish diff --git a/configs/fish/functions/envsource.fish b/configs/fish/functions/envsource.fish new file mode 100644 index 0000000..af570e4 --- /dev/null +++ b/configs/fish/functions/envsource.fish @@ -0,0 +1,7 @@ +function envsource + for line in (cat $argv | grep -v '^#') + set item (string split -m 1 '=' $line) + set -gx $item[1] $item[2] + echo "Exported key $item[1]" + end +end From a85aa9ee0f4181a3a442f5dc92b767735169b055 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 10 Dec 2025 16:42:29 -0300 Subject: [PATCH 08/10] add arch setup justfile --- .justfile | 49 +++++++++++++++++++ bootstrap/pkgs_arch.txt | 72 ++++++++++++++++++++++++++++ configs/nvim/init.lua | 1 + configs/nvim/lua/aleidk/commands.lua | 11 +++++ 4 files changed, 133 insertions(+) create mode 100644 .justfile create mode 100644 bootstrap/pkgs_arch.txt create mode 100644 configs/nvim/lua/aleidk/commands.lua diff --git a/.justfile b/.justfile new file mode 100644 index 0000000..af46a10 --- /dev/null +++ b/.justfile @@ -0,0 +1,49 @@ +packages_file := quote(justfile_directory() / "bootstrap/pkgs_arch.txt") + +bootstrap: setup_pacman setup_paru install_packages + + +install_packages: update_packages + paru -S --needed --noconfirm - < {{ packages_file }} + +update_packages: + paru -Syu --noconfirm + +clean_orphans: + -sudo pacman -Qdtq | sudo pacman -Rns - + @echo "\n\n{{ BLUE }}The following files are not owned by any package anymore:{{ NORMAL }}" + +# setup sudo: +# sudo loop +# show asterisk on password + +setup_pacman: + # add automatic updates + sudo sed -i \ + -e 's/#\?ParallelDownloads = [0-9]\+/ParallelDownloads = {{ num_cpus() }}/' \ + -e 's/#\?Color\+/Color/' \ + -e 's/#\?ILoveCandy\+/ILoveCandy/' \ + -e 's/#\?VerbosePkgLists\+/VerbosePkgLists/' \ + /etc/pacman.conf + +setup_paru: + #!/usr/bin/env bash + set -euxo pipefail + + if ! command -v paru &> /dev/null ; then + tmp=$(mktemp -d) + sudo pacman -S --needed base-devel + git clone https://aur.archlinux.org/paru.git "$tmp" + cd "$tmp" + makepkg -si + cd - + rm -rf "$tmp" + fi + + sudo sed -i \ + -e 's/#\?BottomUp\+/BottomUp/' \ + -e 's/#\?SudoLoop\+/SudoLoop/' \ + -e 's/#\?CombinedUpgrade\+/CombinedUpgrade/' \ + -e 's/#\?CleanAfter\+/CleanAfter/' \ + -e 's/#\?NewsOnUpgrade\+/NewsOnUpgrade/' \ + /etc/paru.conf diff --git a/bootstrap/pkgs_arch.txt b/bootstrap/pkgs_arch.txt new file mode 100644 index 0000000..705fde1 --- /dev/null +++ b/bootstrap/pkgs_arch.txt @@ -0,0 +1,72 @@ +age +atuin +brave-bin +bun-bin +catppuccin-cursors-macchiato +catppuccin-gtk-theme-macchiato +catppuccin-sddm-theme-macchiato +celluloid +deno +dotter-rs-bin +dunst +eza +fish +flatpak +fzf +git +gitleaks +gnome-disk-utility +just +kitty +kvantum +kvantum-theme-catppuccin-git +lazygit +limine +limine-mkinitcpio-hook +limine-snapper-sync +lostfiles +lxappearance +ly +nautilus +nautilus-admin-gtk4 +nautilus-image-converter +nautilus-open-any-terminal +neovim +noto-fonts +noto-fonts-cjk +noto-fonts-emoji +paccache-hook +plymouth-theme-catppuccin-macchiato-git +podman +pre-commit +pwvucontrol +qt5-wayland +qt6-wayland +rofi +rofi-rbw +rofimoji +rsync +sops +swappy +tailscale +tealdeer +trash-cli +ttf-dejavu +ttf-fira-code +ttf-fira-mono +ttf-fira-sans +ttf-firacode-nerd +ttf-jetbrains-mono-nerd +ttf-ms-win11-auto +ttf-nerd-fonts-symbols-mono +ttf-nunito +ttf-opensans +ttf-roboto +ttf-roboto-mono-nerd +udiskie +vim +wget +yazi +zed +zip +zoxide diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index ea65040..b926841 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -16,6 +16,7 @@ end vim.opt.rtp:prepend(lazypath) require("aleidk.options") +require("aleidk.commands") require("aleidk.autocmds") require("aleidk.keymaps") diff --git a/configs/nvim/lua/aleidk/commands.lua b/configs/nvim/lua/aleidk/commands.lua new file mode 100644 index 0000000..8fd969b --- /dev/null +++ b/configs/nvim/lua/aleidk/commands.lua @@ -0,0 +1,11 @@ +vim.api.nvim_create_user_command("SopsDecrypt", function(args) + vim.cmd([[! sops decrypt -i %]]) +end, { + desc = "Decrypt current file with sops", +}) + +vim.api.nvim_create_user_command("SopsEncrypt", function(args) + vim.cmd([[! sops encrypt -i %]]) +end, { + desc = "Decrypt current file with sops", +}) From 20f68e1dee1f37d26aaf536ec1a3197f5ea00b57 Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 12 Dec 2025 12:18:47 -0300 Subject: [PATCH 09/10] update niri for multi monitor support --- .dotter/aleidk-work-laptop.toml | 27 +------------------------ .dotter/global.toml | 2 +- .stylua.toml | 2 +- configs/niri/{ => base}/config.kdl | 19 +++++++----------- configs/niri/base/include/.gitkeep | 0 configs/niri/work-laptop/local.kdl | 32 ++++++++++++++++++++++++++++++ 6 files changed, 42 insertions(+), 40 deletions(-) rename configs/niri/{ => base}/config.kdl (97%) create mode 100644 configs/niri/base/include/.gitkeep create mode 100644 configs/niri/work-laptop/local.kdl diff --git a/.dotter/aleidk-work-laptop.toml b/.dotter/aleidk-work-laptop.toml index b1fe098..66baeae 100644 --- a/.dotter/aleidk-work-laptop.toml +++ b/.dotter/aleidk-work-laptop.toml @@ -3,31 +3,6 @@ packages = ["default"] [files] "configs/hypr/work-laptop/hyprland.conf" = "~/.config/hypr/include/work-laptop.conf" - - -[files."configs/niri/config.kdl"] -target = "~/.config/niri/config.kdl" -type = "template" -append = """ -window-rule { - match app-id="brave-work" - open-on-workspace "1" - open-focused true - - default-column-width { - proportion 0.5 - } -} -window-rule { - match app-id="brave-personal" - open-on-workspace "2" - open-focused false - - default-column-width { - proportion 0.5 - } -} - -""" +"configs/niri/work-laptop/local.kdl" = "~/.config/niri/include/local.kdl" [variables] diff --git a/.dotter/global.toml b/.dotter/global.toml index 36b6ef0..ff29554 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -39,4 +39,4 @@ depends = ["niri"] [default.variables] [niri.files] -"configs/niri" = "~/.config/niri" +"configs/niri/base" = "~/.config/niri" diff --git a/.stylua.toml b/.stylua.toml index f0f7a59..c38f62a 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -1,7 +1,7 @@ syntax = "All" column_width = 120 line_endings = "Unix" -indent_type = "indent_type" +indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferDouble" call_parentheses = "Always" diff --git a/configs/niri/config.kdl b/configs/niri/base/config.kdl similarity index 97% rename from configs/niri/config.kdl rename to configs/niri/base/config.kdl index 68c2792..4f340da 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/base/config.kdl @@ -1,10 +1,11 @@ +include "include/local.kdl" // ╭─────────────────────────────────────────────────────────╮ // │ Windows Rules │ // ╰─────────────────────────────────────────────────────────╯ 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. + // You can get away with just app-id="wezterm" f you want. match app-id="^org\\.wezfurlong\\.wezterm$" default-column-width { @@ -109,10 +110,10 @@ binds { spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}" } XF86AudioRaiseVolume allow-when-locked=true { - spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+" + spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.025+" } XF86AudioLowerVolume allow-when-locked=true { - spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-" + spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.025-" } XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" @@ -151,10 +152,10 @@ binds { focus-window-or-workspace-up } Mod+Right { - focus-column-right + focus-column-or-monitor-right } Mod+H { - focus-column-left + focus-column-or-monitor-left } Mod+J { focus-window-or-workspace-down @@ -163,7 +164,7 @@ binds { focus-window-or-workspace-up } Mod+L { - focus-column-right + focus-column-or-monitor-right } Mod+Shift+Left { move-column-left @@ -423,16 +424,10 @@ environment { TERMINAL "/usr/bin/kitty" } // ── Display Options ───────────────────────────────────────────────── -output "eDP-1" { - off -} output "HDMI-A-1" { scale 1 mode "3440x1440" } -output "DP-1" { - variable-refresh-rate on-demand=true -} // ── Input Options ─────────────────────────────────────────────────── input { keyboard { diff --git a/configs/niri/base/include/.gitkeep b/configs/niri/base/include/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/configs/niri/work-laptop/local.kdl b/configs/niri/work-laptop/local.kdl new file mode 100644 index 0000000..0e93f89 --- /dev/null +++ b/configs/niri/work-laptop/local.kdl @@ -0,0 +1,32 @@ +window-rule { + match app-id="brave-work" + open-on-workspace "1" + open-focused true + default-column-width { + proportion 0.5 + } +} +window-rule { + match app-id="brave-personal" + open-on-workspace "2" + open-focused false + default-column-width { + proportion 0.5 + } +} +output "HDMI-A-1" { + scale 1 + mode "3440x1440" + focus-at-startup + position x=1920 y=0 +} +output "eDP-1" { + mode "1920x1080@60.000" + position x=0 y=720 + layout { + default-column-width { + proportion 1.0 + } + } +} + From 6fa42a7c2da0367e1d07f9f2a62c19b48adf0314 Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 18 Dec 2025 09:20:46 -0300 Subject: [PATCH 10/10] mini update nvim config --- configs/fish/config.fish | 2 - configs/nvim/lua/aleidk/options.lua | 79 ++++++++++--------- .../lua/aleidk/plugins/language-support.lua | 45 +++++------ configs/nvim/lua/aleidk/plugins/training.lua | 25 +++--- 4 files changed, 78 insertions(+), 73 deletions(-) diff --git a/configs/fish/config.fish b/configs/fish/config.fish index cbde320..9f5e5f6 100644 --- a/configs/fish/config.fish +++ b/configs/fish/config.fish @@ -2,7 +2,5 @@ if status is-interactive # Commands to run in interactive sessions can go here zoxide init --cmd cd fish | source atuin init fish | source - - mise activate fish | source end diff --git a/configs/nvim/lua/aleidk/options.lua b/configs/nvim/lua/aleidk/options.lua index 3e2a011..cf76fb6 100644 --- a/configs/nvim/lua/aleidk/options.lua +++ b/configs/nvim/lua/aleidk/options.lua @@ -10,54 +10,54 @@ vim.o.diffopt = "vertical,closeoff,filler" local opt = vim.opt vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' + vim.opt.clipboard = "unnamedplus" end) -- opt.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages -- vim.o.exrc = true -- vim.opt.list = true -- Sets how neovim will display certain whitespace characters in the editor. -- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } -opt.autowrite = true -- Enable auto write -opt.breakindent = true -- Every wrapped line will continue visually indented +opt.autowrite = true -- Enable auto write +opt.breakindent = true -- Every wrapped line will continue visually indented opt.completeopt = "menu,menuone,noselect" -opt.conceallevel = 2 -- Hide * markup for bold and italic -opt.confirm = true -- Confirm to save changes before exiting modified buffer -opt.cursorline = true -- Enable highlighting of the current line -opt.expandtab = true -- Use spaces instead of tabs +opt.conceallevel = 2 -- Hide * markup for bold and italic +opt.confirm = true -- Confirm to save changes before exiting modified buffer +opt.cursorline = true -- Enable highlighting of the current line +opt.expandtab = true -- Use spaces instead of tabs opt.formatoptions = "jcroqlnt" -- tcqj opt.grepformat = "%f:%l:%c:%m" opt.grepprg = "rg --vimgrep" -opt.ignorecase = true -- Ignore case -opt.inccommand = 'split' -- Preview substitutions live, as you type! -opt.mouse = "a" -- Enable mouse mode -opt.nrformats = 'blank,bin,hex' -opt.number = true -- Print line number -opt.pumblend = 10 -- Popup blend -opt.pumheight = 10 -- Maximum number of entries in a popup +opt.ignorecase = true -- Ignore case +opt.inccommand = "split" -- Preview substitutions live, as you type! +opt.mouse = "a" -- Enable mouse mode +opt.nrformats = "blank,bin,hex" +opt.number = true -- Print line number +opt.pumblend = 10 -- Popup blend +opt.pumheight = 10 -- Maximum number of entries in a popup -- opt.relativenumber = true -- Relative line numbers -opt.scrolloff = 15 -- Lines of context -opt.sidescrolloff = 25 -- Columns of context +opt.scrolloff = 15 -- Lines of context +opt.sidescrolloff = 25 -- Columns of context opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } -opt.shiftround = true -- Round indent -opt.shiftwidth = 2 -- Size of an indent -opt.showmode = false -- Don't show mode since we have a statusline -opt.sidescrolloff = 8 -- Columns of context -opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -opt.smartcase = true -- Don't ignore case with capitals -opt.smartindent = true -- Insert indents automatically +opt.shiftround = true -- Round indent +opt.shiftwidth = 2 -- Size of an indent +opt.showmode = false -- Don't show mode since we have a statusline +opt.sidescrolloff = 8 -- Columns of context +opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time +opt.smartcase = true -- Don't ignore case with capitals +opt.smartindent = true -- Insert indents automatically opt.spelllang = { "en" } -opt.splitbelow = true -- Put new windows below current -opt.splitright = true -- Put new windows right of current -opt.tabstop = 2 -- Number of spaces tabs count for +opt.splitbelow = true -- Put new windows below current +opt.splitright = true -- Put new windows right of current +opt.tabstop = 2 -- Number of spaces tabs count for opt.termguicolors = true -- True color support opt.undofile = true opt.undolevels = 10000 -opt.updatetime = 200 -- Save swap file and trigger CursorHold +opt.updatetime = 200 -- Save swap file and trigger CursorHold opt.wildmode = "longest,list:full" -- Command-line completion mode -opt.winminwidth = 5 -- Minimum window width -opt.wrap = false -- Disable line wrap -vim.o.completeopt = 'noselect,menu,menuone,noinsert,popup' -vim.o.winborder = 'rounded' +opt.winminwidth = 5 -- Minimum window width +opt.wrap = false -- Disable line wrap +vim.o.completeopt = "noselect,menu,menuone,noinsert,popup" +vim.o.winborder = "rounded" vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" @@ -130,18 +130,18 @@ vim.filetype.add({ mdx = "mdx", log = "log", conf = "conf", - env = "dotenv", + -- env = "dotenv", }, -- Detect and apply filetypes based on the entire filename filename = { - [".env"] = "dotenv", + -- [".env"] = "dotenv", ["env"] = "dotenv", ["tsconfig.json"] = "jsonc", }, -- Detect and apply filetypes based on certain patterns of the filenames pattern = { -- INFO: Match filenames like - ".env.example", ".env.local" and so on - ["%.env%.[%w_.-]+"] = "dotenv", + -- ["%.env%.[%w_.-]+"] = "dotenv", ["compose.*%.ya?ml"] = "yaml.docker-compose", ["docker-compose.*%.ya?ml"] = "yaml.docker-compose", [".*%.blade%.php"] = "blade", @@ -157,11 +157,16 @@ vim.filetype.add({ vim.lsp.config("rust-analyzer", { tools = { code_actions = { - ui_select_fallback = true - } - } + ui_select_fallback = true, + }, + }, }) +vim.g.markdown_fenced_languages = { + "ts=typescript", +} + +vim.lsp.enable("denols") vim.lsp.inlay_hint.enable(true) diff --git a/configs/nvim/lua/aleidk/plugins/language-support.lua b/configs/nvim/lua/aleidk/plugins/language-support.lua index c47309b..bee76db 100644 --- a/configs/nvim/lua/aleidk/plugins/language-support.lua +++ b/configs/nvim/lua/aleidk/plugins/language-support.lua @@ -1,24 +1,25 @@ return { - { - 'mrcjkb/rustaceanvim', - version = '^6', -- Recommended - lazy = false, -- This plugin is already lazy - }, - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } } - }, - }, - }, - { - "pmizio/typescript-tools.nvim", - dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, - opts = {}, - } + { + "mrcjkb/rustaceanvim", + version = "^6", -- Recommended + lazy = false, -- This plugin is already lazy + }, + { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, + { + "pmizio/typescript-tools.nvim", + enabled = false, + dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, + opts = {}, + }, } diff --git a/configs/nvim/lua/aleidk/plugins/training.lua b/configs/nvim/lua/aleidk/plugins/training.lua index 6eb3bfc..47012a6 100644 --- a/configs/nvim/lua/aleidk/plugins/training.lua +++ b/configs/nvim/lua/aleidk/plugins/training.lua @@ -1,14 +1,15 @@ return { - { - "m4xshen/hardtime.nvim", - lazy = false, - dependencies = { "MunifTanjim/nui.nvim" }, - keys = { - { "uH", "Hardtime toggle", desc = "Toggle hardtime" } - }, - opts = { - max_count = 10, - disable_mouse = false, - }, - }, + { + "m4xshen/hardtime.nvim", + lazy = false, + dependencies = { "MunifTanjim/nui.nvim" }, + keys = { + { "uH", "Hardtime toggle", desc = "Toggle hardtime" }, + }, + opts = { + max_count = 10, + disable_mouse = false, + restriction_mode = "hint", + }, + }, }