users/jordan: add niri config
This commit is contained in:
261
users/jordan/common/optional/graphical/niri.nix
Normal file
261
users/jordan/common/optional/graphical/niri.nix
Normal file
@@ -0,0 +1,261 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
getExe
|
||||
;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.niri.homeModules.niri
|
||||
];
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
config.niri = {
|
||||
default = [
|
||||
"gnome"
|
||||
"gtk"
|
||||
];
|
||||
"org.freedesktop.impl.portal.Access" = "gtk";
|
||||
"org.freedesktop.impl.portal.Notification" = "gtk";
|
||||
"org.freedesktop.impl.portal.Secret" = "gnome-keyring";
|
||||
"org.freedesktop.impl.portal.FileChooser" = "gtk";
|
||||
"org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ];
|
||||
"org.freedesktop.impl.portal.Screenshot" = [ "gnome" ];
|
||||
};
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-gnome
|
||||
];
|
||||
};
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
|
||||
settings = {
|
||||
xwayland-satellite.path = getExe pkgs.xwayland-satellite-stable;
|
||||
input = {
|
||||
keyboard = {
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "intl";
|
||||
};
|
||||
|
||||
repeat-delay = 235;
|
||||
repeat-rate = 60;
|
||||
};
|
||||
|
||||
touchpad = {
|
||||
tap = true;
|
||||
dwt = true;
|
||||
dwtp = true;
|
||||
natural-scroll = true;
|
||||
accel-profile = "flat";
|
||||
};
|
||||
|
||||
mouse = {
|
||||
accel-speed = 0.2;
|
||||
accel-profile = "flat";
|
||||
};
|
||||
|
||||
power-key-handling.enable = false;
|
||||
workspace-auto-back-and-forth = true;
|
||||
};
|
||||
|
||||
gestures.hot-corners.enable = false;
|
||||
debug.honor-xdg-activation-with-invalid-serial = true;
|
||||
binds = with config.lib.niri.actions; {
|
||||
"Mod+T".action = spawn "kitty";
|
||||
"Mod+b".action = spawn "firefox";
|
||||
"Super+Alt+L".action = spawn "systemctl suspend";
|
||||
XF86AudioRaiseVolume = {
|
||||
action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioLowerVolume = {
|
||||
action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioMute = {
|
||||
action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioMicMute = {
|
||||
action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"Mod+Q".action = close-window;
|
||||
|
||||
"Mod+n".action = focus-column-left;
|
||||
"Mod+left".action = focus-column-left;
|
||||
"Mod+Shift+n".action = move-column-left;
|
||||
"Mod+Shift+left".action = move-column-left;
|
||||
|
||||
"Mod+r".action = focus-window-or-workspace-down;
|
||||
"Mod+down".action = focus-window-or-workspace-down;
|
||||
"Mod+Shift+r".action = move-window-down;
|
||||
"Mod+Shift+down".action = move-window-down;
|
||||
|
||||
"Mod+l".action = focus-window-or-workspace-up;
|
||||
"Mod+up".action = focus-window-or-workspace-up;
|
||||
"Mod+Shift+l".action = move-window-up;
|
||||
"Mod+Shift+up".action = move-window-up;
|
||||
|
||||
"Mod+s".action = focus-column-right;
|
||||
"Mod+right".action = focus-column-right;
|
||||
"Mod+Shift+s".action = move-column-right;
|
||||
"Mod+Shift+right".action = move-column-right;
|
||||
|
||||
"Mod+h".action = focus-column-first;
|
||||
"Mod+Shift+h".action = consume-or-expel-window-left;
|
||||
"Mod+m".action = focus-column-last;
|
||||
"Mod+Shift+m".action = consume-or-expel-window-right;
|
||||
|
||||
"Mod+Ctrl+n".action = focus-monitor-left;
|
||||
"Mod+Shift+Ctrl+n".action = move-column-to-monitor-left;
|
||||
"Mod+Ctrl+r".action = focus-monitor-down;
|
||||
"Mod+Shift+Ctrl+r".action = move-column-to-monitor-down;
|
||||
"Mod+Ctrl+l".action = focus-monitor-up;
|
||||
"Mod+Shift+Ctrl+l".action = move-column-to-monitor-up;
|
||||
"Mod+Ctrl+s".action = focus-monitor-right;
|
||||
"Mod+Shift+Ctrl+s".action = move-column-to-monitor-right;
|
||||
|
||||
"Mod+Period".action = focus-workspace-down;
|
||||
"Mod+Shift+Period".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+Period".action = move-workspace-down;
|
||||
"Mod+comma".action = focus-workspace-up;
|
||||
"Mod+Shift+comma".action = move-column-to-workspace-up;
|
||||
"Mod+Ctrl+comma".action = move-workspace-up;
|
||||
|
||||
"Mod+WheelScrollDown" = {
|
||||
action = focus-workspace-down;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+WheelScrollUp" = {
|
||||
action = focus-workspace-up;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
action = move-column-to-workspace-down;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
action = move-column-to-workspace-up;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+WheelScrollRight".action = focus-column-right;
|
||||
"Mod+WheelScrollLeft".action = focus-column-left;
|
||||
"Mod+Ctrl+WheelScrollRight".action = move-column-right;
|
||||
"Mod+Ctrl+WheelScrollLeft".action = move-column-left;
|
||||
"Mod+Shift+WheelScrollDown".action = focus-column-right;
|
||||
"Mod+Shift+WheelScrollUp".action = focus-column-left;
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action = move-column-right;
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action = move-column-left;
|
||||
|
||||
"Mod+V".action = maximize-column;
|
||||
"Mod+Ctrl+V".action = expand-column-to-available-width;
|
||||
"Mod+return".action = fullscreen-window;
|
||||
"Mod+Minus".action = set-column-width "-10%";
|
||||
"Mod+Shift+0".action = set-column-width "+10%";
|
||||
|
||||
"Mod+F".action = toggle-window-floating;
|
||||
"Mod+Ctrl+F".action = switch-focus-between-floating-and-tiling;
|
||||
|
||||
"Mod+y".action = toggle-column-tabbed-display;
|
||||
|
||||
#"Print".action = screenshot;
|
||||
#"Ctrl+Print".action = screenshot-screen {};
|
||||
#"Alt+Print".action = screenshot-window;
|
||||
|
||||
"Mod+Escape" = {
|
||||
action = toggle-keyboard-shortcuts-inhibit;
|
||||
allow-inhibiting = false;
|
||||
};
|
||||
|
||||
# The quit action will show a confirmation dialog to avoid accidental exits.
|
||||
"Mod+Ctrl+Escape".action = quit;
|
||||
# Powers off the monitors. To turn them back on, do any input like
|
||||
# moving the mouse or pressing any other key.
|
||||
"Mod+Shift+P".action = power-off-monitors;
|
||||
};
|
||||
|
||||
spawn-at-startup = [
|
||||
{ command = [ "firefox" ]; }
|
||||
];
|
||||
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay = {
|
||||
skip-at-startup = true;
|
||||
};
|
||||
layout = {
|
||||
gaps = 1;
|
||||
center-focused-column = "never";
|
||||
empty-workspace-above-first = true;
|
||||
preset-column-widths = [
|
||||
{ proportion = 0.33333; }
|
||||
{ proportion = 0.5; }
|
||||
{ proportion = 0.66667; }
|
||||
];
|
||||
default-column-width = {
|
||||
proportion = 0.5;
|
||||
};
|
||||
preset-window-heights = [
|
||||
{ proportion = 0.33333; }
|
||||
{ proportion = 0.5; }
|
||||
{ proportion = 0.66667; }
|
||||
];
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 2;
|
||||
active.color = "#7fc8ff";
|
||||
inactive.color = "#505050";
|
||||
};
|
||||
border = {
|
||||
enable = false;
|
||||
width = 2;
|
||||
active.color = "#ffc87f";
|
||||
inactive.color = "#505050";
|
||||
};
|
||||
shadow = {
|
||||
# on
|
||||
softness = 30;
|
||||
spread = 5;
|
||||
offset = {
|
||||
x = 0;
|
||||
y = 5;
|
||||
};
|
||||
draw-behind-window = true;
|
||||
color = "#00000070";
|
||||
# inactive-color "#00000054"
|
||||
};
|
||||
tab-indicator = {
|
||||
# off
|
||||
hide-when-single-tab = true;
|
||||
place-within-column = true;
|
||||
gap = 5;
|
||||
width = 4;
|
||||
length = {
|
||||
total-proportion = 1.0;
|
||||
};
|
||||
position = "right";
|
||||
gaps-between-tabs = 2;
|
||||
corner-radius = 8;
|
||||
active.color = "red";
|
||||
inactive.color = "gray";
|
||||
};
|
||||
insert-hint = {
|
||||
# off
|
||||
display.color = "#ffc87f80";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
imports = [
|
||||
./common/optional/graphical/firefox.nix
|
||||
./common/optional/graphical/fonts.nix
|
||||
./common/optional/graphical/hyprland
|
||||
./common/optional/graphical/niri.nix
|
||||
./common/optional/graphical/mimeapps.nix
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user