feat: per-profile niri preset column widths and default proportion

This commit is contained in:
2026-03-04 21:10:59 +01:00
parent aec3d58b1b
commit 3cc73f77bb
3 changed files with 200 additions and 180 deletions
+20 -4
View File
@@ -1,8 +1,25 @@
{ config, lib, ... }: { config, lib, ... }:
let let
c = config.theme.colors; c = config.theme.colors;
proportion = toString config.myConfig.niri.defaultColumnProportion;
presetWidths = builtins.concatStringsSep "\n "
(map (p: "proportion ${toString p}") config.myConfig.niri.presetColumnWidths);
in in
{ {
options.myConfig.niri = {
defaultColumnProportion = lib.mkOption {
type = lib.types.float;
default = 0.5;
description = "Default column width proportion";
};
presetColumnWidths = lib.mkOption {
type = lib.types.listOf lib.types.float;
default = [ 0.33333 0.5 0.66667 ];
description = "Preset column width proportions";
};
};
config = {
home.file.".config/xdg-desktop-portal/portals.conf".text = '' home.file.".config/xdg-desktop-portal/portals.conf".text = ''
[preferred] [preferred]
default=gtk default=gtk
@@ -39,11 +56,9 @@ in
background-color "transparent" background-color "transparent"
center-focused-column "never" center-focused-column "never"
preset-column-widths { preset-column-widths {
proportion 0.33333 ${presetWidths}
proportion 0.5
proportion 0.66667
} }
default-column-width { proportion 0.5; } default-column-width { proportion ${proportion}; }
border { border {
off off
width 4 width 4
@@ -184,4 +199,5 @@ in
include "dms/cursor.kdl" include "dms/cursor.kdl"
''; '';
}; };
};
} }
+3 -1
View File
@@ -1,12 +1,14 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
myConfig.wayland.enable = true;
imports = [ imports = [
../modules/kitty.nix ../modules/kitty.nix
../modules/emacs.nix ../modules/emacs.nix
../modules/niri.nix ../modules/niri.nix
../modules/dms.nix ../modules/dms.nix
]; ];
myConfig.wayland.enable = true;
myConfig.niri.defaultColumnProportion = 0.33333;
myConfig.niri.presetColumnWidths = [ 0.33333 0.5 0.66667 1.0 ];
home.packages = with pkgs; [ home.packages = with pkgs; [
# desktop specific packages # desktop specific packages
]; ];
+2
View File
@@ -7,6 +7,8 @@
../modules/dms.nix ../modules/dms.nix
]; ];
myConfig.wayland.enable = true; myConfig.wayland.enable = true;
myConfig.niri.defaultColumnProportion = 1.0;
myConfig.niri.presetColumnWidths = [ 0.5 1.0 ];
home.packages = with pkgs; [ home.packages = with pkgs; [
powertop powertop
acpi acpi