{ config, pkgs, ... }: { programs.niri = { package = pkgs.niri-stable; settings = { prefer-no-csd = true; environment = { DISPLAY = ":0"; }; # skip the hotkey menu thingy hotkey-overlay.skip-at-startup = true; outputs = { "BOE 0x095F Unknown" = { scale = 1.5; }; }; layout = { gaps = 16; struts = { # left = 16; # right = 16; top = -8; # bottom = 16; }; focus-ring = { enable = true; active = { color = "#bf7778"; }; }; }; spawn-at-startup = [ # waybar (status bar) # { command = [ "${pkgs.waybar}/bin/waybar" ]; } { command = [ "${config.programs.eww.package}/bin/eww" "-c" "${config.programs.eww.configDir}" "open" "statusbar" ]; } # swaybg works on more than just sway (sets a wallpaper) { command = [ "${pkgs.swaybg}/bin/swaybg" "-i" "${../wallpaper.png}" ]; } # Xwayland on niri via xwayland-satellite { command = [ "${pkgs.xwayland-satellite}/bin/xwayland-satellite" config.programs.niri.settings.environment.DISPLAY ]; } ]; window-rules = [ { draw-border-with-background = false; } { geometry-corner-radius = let radius = 10.0; in { top-left = radius; top-right = radius; bottom-right = radius; bottom-left = radius; }; } { clip-to-geometry = true; } ]; # https://github.com/sodiboo/niri-flake/issues/591 switch-events = with config.lib.niri.actions; { "lid-close".action = spawn "${pkgs.swaylock}/bin/swaylock"; }; binds = with config.lib.niri.actions; { # Application launcher "Mod+Space".action = spawn [ "${pkgs.fuzzel}/bin/fuzzel" ]; # open a terminal "Mod+T".action = spawn "${pkgs.alacritty}/bin/alacritty"; # lock the screen "Mod+X".action = spawn "${pkgs.swaylock}/bin/swaylock"; # screenshotting "Print".action = screenshot; "Ctrl+Print".action = screenshot-screen; "Alt+Print".action = screenshot-window; # Volume control "XF86AudioRaiseVolume".action = spawn [ "${pkgs.avizo}/bin/volumectl" "-u" "up" ]; "XF86AudioLowerVolume".action = spawn [ "${pkgs.avizo}/bin/volumectl" "-u" "down" ]; "XF86AudioMute".action = spawn [ "${pkgs.avizo}/bin/volumectl" "toggle-mute" ]; # Display Brightness control "XF86MonBrightnessUp".action = spawn [ "${pkgs.avizo}/bin/lightctl" "up" ]; "XF86MonBrightnessDown".action = spawn [ "${pkgs.avizo}/bin/lightctl" "down" ]; # color picker and copies to clipboard "Mod+Ctrl+Alt+C".action = spawn [ "${pkgs.hyprpicker}/bin/hyprpicker" "-za" ]; # "Framework" key (F12) # "XF86AudioMedia".action = spawn []; # Force close a window "Mod+Q".action = close-window; "Mod+Shift+Q".action = quit; # bindings for window management "Mod+H".action = focus-column-left; "Mod+J".action = focus-window-down; "Mod+K".action = focus-window-up; "Mod+L".action = focus-column-right; "Mod+Ctrl+H".action = move-column-left; "Mod+Ctrl+J".action = move-window-down; "Mod+Ctrl+K".action = move-window-up; "Mod+Ctrl+L".action = move-column-right; #fine adjustments to height and width of window "Mod+Minus".action = set-column-width "-10%"; "Mod+Equal".action = set-column-width "+10%"; "Mod+Shift+Minus".action = set-window-height "-10%"; "Mod+Shift+Equal".action = set-window-height "+10%"; "Mod+Home".action = focus-column-first; "Mod+End".action = focus-column-last; "Mod+Ctrl+Home".action = move-column-to-first; "Mod+Ctrl+End".action = move-column-to-last; "Mod+Shift+H".action = focus-monitor-left; "Mod+Shift+J".action = focus-monitor-down; "Mod+Shift+K".action = focus-monitor-up; "Mod+Shift+L".action = focus-monitor-right; "Mod+Shift+Ctrl+H".action = move-column-to-monitor-left; "Mod+Shift+Ctrl+J".action = move-column-to-monitor-down; "Mod+Shift+Ctrl+K".action = move-column-to-monitor-up; "Mod+Shift+Ctrl+L".action = move-column-to-monitor-right; "Mod+Page_Down".action = focus-workspace-down; "Mod+Page_Up".action = focus-workspace-up; "Mod+U".action = focus-workspace-down; "Mod+I".action = focus-workspace-up; # move a window up and down workspaces "Mod+Ctrl+Page_Down".action = move-column-to-workspace-down; "Mod+Ctrl+Page_Up".action = move-column-to-workspace-up; "Mod+Ctrl+U".action = move-column-to-workspace-down; "Mod+Ctrl+I".action = move-column-to-workspace-up; # does little squeeze thing into the left or right position with another window "Mod+BracketLeft".action = consume-or-expel-window-left; "Mod+BracketRight".action = consume-or-expel-window-right; "Mod+R".action = switch-preset-column-width; "Mod+F".action = maximize-column; "Mod+Shift+F".action = fullscreen-window; "Mod+C".action = center-column; }; }; }; }