refactor: restructure config files
This commit is contained in:
@@ -0,0 +1,211 @@
|
||||
{
|
||||
browserCommand,
|
||||
terminalCommand,
|
||||
}:
|
||||
{
|
||||
"Mod+Return" = {
|
||||
action.spawn = terminalCommand;
|
||||
hotkey-overlay.title = "Terminal";
|
||||
};
|
||||
"Mod+B" = {
|
||||
action.spawn = browserCommand;
|
||||
hotkey-overlay.title = "Browser";
|
||||
};
|
||||
"Mod+Space" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
"vicinae"
|
||||
"toggle"
|
||||
];
|
||||
hotkey-overlay.title = "App Launcher";
|
||||
};
|
||||
|
||||
"XF86AudioPlay" = {
|
||||
action.spawn-sh = "playerctl play-pause";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioStop" = {
|
||||
action.spawn-sh = "playerctl stop";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioPrev" = {
|
||||
action.spawn-sh = "playerctl previous";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioNext" = {
|
||||
action.spawn-sh = "playerctl next";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioRaiseVolume" = {
|
||||
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioMicMute" = {
|
||||
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86MonBrightnessUp" = {
|
||||
action.spawn-sh = "brightnessctl s 5%+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86MonBrightnessDown" = {
|
||||
action.spawn-sh = "brightnessctl s 5%-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
|
||||
"Mod+S".action.screenshot = [ ];
|
||||
"Mod+Ctrl+S".action.screenshot-screen = [ ];
|
||||
"Mod+Alt+S".action.screenshot-window = [ ];
|
||||
|
||||
"Mod+Shift+Slash".action.show-hotkey-overlay = [ ];
|
||||
"Mod+Escape" = {
|
||||
action.toggle-keyboard-shortcuts-inhibit = [ ];
|
||||
allow-inhibiting = false;
|
||||
};
|
||||
"Mod+Alt+L" = {
|
||||
action.spawn-sh = "loginctl lock-session";
|
||||
hotkey-overlay.title = "Lock Screen";
|
||||
};
|
||||
"Mod+Shift+E".action.quit = [ ];
|
||||
"Ctrl+Alt+Delete".action.quit = [ ];
|
||||
"Mod+Shift+P".action.power-off-monitors = [ ];
|
||||
|
||||
"Mod+O" = {
|
||||
action.toggle-overview = [ ];
|
||||
repeat = false;
|
||||
};
|
||||
"Mod+Q" = {
|
||||
action.close-window = [ ];
|
||||
repeat = false;
|
||||
};
|
||||
|
||||
"Mod+H".action.focus-column-or-monitor-left = [ ];
|
||||
"Mod+J".action.focus-window-down = [ ];
|
||||
"Mod+K".action.focus-window-up = [ ];
|
||||
"Mod+L".action.focus-column-or-monitor-right = [ ];
|
||||
|
||||
"Mod+Ctrl+Left".action.move-column-left = [ ];
|
||||
"Mod+Ctrl+Down".action.move-window-down = [ ];
|
||||
"Mod+Ctrl+Up".action.move-window-up = [ ];
|
||||
"Mod+Ctrl+Right".action.move-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 = [ ];
|
||||
|
||||
"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+Left".action.focus-monitor-left = [ ];
|
||||
"Mod+Shift+Down".action.focus-monitor-down = [ ];
|
||||
"Mod+Shift+Up".action.focus-monitor-up = [ ];
|
||||
"Mod+Shift+Right".action.focus-monitor-right = [ ];
|
||||
"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+Left".action.move-column-to-monitor-left = [ ];
|
||||
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [ ];
|
||||
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [ ];
|
||||
"Mod+Shift+Ctrl+Right".action.move-column-to-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 = [ ];
|
||||
|
||||
"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 = [ ];
|
||||
|
||||
"Mod+Shift+Page_Down".action.move-workspace-down = [ ];
|
||||
"Mod+Shift+Page_Up".action.move-workspace-up = [ ];
|
||||
"Mod+Shift+U".action.move-workspace-down = [ ];
|
||||
"Mod+Shift+I".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+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+Ctrl+1".action.move-column-to-workspace = 1;
|
||||
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
|
||||
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
|
||||
"Mod+Ctrl+4".action.move-column-to-workspace = 4;
|
||||
"Mod+Ctrl+5".action.move-column-to-workspace = 5;
|
||||
"Mod+Ctrl+6".action.move-column-to-workspace = 6;
|
||||
"Mod+Ctrl+7".action.move-column-to-workspace = 7;
|
||||
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
|
||||
"Mod+Ctrl+9".action.move-column-to-workspace = 9;
|
||||
|
||||
"Mod+BracketLeft".action.consume-or-expel-window-left = [ ];
|
||||
"Mod+BracketRight".action.consume-or-expel-window-right = [ ];
|
||||
"Mod+Comma".action.consume-window-into-column = [ ];
|
||||
"Mod+Period".action.expel-window-from-column = [ ];
|
||||
|
||||
"Mod+R".action.switch-preset-column-width = [ ];
|
||||
"Mod+Shift+R".action.switch-preset-window-height = [ ];
|
||||
"Mod+Ctrl+R".action.reset-window-height = [ ];
|
||||
"Mod+F".action.maximize-column = [ ];
|
||||
"Mod+Shift+F".action.fullscreen-window = [ ];
|
||||
"Mod+M".action.maximize-window-to-edges = [ ];
|
||||
"Mod+Ctrl+F".action.expand-column-to-available-width = [ ];
|
||||
"Mod+C".action.center-column = [ ];
|
||||
"Mod+Ctrl+C".action.center-visible-columns = [ ];
|
||||
|
||||
"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+V".action.toggle-window-floating = [ ];
|
||||
"Mod+Shift+V".action.switch-focus-between-floating-and-tiling = [ ];
|
||||
"Mod+W".action.toggle-column-tabbed-display = [ ];
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.niri =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ inputs.niri.nixosModules.niri ];
|
||||
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
|
||||
|
||||
programs.niri.enable = true;
|
||||
programs.niri.package = pkgs.niri-unstable;
|
||||
programs.dconf.enable = true;
|
||||
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
xdg.portal.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.niri =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
browserCommand = repo.desktop.browser.command;
|
||||
fileManagerPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
terminalCommand = config.repo.terminal.primary.command;
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
{
|
||||
position = {
|
||||
x = display.x;
|
||||
y = display.y;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (display.primary or false) {
|
||||
"focus-at-startup" = true;
|
||||
}
|
||||
// lib.optionalAttrs (display.scale != null) {
|
||||
inherit (display) scale;
|
||||
}
|
||||
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
|
||||
mode = {
|
||||
inherit (display)
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) osConfig.meta.machine.displays;
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = fileManagerPackage != null;
|
||||
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
|
||||
}
|
||||
];
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
playerctl
|
||||
brightnessctl
|
||||
xwayland-satellite
|
||||
]
|
||||
++ [ fileManagerPackage ];
|
||||
|
||||
programs.niri.settings = {
|
||||
inherit outputs;
|
||||
environment.DISPLAY = ":0";
|
||||
spawn-at-startup = [
|
||||
{ command = [ "xwayland-satellite" ]; }
|
||||
{ command = [ "noctalia-shell" ]; }
|
||||
];
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
|
||||
|
||||
animations.slowdown = 0.6;
|
||||
|
||||
cursor = with config.home.pointerCursor; {
|
||||
size = size;
|
||||
theme = name;
|
||||
hide-after-inactive-ms = 3000;
|
||||
hide-when-typing = true;
|
||||
};
|
||||
|
||||
layout = {
|
||||
always-center-single-column = true;
|
||||
gaps = 14;
|
||||
focus-ring.enable = false;
|
||||
|
||||
default-column-width.proportion = 1. / 2.;
|
||||
|
||||
border = {
|
||||
enable = true;
|
||||
width = 3;
|
||||
active.color = repoTheme.palette.niri.border.active;
|
||||
inactive.color = repoTheme.palette.niri.border.inactive;
|
||||
urgent.color = repoTheme.palette.niri.border.urgent;
|
||||
};
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius =
|
||||
let
|
||||
radius = 10.0;
|
||||
in
|
||||
{
|
||||
bottom-left = radius;
|
||||
bottom-right = radius;
|
||||
top-left = radius;
|
||||
top-right = radius;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
];
|
||||
|
||||
debug.honor-xdg-activation-with-invalid-serial = true;
|
||||
|
||||
input = {
|
||||
focus-follows-mouse.enable = true;
|
||||
mouse."accel-speed" = 0.4;
|
||||
keyboard = {
|
||||
repeat-delay = 300;
|
||||
repeat-rate = 50;
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
|
||||
touchpad = {
|
||||
dwt = true;
|
||||
};
|
||||
};
|
||||
|
||||
binds = import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
terminalCommand
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user