Switch to niri - Episode 1: beginnings

This commit is contained in:
Schrottkatze 2025-03-12 02:00:13 +01:00
parent d0b7757741
commit ebaa206a81
Signed by: schrottkatze
SSH key fingerprint: SHA256:FPOYVeBy3QP20FEM42uWF1Wa/Qhlk+L3S2+Wuau/Auo
14 changed files with 343 additions and 13 deletions

View file

@ -20,7 +20,7 @@ in
enable = cfg.autoLogin.enable;
user = "jade";
};
defaultSession = "sway";
defaultSession = "niri";
sessionPackages = [
pkgs.sway
];

View file

@ -1,4 +1,5 @@
{...}: {
programs.niri.enable = true;
home-manager.users.jade = {...}: {
imports = [
./notifications.nix
@ -8,6 +9,7 @@
./panels
./xmonad
./sway
./niri
];
services.gpg-agent = {

View file

@ -0,0 +1,70 @@
{...}: {
programs.niri.settings.binds = {
# spawn terminal
"Mod+Return".action.spawn = "kitty";
"Mod+Return".repeat = false;
"Mod+D".action.spawn = ["wofi" "-S" "drun" "--allow-images"];
"Mod+D".repeat = false;
"Mod+Shift+E".action.quit = [];
"Mod+Shift+Q".action.close-window = [];
"Mod+Shift+Slash".action.show-hotkey-overlay = [];
# window/columns controls
"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 = [];
# monitor controls
"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 = [];
# workspace controls
"Mod+P".action.focus-workspace-up = [];
"Mod+N".action.focus-workspace-down = [];
"Mod+Ctrl+P".action.move-column-to-workspace-up = [];
"Mod+Ctrl+N".action.move-column-to-workspace-down = [];
"Mod+1".action.focus-workspace = 1;
"Mod+2".action.focus-workspace = 2;
"Mod+3".action.focus-workspace = 3;
"Mod+4".action.focus-workspace = 4;
"Mod+5".action.focus-workspace = 5;
"Mod+6".action.focus-workspace = 6;
"Mod+7".action.focus-workspace = 7;
"Mod+8".action.focus-workspace = 8;
"Mod+9".action.focus-workspace = 9;
"Mod+Shift+1".action.move-column-to-workspace = 1;
"Mod+Shift+2".action.move-column-to-workspace = 2;
"Mod+Shift+3".action.move-column-to-workspace = 3;
"Mod+Shift+4".action.move-column-to-workspace = 4;
"Mod+Shift+5".action.move-column-to-workspace = 5;
"Mod+Shift+6".action.move-column-to-workspace = 6;
"Mod+Shift+7".action.move-column-to-workspace = 7;
"Mod+Shift+8".action.move-column-to-workspace = 8;
"Mod+Shift+9".action.move-column-to-workspace = 9;
# column editing stuffs
"Mod+BracketLeft".action.consume-or-expel-window-left = [];
"Mod+BracketRight".action.consume-or-expel-window-right = [];
"Mod+F".action.maximize-column = [];
"Mod+Shift+F".action.fullscreen-window = [];
"Mod+C".action.center-column = [];
"Mod+Minus".action.set-column-width = "-5%";
"Mod+Equal".action.set-column-width = "+5%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+Equal".action.set-window-height = "+10%";
"Mod+W".action.toggle-column-tabbed-display = [];
};
}

View file

@ -0,0 +1,44 @@
{pkgs, ...}: {
imports = [
./xwayland-sat.nix
./screenshot.nix
./input.nix
./binds.nix
./style.nix
];
programs.niri.settings = {
outputs."eDP-1" = {
scale = 1.0;
};
spawn-at-startup = [
{
command = ["eww" "open-many" "topBar" "bottomBar"];
}
{
command = [
"${pkgs.swaybg}/bin/swaybg"
"-i"
"${../xmonad/wallpaper/wallpaper.jpg}"
"-m"
"fill"
];
}
];
window-rules = [
# TODO: privacy screen rules
# {
# geometry-corner-radius = let val = 1.; in {
# bottom-left = val;
# bottom-right = val;
# top-left = val;
# top-right = val;
# };
# clip-to-geometry = true;
# }
];
environment.ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
}

View file

@ -0,0 +1,14 @@
{...}: {
programs.niri.settings.input = {
keyboard = {
xkb = {
layout = "us";
variant = "altgr-intl";
};
};
touchpad = {
tap = true;
natural-scroll = true;
};
};
}

View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
programs.niri.settings = {
screenshot-path = "~/Pictures/screenshots/%Y-%m-%dT%H:%M:%S.png";
binds = {
"Print".action.screenshot = [];
"Ctrl+Print".action.screenshot-screen = [];
"Alt+Print".action.screenshot-window = [];
};
};
}

View file

@ -0,0 +1,54 @@
{...}: {
programs.niri.settings = {
cursor = {
theme = "phinger-cursors";
size = 16;
hide-when-typing = true;
hide-after-inactive-ms = 2500;
};
layout = {
gaps = 15;
focus-ring.enable = false;
border = {
enable = true;
width = 3;
inactive.gradient = {
from = "#f69ecf";
to = "#ff9a56";
in' = "oklch shorter hue";
relative-to = "window";
angle = 135;
};
active.gradient = {
from = "#f69ecf";
to = "#5bcefa";
in' = "oklch shorter hue";
relative-to = "window";
angle = 135;
};
};
center-focused-column = "never";
empty-workspace-above-first = false;
tab-indicator = {
hide-when-single-tab = true;
active.color = "#5bcefa";
inactive.color = "#3c3836";
gap = 1;
width = 3;
position = "left";
gaps-between-tabs = 0;
};
};
window-rules = [{
geometry-corner-radius = let val = 1.; in {
bottom-left = val;
bottom-right = val;
top-left = val;
top-right = val;
};
clip-to-geometry = true;
}];
};
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
programs.niri.settings = {
spawn-at-startup = [
{command = ["${pkgs.xwayland-satellite}/bin/xwayland-satellite"];}
];
environment.DISPLAY = ":0";
};
}

View file

@ -30,6 +30,7 @@
foreground = color15;
background = "#1d2021";
confirm_os_window_close = 0;
hide_window_decorations = true;
};
};
home.sessionVariables = {

View file

@ -5,6 +5,8 @@
}: {
home-manager.users.jade = {pkgs, ...}: {
home.packages = with pkgs; [
pastel
audacity
krita
gimp