feat: double-monitor waybar configuration

This commit is contained in:
Guz
2025-07-20 23:49:22 -03:00
parent ec00618000
commit 67cea4f192
4 changed files with 249 additions and 100 deletions

View File

@@ -123,95 +123,6 @@
## Temp status bar
programs.waybar.enable = true;
programs.waybar.style = builtins.readFile ./waybar.css;
# programs.waybar.settings.single = with builtins; fromJSON (readFile ./wayland.json);
programs.waybar.settings.single = {
layer = "top";
position = "top";
height = 25;
spacing = 5;
margin-top = 5;
margin-right = 10;
margin-left = 10;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
"hyprland/workspaces" = {
active-only = false;
persistent-workspaces = let
MONITOR-1 = config.wayland.windowManager.hyprland.settings."$MONITOR-1";
MONITOR-2 = config.wayland.windowManager.hyprland.settings."$MONITOR-2";
in {
"${MONITOR-1}" = [1 2 3 4 5];
"${MONITOR-2}" = [6 7 8 9 10];
};
format = "{icon}";
format-icons = {
default = "";
active = "";
};
};
"hyprland/window" = {
format = "{title}";
};
modules-center = [
"clock"
];
"clock" = {
format = "{:%d %R}";
format-alt = "{:%B %d, 12.0%y (%A)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
format = with config.lib.stylix.colors.withHashtag; {
months = "<span color='${base09}'><b>{}</b></span>";
days = "<span color='${base05}'><b>{}</b></span>";
weeks = "<span color='${base09}'><b>W{}</b></span>";
weeksdays = "<span color='${base09}'><b>{}</b></span>";
today = "<span color='${base07}'><b>{}</b></span>";
};
};
};
modules-right = [
"pulseaudio"
"cpu"
"memory"
"disk"
];
"pulseaudio" = {
format = "{icon} {volume}%";
format-muted = "";
format-icons = {
default = ["" ""];
};
onclick = "${lib.getExe pkgs.pwvucontrol}";
};
"cpu" = {
format = " {usage}%";
};
"memory" = {
format = " {percentage}%";
};
"disk" = {
interval = 30;
format = "󰨣 {specific_free:0.2f}";
unit = "GB";
};
};
programs.waybar.systemd.enable = true;
# Notifications

View File

@@ -29,19 +29,19 @@ tooltip {
background-color: transparent;
}
.modules-left {
.modules-left,
.modules-right {
padding-right: 10px;
}
.modules-left {
padding-left: 10px;
}
.modules-left #workspaces {
.modules-left #workspaces,
.modules-right #workspaces {
padding: 0;
}
.modules-left #workspaces button {
.modules-left #workspaces button,
.modules-right #workspaces button {
padding-left: 0;
padding-right: 0;
@@ -49,7 +49,8 @@ tooltip {
padding-top: 6px;
}
.modules-left #workspaces button.active {
.modules-left #workspaces button.active,
.modules-right #workspaces button.active {
border-bottom-style: none;
/* Align icons */

View File

@@ -1,9 +1,158 @@
{lib, ...}: {
{
config,
lib,
pkgs,
...
}: {
# Host specific overrides of the root home
home-manager.users.guz = {
home-manager.users.guz = let
cfg = config.home-manager.users.guz;
hyprcfg = cfg.wayland.windowManager.hyprland.settings;
in {
wayland.windowManager.hyprland.settings = {
"$MONITOR-1" = lib.mkForce "HDMI-A-1";
"$MONITOR-2" = lib.mkForce "DVI-D-1";
};
programs.waybar.settings = let
layer = "top";
position = "top";
height = 25;
spacing = 5;
margin-top = 5;
margin-x = 10;
margin-right = margin-x;
margin-left = margin-x;
in {
main = {
inherit
layer
position
height
spacing
margin-top
margin-right
margin-left
;
output = [hyprcfg."$MONITOR-1"];
modules-left = [
"hyprland/workspaces"
];
"hyprland/workspaces" = {
active-only = false;
persistent-workspaces = {
"${hyprcfg."$MONITOR-1"}" = [1 2 3 4 5];
};
format = "{icon}";
format-icons = {
default = "";
active = "";
};
};
modules-center = [
"hyprland/window"
];
"hyprland/window" = {
format = "{title}";
};
modules-right = [
"clock"
"pulseaudio"
];
"clock" = {
format = "󰥔 {:%d %R}";
format-alt = "{:%B %d, 12.0%y (%A)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
format = with config.lib.stylix.colors.withHashtag; {
months = "<span color='${base09}'><b>{}</b></span>";
days = "<span color='${base05}'><b>{}</b></span>";
weeks = "<span color='${base09}'><b>W{}</b></span>";
weeksdays = "<span color='${base09}'><b>{}</b></span>";
today = "<span color='${base07}'><b>{}</b></span>";
};
};
};
"pulseaudio" = {
format = "{icon} {volume}%";
format-muted = "";
format-icons = {
default = ["" ""];
};
onclick = "${lib.getExe pkgs.pwvucontrol}";
};
};
secondary = {
inherit
layer
position
height
spacing
margin-top
margin-right
margin-left
;
output = [hyprcfg."$MONITOR-2"];
modules-left = [
"cpu"
"memory"
"disk"
];
"cpu" = {
format = " {usage}%";
};
"memory" = {
format = " {percentage}%";
};
"disk" = {
interval = 30;
format = "󰨣 {specific_free:0.2f}";
unit = "GB";
};
modules-center = [
"hyprland/window"
];
"hyprland/window" = {
format = "{title}";
};
modules-right = [
"hyprland/workspaces"
];
"hyprland/workspaces" = {
active-only = false;
persistent-workspaces = {
"${hyprcfg."$MONITOR-2"}" = [6 7 8 9 10];
};
format = "{icon}";
format-icons = {
default = "";
active = "";
};
};
};
};
};
}

View File

@@ -1,19 +1,107 @@
{lib, ...}: {
{
config,
lib,
pkgs,
...
}: {
# Host specific overrides of the root home
home-manager.users.guz = {
home-manager.users.guz = let
cfg = config.home-manager.users.guz;
hyprcfg = cfg.wayland.windowManager.hyprland.settings;
in {
wayland.windowManager.hyprland.settings = {
"$MONITOR-1" = lib.mkForce "eDP-1";
};
programs.waybar.settings.single = {
layer = "top";
position = "top";
height = 25;
spacing = 5;
margin-top = 5;
margin-right = 10;
margin-left = 10;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
"hyprland/workspaces" = {
active-only = false;
persistent-workspaces = {
"${hyprcfg."$MONITOR-1"}" = [1 2 3 4 5];
};
format = "{icon}";
format-icons = {
default = "";
active = "";
};
};
"hyprland/window" = {
format = "{title}";
};
modules-center = [
"clock"
];
"clock" = {
format = "{:%d %R}";
format-alt = "{:%B %d, 12.0%y (%A)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
format = with config.lib.stylix.colors.withHashtag; {
months = "<span color='${base09}'><b>{}</b></span>";
days = "<span color='${base05}'><b>{}</b></span>";
weeks = "<span color='${base09}'><b>W{}</b></span>";
weeksdays = "<span color='${base09}'><b>{}</b></span>";
today = "<span color='${base07}'><b>{}</b></span>";
};
};
};
modules-right = [
"battery"
"pulseaudio"
"cpu"
"memory"
"disk"
];
"battery" = {
format-icons = ["" "" "" "" ""];
format = "{icon} {capacity}%";
};
"pulseaudio" = {
format = "{icon} {volume}%";
format-muted = "";
format-icons = {
default = ["" ""];
};
onclick = "${lib.getExe pkgs.pwvucontrol}";
};
"cpu" = {
format = " {usage}%";
};
"memory" = {
format = " {percentage}%";
};
"disk" = {
interval = 30;
format = "󰨣 {specific_free:0.2f}";
unit = "GB";
};
};
services.xremap.config.modmap = [