From 326f5ade5b42e21450355bdbb0cf057e2c77b724 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Sun, 16 Mar 2025 14:10:39 +0200 Subject: [PATCH] niri config now pretty --- modules/home/desktop/niri/default.nix | 424 +++++++++++++------------- 1 file changed, 213 insertions(+), 211 deletions(-) diff --git a/modules/home/desktop/niri/default.nix b/modules/home/desktop/niri/default.nix index dd9db5b..892cbec 100644 --- a/modules/home/desktop/niri/default.nix +++ b/modules/home/desktop/niri/default.nix @@ -13,7 +13,7 @@ if hostname == "eldrid" then "chromeos" else "platform"; - xdgPictures = + xdgPics = config.xdg.userDirs.pictures; ifLaptop = lib.mkIf (hostname != "dunamis"); terminal = "ghostty"; @@ -457,68 +457,68 @@ in { // position x=1920 y=0 } output "Samsung Electric Company S24R65x H4TMA03291" { - position x=0 y=0 - variable-refresh-rate + position x=0 y=0 + variable-refresh-rate } output "Philips Consumer Electronics Company 27M2N5500 UK02418033254" { - mode "2560x1440@180.000" - variable-refresh-rate - position x=0 y=0 - scale 1.33 + mode "2560x1440@180.000" + variable-refresh-rate + position x=0 y=0 + scale 1.33 } output "PNP(AOC) 27V2G5 0x0000026C" { - position x=1920 y=0 - mode "1920x1080@74.973" - variable-refresh-rate + position x=1920 y=0 + mode "1920x1080@74.973" + variable-refresh-rate } cursor { - xcursor-theme "${config.stylix.cursor.name}" - xcursor-size ${cursor_size} - } + xcursor-theme "${config.stylix.cursor.name}" + xcursor-size ${cursor_size} + } layout { - gaps 11 - center-focused-column "never" // "on-overflow" - preset-column-widths { - proportion 0.33333 - proportion 0.5 - proportion 0.66667 - } + gaps 11 + center-focused-column "never" // "on-overflow" + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } - // default-column-width { proportion 0.9; } - default-column-width {} - tab-indicator { - active-color "#${config.lib.stylix.colors.base0A}" - inactive-color "#${config.lib.stylix.colors.base05}" - width 8 - gap 8 - corner-radius 4 - gaps-between-tabs 4 - length total-proportion=0.9 - position "left" - place-within-column - } - focus-ring { - //off - width 3 - active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0F}" angle=40 relative-to="workspace-view" - inactive-color "#${config.lib.stylix.colors.base03}" - } - struts { - left 52 - right 52 - } + // default-column-width { proportion 0.9; } + default-column-width {} + tab-indicator { + active-color "#${config.lib.stylix.colors.base0A}" + inactive-color "#${config.lib.stylix.colors.base05}" + width 8 + gap 8 + corner-radius 4 + gaps-between-tabs 4 + length total-proportion=0.9 + position "left" + place-within-column + } + focus-ring { + // off + width 3 + active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0F}" angle=40 relative-to="workspace-view" + inactive-color "#${config.lib.stylix.colors.base03}" + } + struts { + left 52 + right 52 + } } prefer-no-csd hotkey-overlay { - skip-at-startup + skip-at-startup } window-rule { - geometry-corner-radius 12 - clip-to-geometry true + geometry-corner-radius 12 + clip-to-geometry true } window-rule { match is-window-cast-target=true @@ -539,39 +539,31 @@ in { } } - screenshot-path "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" - // screenshot-path null + screenshot-path "${xdgPics}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" animations { - // off - slowdown 0.7 + slowdown 0.7 } window-rule { match title="TelegramDesktop" match app-id="org.telegram.desktop" - open-floating true - } - window-rule { match title="Картинка в картинці" - open-floating true - } - window-rule { match title="Picture-in-Picture" open-floating true } window-rule { - match app-id=r#"^org\.wezfurlong\.wezterm$"# + match app-id="org.wezfurlong.wezterm" default-column-width { proportion 1.0; } } window-rule { - match app-id=r#"^re\.sonny\.Junction$"# + match app-id="re.sonny.Junction" open-floating true open-focused true } window-rule { - match app-id=r#"^com\.mitchellh\.ghostty$"# + match app-id="com.mitchellh.ghostty" draw-border-with-background false } @@ -617,174 +609,184 @@ in { // } binds { - Mod+Shift+Slash { show-hotkey-overlay; } + Mod+Shift+Slash { show-hotkey-overlay; } - Mod+Return repeat=false { spawn "${terminal}"; } - Mod+Space repeat=false { spawn "${launcher}"; } - Mod+Shift+Space repeat=false { spawn "walker" "-m" "windows"; } - Super+Alt+L repeat=false { spawn "${lockscreen}"; } - Super+Alt+B repeat=false { spawn "${browser}"; } - Super+Alt+V repeat=false { spawn "copyq" "toggle"; } - Mod+Alt+Q { quit; } - Mod+Alt+P { power-off-monitors; } + Mod+Tab { focus-workspace-previous; } + Mod+C { center-column; } + Mod+M { maximize-column; } + Mod+H { set-column-width "50%"; } + Mod+T { switch-preset-column-width; } + Mod+V { toggle-column-tabbed-display; } + Mod+G { switch-focus-between-floating-and-tiling; } - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } - XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } - XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } - XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; } - XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } - XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + Mod+Ctrl+Comma { consume-or-expel-window-left; } + Mod+Ctrl+Period { consume-or-expel-window-right; } + + Mod+Ctrl+Q { close-window; } + Mod+Ctrl+M { fullscreen-window; } + Mod+Ctrl+G { toggle-window-floating; } + + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + Mod+Comma { set-column-width "-10%"; } + Mod+Period { set-column-width "+10%"; } + Mod+Shift+Comma { set-window-height "-10%"; } + Mod+Shift+Period { set-window-height "+10%"; } + Mod+Shift+T { reset-window-height; } + + Mod+Escape { switch-layout "next"; } + + Mod+Return repeat=false { spawn "${terminal}"; } + Mod+Space repeat=false { spawn "${launcher}"; } + Mod+Shift+Space repeat=false { spawn "walker" "-m" "windows"; } + Mod+Alt+L repeat=false { spawn "${lockscreen}"; } + Mod+Alt+B repeat=false { spawn "${browser}"; } + Mod+Alt+V repeat=false { spawn "copyq" "toggle"; } + + Mod+Ctrl+Shift+BracketLeft { quit; } + Mod+Ctrl+Shift+BracketRight { power-off-monitors; } + + Print { screenshot; } + Ctrl+Print { screenshot-screen; } + Shift+Print { screenshot-window; } + + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } + XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + + XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; } + Alt+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+" "-d" "${keyboard}::kbd_backlight"; } + Alt+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-" "-d" "${keyboard}::kbd_backlight"; } - XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; } - Alt+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+" "-d" "${keyboard}::kbd_backlight"; } - Alt+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-" "-d" "${keyboard}::kbd_backlight"; } + 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+${left} { focus-column-left; } + Mod+${down} { focus-window-or-workspace-down; } + Mod+${up} { focus-window-or-workspace-up; } + Mod+${right} { focus-column-right; } + Mod+Ctrl+Left { move-column-left; } + Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } + Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } + Mod+Ctrl+Right { move-column-right; } + Mod+Ctrl+${left} { move-column-left; } + Mod+Ctrl+${down} { move-window-down-or-to-workspace-down; } + Mod+Ctrl+${up} { move-window-up-or-to-workspace-up; } + Mod+Ctrl+${right} { move-column-right; } - 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+${left} { focus-column-left; } - Mod+${down} { focus-window-or-workspace-down; } - Mod+${up} { focus-window-or-workspace-up; } - Mod+${right} { focus-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+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } - Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } - Mod+Ctrl+Right { move-column-right; } - Mod+Ctrl+${left} { move-column-left; } - Mod+Ctrl+${down} { move-window-down-or-to-workspace-down; } - Mod+Ctrl+${up} { move-window-up-or-to-workspace-up; } - Mod+Ctrl+${right} { move-column-right; } + Mod+Shift+Left { focus-monitor-left; } + Mod+Shift+Down { focus-monitor-down; } + Mod+Shift+Up { focus-monitor-up; } + Mod+Shift+Right { focus-monitor-right; } + Mod+Shift+${left} { focus-monitor-left; } + Mod+Shift+${down} { focus-monitor-down; } + Mod+Shift+${up} { focus-monitor-up; } + Mod+Shift+${right} { focus-monitor-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+Shift+Ctrl+Left { move-column-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } + Mod+Shift+Ctrl+${left} { move-column-to-monitor-left; } + Mod+Shift+Ctrl+${down} { move-column-to-monitor-down; } + Mod+Shift+Ctrl+${up} { move-column-to-monitor-up; } + Mod+Shift+Ctrl+${right} { move-column-to-monitor-right; } - Mod+Shift+Left { focus-monitor-left; } - Mod+Shift+Down { focus-monitor-down; } - Mod+Shift+Up { focus-monitor-up; } - Mod+Shift+Right { focus-monitor-right; } - Mod+Shift+${left} { focus-monitor-left; } - Mod+Shift+${down} { focus-monitor-down; } - Mod+Shift+${up} { focus-monitor-up; } - Mod+Shift+${right} { focus-monitor-right; } + Mod+Next { focus-workspace-down; } + Mod+Prior { focus-workspace-up; } + Mod+Ctrl+Next { move-column-to-workspace-down; } + Mod+Ctrl+Prior { move-column-to-workspace-up; } + Mod+Shift+Next { move-workspace-down; } + Mod+Shift+Prior { move-workspace-up; } - Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } - Mod+Shift+Ctrl+${left} { move-column-to-monitor-left; } - Mod+Shift+Ctrl+${down} { move-column-to-monitor-down; } - Mod+Shift+Ctrl+${up} { move-column-to-monitor-up; } - Mod+Shift+Ctrl+${right} { move-column-to-monitor-right; } + Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } + Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } - // Mod+Page_Down { focus-workspace-down; } - // Mod+Page_Up { focus-workspace-up; } - // Mod+N { focus-workspace-down; } - // Mod+E { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { 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+Page_Down { move-workspace-down; } - Mod+Shift+Page_Up { move-workspace-up; } - // Mod+Shift+N { move-workspace-down; } - // Mod+Shift+U { move-workspace-up; } + Mod+Shift+WheelScrollDown { focus-column-right; } + Mod+Shift+WheelScrollUp { focus-column-left; } + Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } + Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } - Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } - Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } - Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } - Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } + Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } - Mod+WheelScrollRight { focus-column-right; } - Mod+WheelScrollLeft { focus-column-left; } - Mod+Ctrl+WheelScrollRight { move-column-right; } - Mod+Ctrl+WheelScrollLeft { move-column-left; } + // Mod+1 { focus-workspace "general"; } + // Mod+2 { focus-workspace "browse"; } + // Mod+3 { focus-workspace "chat"; } + // Mod+4 { focus-workspace "code"; } + // Mod+5 { focus-workspace "uni"; } + // Mod+6 { focus-workspace "games"; } + // Mod+7 { focus-workspace "sysadmin"; } + // Mod+8 { focus-workspace "media"; } + // Mod+9 { focus-workspace "bg"; } + // Mod+Ctrl+1 { move-column-to-workspace "general"; } + // Mod+Ctrl+2 { move-column-to-workspace "browse"; } + // Mod+Ctrl+3 { move-column-to-workspace "chat"; } + // Mod+Ctrl+4 { move-column-to-workspace "code"; } + // Mod+Ctrl+5 { move-column-to-workspace "uni"; } + // Mod+Ctrl+6 { move-column-to-workspace "games"; } + // Mod+Ctrl+7 { move-column-to-workspace "sysadmin"; } + // Mod+Ctrl+8 { move-column-to-workspace "media"; } + // Mod+Ctrl+9 { move-column-to-workspace "bg"; } - Mod+Shift+WheelScrollDown { focus-column-right; } - Mod+Shift+WheelScrollUp { focus-column-left; } - Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } - Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } + Mod+Q { focus-workspace 1; } + Mod+W { focus-workspace 2; } + Mod+F { focus-workspace 3; } + Mod+P { focus-workspace 4; } + Mod+B { focus-workspace 5; } + Mod+J { focus-workspace 6; } + Mod+L { focus-workspace 7; } + Mod+U { focus-workspace 8; } + Mod+Y { focus-workspace 9; } + Mod+Ctrl+Shift+Q { move-column-to-workspace 1; } + Mod+Ctrl+Shift+W { move-column-to-workspace 2; } + Mod+Ctrl+Shift+F { move-column-to-workspace 3; } + Mod+Ctrl+Shift+P { move-column-to-workspace 4; } + Mod+Ctrl+Shift+B { move-column-to-workspace 5; } + Mod+Ctrl+Shift+J { move-column-to-workspace 6; } + Mod+Ctrl+Shift+L { move-column-to-workspace 7; } + Mod+Ctrl+Shift+U { move-column-to-workspace 8; } + Mod+Ctrl+Shift+Y { move-column-to-workspace 9; } - Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } - Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } - - // Mod+1 { focus-workspace "general"; } - // Mod+2 { focus-workspace "browse"; } - // Mod+3 { focus-workspace "chat"; } - // Mod+4 { focus-workspace "code"; } - // Mod+5 { focus-workspace "uni"; } - // Mod+6 { focus-workspace "games"; } - // Mod+7 { focus-workspace "sysadmin"; } - // Mod+8 { focus-workspace "media"; } - // Mod+9 { focus-workspace "bg"; } - // Mod+Ctrl+1 { move-column-to-workspace "general"; } - // Mod+Ctrl+2 { move-column-to-workspace "browse"; } - // Mod+Ctrl+3 { move-column-to-workspace "chat"; } - // Mod+Ctrl+4 { move-column-to-workspace "code"; } - // Mod+Ctrl+5 { move-column-to-workspace "uni"; } - // Mod+Ctrl+6 { move-column-to-workspace "games"; } - // Mod+Ctrl+7 { move-column-to-workspace "sysadmin"; } - // Mod+Ctrl+8 { move-column-to-workspace "media"; } - // Mod+Ctrl+9 { move-column-to-workspace "bg"; } - - Mod+Q { focus-workspace 1; } - Mod+W { focus-workspace 2; } - Mod+F { focus-workspace 3; } - Mod+P { focus-workspace 4; } - Mod+B { focus-workspace 5; } - Mod+J { focus-workspace 6; } - Mod+L { focus-workspace 7; } - Mod+U { focus-workspace 8; } - Mod+Y { focus-workspace 9; } - Mod+Ctrl+Shift+Q { move-column-to-workspace 1; } - Mod+Ctrl+Shift+W { move-column-to-workspace 2; } - Mod+Ctrl+Shift+F { move-column-to-workspace 3; } - Mod+Ctrl+Shift+P { move-column-to-workspace 4; } - Mod+Ctrl+Shift+B { move-column-to-workspace 5; } - Mod+Ctrl+Shift+J { move-column-to-workspace 6; } - Mod+Ctrl+Shift+L { move-column-to-workspace 7; } - Mod+Ctrl+Shift+U { move-column-to-workspace 8; } - Mod+Ctrl+Shift+Y { move-column-to-workspace 9; } - - // Mod+Ctrl+1 { move-window-to-workspace 1; } - - Mod+Tab { focus-workspace-previous; } - - Mod+Ctrl+Comma { consume-or-expel-window-left; } - Mod+Ctrl+Period { consume-or-expel-window-right; } - - Mod+Comma { set-column-width "-10%"; } - Mod+Period { set-column-width "+10%"; } - Mod+T { switch-preset-column-width; } - Mod+H { set-column-width "50%"; } - Mod+Shift+Comma { set-window-height "-10%"; } - Mod+Shift+Period { set-window-height "+10%"; } - Mod+Shift+T { reset-window-height; } - - Mod+V { toggle-column-tabbed-display; } - Mod+M { maximize-column; } - Mod+G { switch-focus-between-floating-and-tiling; } - Mod+C { center-column; } - Mod+Ctrl+M { fullscreen-window; } - Mod+Ctrl+G { toggle-window-floating; } - - Mod+Ctrl+Q { close-window; } - Mod+Minus { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } - - Mod+Escape { switch-layout "next"; } - // Mod+Shift+Space { switch-layout "prev"; } - - Print { screenshot; } - Ctrl+Print { screenshot-screen; } - Alt+Print { screenshot-window; } + 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+Ctrl+Shift+1 { move-column-to-workspace 1; } + Mod+Ctrl+Shift+2 { move-column-to-workspace 2; } + Mod+Ctrl+Shift+3 { move-column-to-workspace 3; } + Mod+Ctrl+Shift+4 { move-column-to-workspace 4; } + Mod+Ctrl+Shift+5 { move-column-to-workspace 5; } + Mod+Ctrl+Shift+6 { move-column-to-workspace 6; } + Mod+Ctrl+Shift+7 { move-column-to-workspace 7; } + Mod+Ctrl+Shift+8 { move-column-to-workspace 8; } + Mod+Ctrl+Shift+9 { move-column-to-workspace 9; } } ''; in