nwg-panel: make workspace numbers/hiding configurable

This commit is contained in:
Colin 2024-06-14 08:47:15 +00:00
parent 63a88da3b4
commit 65823507ad
3 changed files with 20 additions and 14 deletions

View File

@ -95,18 +95,7 @@
"angle": 0.0
},
"sway-workspaces": {
"numbers": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
],
"numbers": @workspaceNumbers,
"custom-labels": [],
"focused-labels": [],
"show-icon": @windowIcon@,
@ -115,7 +104,7 @@
"name-length": 40,
"mark-autotiling": true,
"mark-content": false,
"hide-empty": true,
"hide-empty": @workspaceHideEmpty@,
"show-layout": false,
"angle": 0.0
},

View File

@ -33,6 +33,20 @@ in
mediaPrevNext = mkEnableOption' true "display prev/next button in media";
windowIcon = mkEnableOption' true "display icon of active window";
windowTitle = mkEnableOption' true "display title of active window";
workspaceNumbers = mkOption {
type = types.listOf types.str;
default = [
# TODO: workspace 10 should be rendered as "TV"
"1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
];
description = ''
workspaces to monitor
'';
};
workspaceHideEmpty = mkOption {
type = types.bool;
default = true;
};
};
};
};
@ -47,8 +61,9 @@ in
# fs.".config/nwg-panel/style.css".symlink.target = ./style.css;
fs.".config/nwg-panel/config".symlink.target = pkgs.substituteAll {
src = ./config;
inherit (cfg.config) height windowIcon windowTitle;
inherit (cfg.config) height windowIcon windowTitle workspaceHideEmpty;
playerctlChars = if cfg.config.mediaTitle then 30 else 0;
workspaceNumbers = builtins.toJSON cfg.config.workspaceNumbers;
};
fs.".config/nwg-panel/style.css".symlink.target = pkgs.substituteAll {
src = ./style.css;

View File

@ -63,6 +63,8 @@
windowTitle = false;
mediaPrevNext = false;
mediaTitle = false;
workspaceNumbers = [ "1" "2" "3" "4" "5" ];
workspaceHideEmpty = false;
};
sane.programs.zsh.config.showDeadlines = false; # unlikely to act on them when in shell