Skip to content

Commit

Permalink
refactor: waybar module refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Oct 20, 2023
1 parent a1356eb commit b3228d6
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 55 deletions.
34 changes: 16 additions & 18 deletions modules/home/desktop/addons/waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ let

cfg = config.khanelinix.desktop.addons.waybar;

theme = builtins.readFile ./styles/catppuccin.css;
style = builtins.readFile ./styles/style.css;

custom-modules = import ./modules/custom-modules.nix { inherit config lib pkgs; };
default-modules = import ./modules/default-modules.nix { inherit lib pkgs; };
group-modules = import ./modules/group-modules.nix;
Expand All @@ -25,20 +28,26 @@ let
(lib.mkIf config.khanelinix.desktop.hyprland.enable hyprland-modules)
];

mainBar = {
bar = {
"layer" = "top";
"position" = "top";
"output" = "DP-1";

"margin-top" = 10;
"margin-left" = 20;
"margin-right" = 20;
# "modules-center" = [ "mpris" ];

"modules-left" = [
"group/power"
"hyprland/workspaces"
"custom/separator-left"
"hyprland/window"
];
};

mainBar = {
"output" = "DP-1";
# "modules-center" = [ "mpris" ];

"modules-right" = [
"group/tray"
"custom/separator-right"
Expand All @@ -52,19 +61,8 @@ let
};

secondaryBar = {
"layer" = "top";
"position" = "top";
"output" = "DP-3";
"margin-top" = 10;
"margin-left" = 20;
"margin-right" = 20;
"modules-center" = [ ];
"modules-left" = [
"group/power"
"hyprland/workspaces"
"custom/separator-left"
"hyprland/window"
];

"modules-right" = [
"group/tray-drawer"
"group/stats-drawer"
Expand Down Expand Up @@ -93,11 +91,11 @@ in

# TODO: make dynamic / support different number of bars etc
settings = {
mainBar = mkMerge [ mainBar all-modules ];
secondaryBar = mkMerge [ secondaryBar all-modules ];
mainBar = mkMerge [ bar mainBar all-modules ];
secondaryBar = mkMerge [ bar secondaryBar all-modules ];
};

style = ./style.css;
style = "${theme}${style}";
};
};
}
36 changes: 36 additions & 0 deletions modules/home/desktop/addons/waybar/styles/catppuccin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
*
* Catppuccin Macchiato palette
*
*/

@define-color base #24273a;
@define-color mantle #1e2030;
@define-color crust #181926;

@define-color text #cad3f5;
@define-color subtext0 #b8c0e0;
@define-color subtext1 #a5adcb;

@define-color surface0 #363a4f;
@define-color surface1 #494d64;
@define-color surface2 #5b6078;

@define-color overlay0 #6e738d;
@define-color overlay1 #8087a2;
@define-color overlay2 #939ab7;

@define-color blue #8aadf4;
@define-color lavender #b7bdf8;
@define-color sapphire #7dc4e4;
@define-color sky #91d7e3;
@define-color teal #8bd5ca;
@define-color green #a6da95;
@define-color yellow #eed49f;
@define-color peach #f5a97f;
@define-color maroon #ee99a0;
@define-color red #ed8796;
@define-color mauve #c6a0f6;
@define-color pink #f5bde6;
@define-color flamingo #f0c6c6;
@define-color rosewater #f4dbd6;
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
/*
*
* Catppuccin Macchiato palette
*
*/

@define-color base #24273a;
@define-color mantle #1e2030;
@define-color crust #181926;

@define-color text #cad3f5;
@define-color subtext0 #b8c0e0;
@define-color subtext1 #a5adcb;

@define-color surface0 #363a4f;
@define-color surface1 #494d64;
@define-color surface2 #5b6078;

@define-color overlay0 #6e738d;
@define-color overlay1 #8087a2;
@define-color overlay2 #939ab7;

@define-color blue #8aadf4;
@define-color lavender #b7bdf8;
@define-color sapphire #7dc4e4;
@define-color sky #91d7e3;
@define-color teal #8bd5ca;
@define-color green #a6da95;
@define-color yellow #eed49f;
@define-color peach #f5a97f;
@define-color maroon #ee99a0;
@define-color red #ed8796;
@define-color mauve #c6a0f6;
@define-color pink #f5bde6;
@define-color flamingo #f0c6c6;
@define-color rosewater #f4dbd6;

/**
* Custom styling for a catppuccin style waybar
* Config settings listed in order from left -> right on bar
Expand All @@ -49,6 +12,10 @@
border-radius: 0.75em;
}

custom-weather {
font-family: Noto Color Emoji;
}

window#waybar {
border: 2px solid @surface1;
background: @theme_base_color;
Expand Down

0 comments on commit b3228d6

Please sign in to comment.