refactor(waybar): use bar margin
This commit is contained in:
@@ -53,11 +53,6 @@ in
|
|||||||
|
|
||||||
registry.waybar.${config.networking.hostName}."custom/dnd" = {
|
registry.waybar.${config.networking.hostName}."custom/dnd" = {
|
||||||
order = 80;
|
order = 80;
|
||||||
style = ''
|
|
||||||
#custom-dnd {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
settings = {
|
settings = {
|
||||||
return-type = "json";
|
return-type = "json";
|
||||||
exec = "${dndStatus}";
|
exec = "${dndStatus}";
|
||||||
|
|||||||
@@ -7,12 +7,6 @@
|
|||||||
}:
|
}:
|
||||||
# Waybar: a top status bar reading system state at a glance.
|
# Waybar: a top status bar reading system state at a glance.
|
||||||
let
|
let
|
||||||
registeredWaybarStyles = lib.concatStringsSep "\n" (
|
|
||||||
lib.filter (style: style != "") (lib.mapAttrsToList (_name: module: module.style) hostWaybarModules)
|
|
||||||
);
|
|
||||||
|
|
||||||
hostWaybarModules = lib.attrByPath [ config.networking.hostName ] { } config.registry.waybar;
|
|
||||||
|
|
||||||
waybarModulesFor =
|
waybarModulesFor =
|
||||||
position:
|
position:
|
||||||
map (module: module.name) (
|
map (module: module.name) (
|
||||||
@@ -29,6 +23,8 @@ let
|
|||||||
}
|
}
|
||||||
) hostWaybarModules;
|
) hostWaybarModules;
|
||||||
|
|
||||||
|
hostWaybarModules = lib.attrByPath [ config.networking.hostName ] { } config.registry.waybar;
|
||||||
|
|
||||||
registeredWaybarModuleSettings = lib.mapAttrs (_name: module: module.settings) hostWaybarModules;
|
registeredWaybarModuleSettings = lib.mapAttrs (_name: module: module.settings) hostWaybarModules;
|
||||||
|
|
||||||
networkStatus = pkgs.writeShellScript "waybar-network-status" ''
|
networkStatus = pkgs.writeShellScript "waybar-network-status" ''
|
||||||
@@ -79,19 +75,13 @@ in
|
|||||||
# so the bar comes up with the session and no compositor exec-once.
|
# so the bar comes up with the session and no compositor exec-once.
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
|
||||||
style = ''
|
|
||||||
.modules-right {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
+ registeredWaybarStyles;
|
|
||||||
|
|
||||||
settings.mainBar = lib.mkMerge [
|
settings.mainBar = lib.mkMerge [
|
||||||
{
|
{
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 30;
|
height = 30;
|
||||||
spacing = 8;
|
spacing = 8;
|
||||||
|
margin-right = 8;
|
||||||
|
|
||||||
modules-left = waybarModulesFor "left";
|
modules-left = waybarModulesFor "left";
|
||||||
modules-center = waybarModulesFor "center";
|
modules-center = waybarModulesFor "center";
|
||||||
|
|||||||
@@ -19,12 +19,6 @@
|
|||||||
description = "Sorts the module within its Waybar section.";
|
description = "Sorts the module within its Waybar section.";
|
||||||
};
|
};
|
||||||
|
|
||||||
style = lib.mkOption {
|
|
||||||
type = lib.types.lines;
|
|
||||||
default = "";
|
|
||||||
description = "Adds CSS for the Waybar module.";
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = lib.types.attrsOf lib.types.anything;
|
type = lib.types.attrsOf lib.types.anything;
|
||||||
default = { };
|
default = { };
|
||||||
|
|||||||
Reference in New Issue
Block a user