mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-03 00:15:35 +02:00
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";
|
position = "top";
|
||||||
opposite = builtins.replaceStrings ["left" "right" "top" "bottom"] ["right" "left" "bottom" "top"] position;
|
opposite = builtins.replaceStrings ["left" "right" "top" "bottom"] ["right" "left" "bottom" "top"] position;
|
||||||
isVertical = position == "left" || position == "right";
|
isVertical = position == "left" || position == "right";
|
||||||
in
|
modules = {
|
||||||
{
|
|
||||||
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" ];
|
|
||||||
|
|
||||||
tray = {
|
tray = {
|
||||||
icon-size = 24;
|
icon-size = 24;
|
||||||
spacing = 8;
|
spacing = 8;
|
||||||
@ -102,6 +83,26 @@ in
|
|||||||
tooltip = false;
|
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 */ ''
|
style = with config.lib.stylix.colors; lib.mkForce /* css */ ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user