diff --git a/modules/home/programs/wayland/waybar/default.nix b/modules/home/programs/wayland/waybar/default.nix
index a01103a..ac99b09 100644
--- a/modules/home/programs/wayland/waybar/default.nix
+++ b/modules/home/programs/wayland/waybar/default.nix
@@ -21,91 +21,64 @@ in {
systemd.enable = true;
# https://gitlab.com/Zaney/zaneyos/-/blob/main/config/waybar.nix
- settings = [
+ settings = let
+ niri =
+ config.programs.niri
+ # HM module doesn't include an enable option...
+ // {
+ enable = config.marleyos.wayland.niri.enable;
+ };
+ in [
{
layer = "top";
position = "top";
- modules-left = [
- "custom/startmenu"
- "hyprland/window"
- "pulseaudio"
- "cpu"
- "memory"
- "idle_inhibitor"
- ];
- modules-center = ["hyprland/workspaces"];
- modules-right = [
- "custom/notifications"
- "custom/exit"
- "battery"
- "tray"
- "clock"
- ];
+ modules-left =
+ [
+ "custom/startmenu"
+ ]
+ ++ (lib.optionals niri.enable [
+ "niri/window"
+ ])
+ ++ [
+ "pulseaudio"
+ "cpu"
+ "memory"
+ "idle_inhibitor"
+ ];
+ modules-center =
+ []
+ ++ (lib.optionals niri.enable [
+ "niri/workspaces"
+ ]);
+ modules-right =
+ [
+ "custom/notifications"
+ "tray"
+ ]
+ ++ (lib.optionals (!config.marleyos.isDesktop) [
+ "battery"
+ ])
+ ++ [
+ "network"
+ "custom/exit"
+ "clock"
+ ];
- "hyprland/workspaces" = let
- hyprctl =
- lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
- in {
- format = "{name}";
- format-icons = {
- default = " ";
- active = " ";
- urgent = " ";
- };
- on-scroll-up = "${hyprctl} dispatch workspace e+1";
- on-scroll-down = "${hyprctl} dispatch workspace e-1";
+ "custom/startmenu" = {
+ tooltip = false;
+ format = "";
+ on-click = let
+ inherit (config.marleyos.apps) launcher;
+ in "sleep 0.1 && ${lib.getExe launcher.package} ${launcher.command}";
};
- "clock" = {
- format = " {:L%I:%M %p}";
- tooltip = true;
- tooltip-format = "{:%A, %d.%B %Y }\n{calendar}";
- };
-
- "hyprland/window" = {
- max-length = 22;
- separate-outputs = false;
+ "niri/window" = lib.mkIf niri.enable {
rewrite = {
"" = " 🙈 No Windows? ";
};
};
- "memory" = {
- interval = 5;
- format = " {}%";
- tooltip = true;
- };
-
- "cpu" = {
- interval = 5;
- format = " {usage:2}%";
- tooltip = true;
- };
-
- "disk" = {
- format = " {free}";
- tooltip = true;
- };
-
- "network" = {
- format-icons = [
- ""
- ""
- ""
- ""
- ""
- ];
- format-ethernet = " {bandwidthDownOctets}";
- format-wifi = "{icon} {signalStrength}%";
- format-disconnected = "";
- tooltip = false;
- };
-
- "tray" = {
- spacing = 12;
- };
-
"pulseaudio" = {
format = "{icon} {volume}% {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
@@ -129,18 +102,16 @@ in {
on-click = "sleep 0.1 && ${lib.getExe pkgs.pwvucontrol}";
};
- "custom/exit" = {
- tooltip = false;
- format = "";
- on-click = "sleep 0.1 && ${lib.getExe config.programs.wlogout.package}";
+ "cpu" = {
+ interval = 5;
+ format = " {usage:2}%";
+ tooltip = true;
};
- "custom/startmenu" = {
- tooltip = false;
- format = "";
- on-click = let
- inherit (config.marleyos.apps) launcher;
- in "sleep 0.1 && ${lib.getExe launcher.package} ${launcher.command}";
+ "memory" = {
+ interval = 5;
+ format = " {}%";
+ tooltip = true;
};
"idle_inhibitor" = {
@@ -152,6 +123,19 @@ in {
tooltip = "true";
};
+ "niri/workspaces" = lib.mkIf niri.enable (let
+ niriMsg = msg: "${lib.getExe niri.package} msg action ${msg}";
+ in {
+ format = "{value}";
+ format-icons = {
+ default = " ";
+ active = " ";
+ urgent = " ";
+ };
+ on-scroll-up = niriMsg "focus-workspace-up";
+ on-scroll-down = niriMsg "focus-workspace-down";
+ });
+
"custom/notifications" = let
swaync-client =
lib.getExe' config.services.swaync.package "swaync-client";
@@ -174,6 +158,10 @@ in {
escape = true;
};
+ "tray" = {
+ spacing = 12;
+ };
+
"battery" = {
states = {
warning = 30;
@@ -197,6 +185,32 @@ in {
on-click = "";
tooltip = false;
};
+
+ "network" = {
+ format-icons = [
+ ""
+ ""
+ ""
+ ""
+ ""
+ ];
+ format-ethernet = " {bandwidthDownOctets}";
+ format-wifi = "{icon} {signalStrength}%";
+ format-disconnected = "";
+ tooltip = false;
+ };
+
+ "custom/exit" = {
+ tooltip = false;
+ format = "";
+ on-click = "sleep 0.1 && ${lib.getExe config.programs.wlogout.package}";
+ };
+
+ "clock" = {
+ format = " {:L%I:%M %p}";
+ tooltip = true;
+ tooltip-format = "{:%A, %d.%B %Y }\n{calendar}";
+ };
}
];
@@ -252,7 +266,7 @@ in {
font-weight: bold;
border-radius: 16px;
color: @base00;
- background: linear-gradient(45deg, @base08, @iris);
+ background: linear-gradient(45deg, @base08, @base0D);
opacity: 0.8;
transition: ${transition};
}