feat: Niri additions
- Switch to unstable branch. - Run xwayland-sattelite as a serivce. - Initialise terminal windows at smaller widths. - Style & bind tabs. - Block out private windows. - Binds for dynamic casting.
This commit is contained in:
@@ -24,6 +24,14 @@ in {
|
||||
|
||||
services.polkit-gnome.enable = true;
|
||||
|
||||
systemd.user.services.xwayland-satellite =
|
||||
lib.mkIf cfg.xwayland-satellite.enable {
|
||||
Service.ExecStart =
|
||||
["${pkgs.xwayland-satellite}/bin/xwayland-satellite"];
|
||||
Unit.After = ["niri.service"];
|
||||
Unit.PartOf = ["niri.service"];
|
||||
};
|
||||
|
||||
programs.niri = {
|
||||
# Activates some Nixpkgs patches to help run Electron applications under
|
||||
# Wayland.
|
||||
@@ -33,9 +41,6 @@ in {
|
||||
|
||||
spawn-at-startup =
|
||||
[{ command = [ "${pkgs.swaynotificationcenter}/bin/swaync" ]; }]
|
||||
++ lib.optional
|
||||
cfg.xwayland-satellite.enable
|
||||
{ command = [ "${pkgs.xwayland-satellite}/bin/xwayland-satellite" ]; }
|
||||
++ lib.optional
|
||||
(! builtins.isNull cfg.wallpaper)
|
||||
{ command = [ "${pkgs.wbg}/bin/wbg" "${cfg.wallpaper}" ]; };
|
||||
@@ -85,6 +90,15 @@ in {
|
||||
offset.x = 5;
|
||||
offset.y = 5;
|
||||
};
|
||||
tab-indicator = {
|
||||
place-within-column = true;
|
||||
position = "top";
|
||||
# active.color = config.lib.stylix.colors.withHashtag.blue;
|
||||
inactive.color = config.lib.stylix.colors.withHashtag.base01;
|
||||
width = 8;
|
||||
corner-radius = 2.0;
|
||||
gaps-between-tabs = 10;
|
||||
};
|
||||
};
|
||||
prefer-no-csd = true;
|
||||
screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d %H-%M-%S.png";
|
||||
@@ -93,9 +107,41 @@ in {
|
||||
size = 24;
|
||||
};
|
||||
window-rules = [
|
||||
{
|
||||
{ # Set red borders to indicate that a window is being captured.
|
||||
matches = [
|
||||
{ title = "Element.*wishdir"; }
|
||||
{ is-window-cast-target = true; }
|
||||
];
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 2;
|
||||
active.color = "#f38ba8";
|
||||
inactive.color = "#7d0d2d";
|
||||
};
|
||||
border = {
|
||||
width = 2;
|
||||
inactive.color = "#7d0d2d";
|
||||
active.color = "#7d0d2d";
|
||||
};
|
||||
shadow = {
|
||||
color = "#7d0d2d70";
|
||||
softness = 30;
|
||||
spread = 10;
|
||||
offset.x = 0;
|
||||
offset.y = 0;
|
||||
};
|
||||
tab-indicator = {
|
||||
active.color = "#f38ba8";
|
||||
inactive.color = "#7d0d2d";
|
||||
};
|
||||
}
|
||||
{ # Block private DMs from screencast...
|
||||
matches = [
|
||||
{ title = "Element \\|"; }
|
||||
{ title = "^Discord \\| @"; }
|
||||
];
|
||||
excludes = [
|
||||
# ... except when explicitly targeting the window.
|
||||
{ is-window-cast-target = true; }
|
||||
];
|
||||
block-out-from = "screen-capture";
|
||||
}
|
||||
@@ -116,6 +162,13 @@ in {
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
{ # Start terminals with low width.
|
||||
matches = [
|
||||
{ app-id = "com\\.mitchellh\\.ghostty"; }
|
||||
{ title = "^\\*eshell\\*"; }
|
||||
];
|
||||
default-column-width.proportion = 1.0 / 3.0;
|
||||
}
|
||||
{
|
||||
# Enable rounded corners for all windows.
|
||||
geometry-corner-radius =
|
||||
@@ -136,10 +189,14 @@ in {
|
||||
"Mod+D".action.spawn = ["${pkgs.fuzzel}/bin/fuzzel"];
|
||||
"Mod+Shift+Slash".action.show-hotkey-overlay = [];
|
||||
|
||||
# Powers off the monitors. To turn them back on, do any input like
|
||||
# moving the mouse or pressing any other key.
|
||||
# Powers off the monitors. They will be powered back on upon any
|
||||
# keyboard/mouse input.
|
||||
"Mod+Shift+P".action.power-off-monitors = [];
|
||||
|
||||
"Mod+I".action.set-dynamic-cast-window = [];
|
||||
"Mod+Shift+I".action.set-dynamic-cast-monitor = [];
|
||||
"Mod+Ctrl+I".action.clear-dynamic-cast-target = [];
|
||||
|
||||
"Mod+BracketLeft".action.consume-or-expel-window-left = [];
|
||||
"Mod+BracketRight".action.consume-or-expel-window-right = [];
|
||||
"Mod+Comma".action.consume-window-into-column = [];
|
||||
@@ -154,8 +211,7 @@ in {
|
||||
"Mod+C".action.center-column = [];
|
||||
"Mod+M".action.maximize-column = [];
|
||||
"Mod+Shift+M".action.fullscreen-window = [];
|
||||
# Currently unreleased }:(.
|
||||
# "Mod+Ctrl+M".action.toggle-windowed-fullscreen = [];
|
||||
"Mod+Ctrl+M".action.toggle-windowed-fullscreen = [];
|
||||
|
||||
"Mod+Shift+S".action.screenshot = [];
|
||||
"Print".action.screenshot-screen = [];
|
||||
|
||||
@@ -8,10 +8,13 @@ in {
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
# Necessary for e.g. screensharing.
|
||||
xdg.portal = {
|
||||
|
||||
Reference in New Issue
Block a user