phase 2: move home-manager/ → home/{profiles,progs,util,wallpaper}
This commit is contained in:
229
home/progs/niri.nix
Normal file
229
home/progs/niri.nix
Normal file
@@ -0,0 +1,229 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
niri-package,
|
||||
...
|
||||
}:
|
||||
let
|
||||
invert_image_avg = pkgs.callPackage ../util/inverse_color.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.niri.homeModules.config
|
||||
(
|
||||
{ ... }:
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
inputs.niri.overlays.niri
|
||||
];
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
programs.niri = {
|
||||
package = niri-package;
|
||||
settings = {
|
||||
prefer-no-csd = true;
|
||||
|
||||
input = {
|
||||
touchpad = {
|
||||
scroll-factor = 0.4;
|
||||
};
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
disable-primary = true;
|
||||
};
|
||||
|
||||
# skip the hotkey menu thingy
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
|
||||
layout = {
|
||||
gaps = 16;
|
||||
struts = {
|
||||
# left = 16;
|
||||
# right = 16;
|
||||
top = -8;
|
||||
# bottom = 16;
|
||||
};
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
active = {
|
||||
color = builtins.readFile (invert_image_avg {
|
||||
src = ../wallpaper.png;
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
||||
|
||||
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; }
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^zen";
|
||||
title = "^Picture-in-Picture$";
|
||||
}
|
||||
{
|
||||
app-id = "Mullvad VPN";
|
||||
}
|
||||
];
|
||||
|
||||
open-floating = true;
|
||||
default-column-width = {
|
||||
fixed = 480;
|
||||
};
|
||||
default-window-height = {
|
||||
fixed = 270;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# XF86AudioMedia allow-when-locked=true { spawn "playerctl" "play-pause"; }
|
||||
# XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
|
||||
# XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
|
||||
# XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
|
||||
|
||||
# https://github.com/sodiboo/niri-flake/issues/591
|
||||
switch-events = with config.lib.niri.actions; {
|
||||
"lid-close".action = spawn (lib.getExe pkgs.swaylock);
|
||||
};
|
||||
|
||||
binds = with config.lib.niri.actions; {
|
||||
# Application launcher
|
||||
"Mod+Space".action = spawn (lib.getExe pkgs.fuzzel);
|
||||
|
||||
# TODO! make this work
|
||||
"Mod+E".action = spawn "${config.programs.doom-emacs.finalDoomPackage}/bin/doom-emacs";
|
||||
|
||||
"Mod+O".action = toggle-overview;
|
||||
|
||||
# open a terminal
|
||||
"Mod+T".action = spawn config.home.sessionVariables.TERMINAL;
|
||||
|
||||
# lock the screen
|
||||
"Mod+X".action = spawn (lib.getExe pkgs.swaylock);
|
||||
|
||||
# screenshotting
|
||||
"Print".action.screenshot = [ ];
|
||||
|
||||
# https://github.com/sodiboo/niri-flake/commit/a7949bd0f5551fdfffd04cb9735ad3cd3167d624#r153571513
|
||||
# "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 [
|
||||
(lib.getExe pkgs.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user