forked from extern/nix-config
waybar: Move modules to separate attribute set
Makes it possible to use the same modules in multiple bars.
This commit is contained in:
parent
bc6f862279
commit
c143c065a2
@ -6,26 +6,7 @@ let
|
||||
position = "top";
|
||||
opposite = builtins.replaceStrings ["left" "right" "top" "bottom"] ["right" "left" "bottom" "top"] position;
|
||||
isVertical = position == "left" || position == "right";
|
||||
in
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = position;
|
||||
width = if isVertical then 45 else null;
|
||||
height = if isVertical then null else 45;
|
||||
spacing = 8;
|
||||
|
||||
autohide = true;
|
||||
exclusive = false;
|
||||
autohide-starthidden = true;
|
||||
|
||||
modules-left = if icons then [ "wlr/taskbar" ] else [ "wlr/workspaces" "custom/new-workspace" ];
|
||||
modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ];
|
||||
|
||||
modules = {
|
||||
tray = {
|
||||
icon-size = 24;
|
||||
spacing = 8;
|
||||
@ -102,6 +83,26 @@ in
|
||||
tooltip = false;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
mainBar = modules // {
|
||||
layer = "top";
|
||||
position = position;
|
||||
width = if isVertical then 45 else null;
|
||||
height = if isVertical then null else 45;
|
||||
spacing = 8;
|
||||
|
||||
autohide = true;
|
||||
exclusive = false;
|
||||
autohide-starthidden = true;
|
||||
|
||||
modules-left = if icons then [ "wlr/taskbar" ] else [ "wlr/workspaces" "custom/new-workspace" ];
|
||||
modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ];
|
||||
};
|
||||
};
|
||||
|
||||
style = with config.lib.stylix.colors; lib.mkForce /* css */ ''
|
||||
|
Loading…
Reference in New Issue
Block a user