waybar: fix font size to be more usable on moby

This commit is contained in:
Colin 2024-03-01 04:45:02 +00:00
parent 81e02e2885
commit 37ddb2ae17
4 changed files with 19 additions and 11 deletions

View File

@ -30,6 +30,8 @@
workspace_layout = "tabbed";
};
sane.programs.waybar.fontSize = 14;
sane.gui.sxmo = {
nogesture = true;
settings = {

View File

@ -7,18 +7,20 @@ in
configOption = with lib; mkOption {
type = types.submodule {
options = {
extra_style = mkOption {
extraStyle = mkOption {
type = types.lines;
default = ''
/* default font-size is about 14px, which is good for moby, but not quite for larger displays */
window#waybar {
font-size: 16px;
}
'';
default = "";
description = ''
extra CSS rules to append to ~/.config/waybar/style.css
'';
};
fontSize = mkOption {
type = types.int;
default = 16;
description = ''
default font-size is about 14px, which is good for moby, but not quite for larger displays
'';
};
top = mkOption {
type = types.submodule {
# `attrsOf types.anything` (v.s. plain `attrs`) causes merging of the toplevel items.
@ -80,8 +82,10 @@ in
(pkgs.formats.json {}).generate "waybar-config.json" [
({ layer = "top"; } // cfg.config.top)
];
fs.".config/waybar/style.css".symlink.text =
(builtins.readFile ./waybar-style.css) + cfg.config.extra_style;
fs.".config/waybar/style.css".symlink.target = pkgs.substituteAll {
src = ./waybar-style.css;
inherit (cfg.config) extraStyle fontSize;
};
services.waybar = {
description = "swaybar graphical header bar/tray for sway";

View File

@ -14,6 +14,7 @@ window#waybar {
color: #ffffff;
transition-property: background-color;
transition-duration: .2s;
font-size: @fontSize@px;
}
.modules-right {
@ -99,3 +100,5 @@ window#waybar {
-gtk-icon-effect: highlight;
background-color: #e64291;
}
@extraStyle@

View File

@ -285,8 +285,7 @@ in
sane.programs.sway.enableFor.user.colin = true;
sane.programs.waybar.config = {
top = import ./waybar-top.nix;
# reset extra waybar style
extra_style = "";
fontSize = 14;
};
sane.programs.sway.config = {
# N.B. missing from upstream sxmo config here is: