integrated waybar configuration cleanly into existing hyprland config

This commit is contained in:
KoenDR06 2025-08-29 17:18:18 +02:00
parent 90966f1b3e
commit 5e920cd892
8 changed files with 356 additions and 343 deletions

View file

@ -39,7 +39,7 @@ in {
];
fonts.packages = with pkgs; [
nerd-fonts.dejavu-sans-mono
nerd-fonts.hasklug
];
};
}

View file

@ -35,14 +35,13 @@ in {
l = "ls -lAh --group-directories-first";
zip = "zip -r";
cat = "bat";
py = "python3";
};
ohMyZsh = {
enable = true;
plugins = [
"git"
"zsh-interactive-cd"
"python"
"git-auto-fetch"
"wd"
];

View file

@ -0,0 +1,159 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf;
cfg = config.horseman.wm.hyprland;
in {
config = mkIf cfg.enable {
horseman.wm.hyprland.config = {
animations = {
enabled = true;
beziers = [
{
name = "easeOutQuint";
startX = 0.23;
startY = 1.0;
endX = 0.32;
endY = 1.0;
}
{
name = "easeInOutCubic";
startX = 0.65;
startY = 0.05;
endX = 0.36;
endY = 1.0;
}
{
name = "linear";
startX = 0.0;
startY = 0.0;
endX = 1.0;
endY = 1.0;
}
{
name = "almostLinear";
startX = 0.5;
startY = 0.5;
endX = 0.75;
endY = 1.0;
}
{
name = "quick";
startX = 0.15;
startY = 0.0;
endX = 0.1;
endY = 1.0;
}
];
animations = [
{
name = "global";
on = true;
speed = 10.0;
curve = "default";
}
{
name = "border";
on = true;
speed = 5.39;
curve = "easeOutQuint";
}
{
name = "windows";
on = true;
speed = 4.79;
curve = "easeOutQuint";
}
{
name = "windowsIn";
on = true;
speed = 4.1;
curve = "easeOutQuint";
style = "popin 87%";
}
{
name = "windowsOut";
on = true;
speed = 1.49;
curve = "linear";
style = "popin 87%";
}
{
name = "fadeIn";
on = true;
speed = 1.73;
curve = "almostLinear";
}
{
name = "fadeOut";
on = true;
speed = 1.46;
curve = "almostLinear";
}
{
name = "fade";
on = true;
speed = 3.03;
curve = "quick";
}
{
name = "layers";
on = true;
speed = 3.81;
curve = "easeOutQuint";
}
{
name = "layersIn";
on = true;
speed = 4.0;
curve = "easeOutQuint";
style = "fade";
}
{
name = "layersOut";
on = true;
speed = 1.5;
curve = "linear";
style = "fade";
}
{
name = "fadeLayersIn";
on = true;
speed = 1.79;
curve = "almostLinear";
}
{
name = "fadeLayersOut";
on = true;
speed = 1.39;
curve = "almostLinear";
}
{
name = "workspaces";
on = true;
speed = 1.94;
curve = "almostLinear";
style = "fade";
}
{
name = "workspacesIn";
on = true;
speed = 1.21;
curve = "almostLinear";
style = "fade";
}
{
name = "workspacesOut";
on = true;
speed = 1.94;
curve = "almostLinear";
style = "fade";
}
];
};
};
};
}

View file

@ -53,7 +53,7 @@
* {
font-size: 15px;
font-family: "Zed Mono Nerd Font";
font-family: "Hasklug Nerd Font";
}
window#waybar{

View file

@ -11,6 +11,7 @@ in {
imports = [
./options.nix
./keybindings.nix
./animations.nix
];
options = {
@ -45,194 +46,6 @@ in {
xdg-desktop-portal-hyprland
];
home-manager.users.${homeCfg.username} = {
programs.waybar = {
enable = true;
settings = {
horizontalBar = {
layer = "top";
position = "top";
output = [
"DP-3"
];
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"];
"clock" = {
interval = 1;
format = "{:%H:%M:%S}";
tooltip-format = "{:%a %d %b %Y}";
};
"cpu" = {
interval = 3;
format = " {usage}%";
on-click = "kitty btop &";
};
"memory" = {
interval = 3;
format = " {percentage}%";
on-click = "kitty btop &";
};
"pulseaudio" = {
format = " {volume}";
on-click = "kitty pulsemixer &";
};
"network" = {
interval = 3;
format = "{ipaddr}";
format-ethernet = " {ipaddr}";
format-disconnected = "󰣽 Disconnected";
format-wifi = "󰤨 {essid}";
tooltip = false;
};
"battery" = {
interval = 3;
# TODO This needs to be fixed
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"active" = "";
"default" = "";
"empty" = "";
};
persistent-workspaces = {
"*" = [1 2 3 4 5 6 7 8 9 10];
};
};
"group/power" = {
orientation = "horizontal";
drawer = {
};
modules = [
"custom/power"
"custom/reboot"
"custom/lock"
"idle_inhibitor"
];
};
"custom/lock" = {
format = "󰍁 ";
tooltip = false;
on-click = "hyprlock";
};
"custom/reboot" = {
format = "󰜉 ";
tooltip = false;
on-click = "reboot";
};
"custom/power" = {
format = " ";
tooltip = false;
on-click = "shutdown now";
};
"idle_inhibitor" = {
tooltip = false;
format = "{icon}";
format-icons = {
deactivated = "󰒲 ";
activated = "󰒳 ";
};
};
};
verticalBar = {
layer = "top";
position = "right";
output = [
"eDP-1"
];
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["battery" "clock"];
"clock" = {
interval = 1;
format = "{:%H\n%M\n%S}";
tooltip-format = "{:%a %d %b %Y}";
};
"cpu" = {
interval = 3;
format = "\n{usage}%";
on-click = "kitty btop &";
};
"memory" = {
interval = 3;
format = "\n{percentage}%";
on-click = "kitty btop &";
};
"battery" = {
interval = 3;
# TODO This needs to be fixed
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"active" = "";
"default" = "";
"empty" = "";
};
persistent-workspaces = {
"*" = [1 2 3 4 5 6 7 8 9 10];
};
};
"group/power" = {
orientation = "vertical";
drawer = {
};
modules = [
"custom/power"
"custom/reboot"
"custom/lock"
"idle_inhibitor"
];
};
"custom/lock" = {
format = "󰍁 ";
tooltip = false;
on-click = "hyprlock";
};
"custom/reboot" = {
format = "󰜉 ";
tooltip = false;
on-click = "reboot";
};
"custom/power" = {
format = " ";
tooltip = false;
on-click = "shutdown now";
};
"idle_inhibitor" = {
tooltip = false;
format = "{icon}";
format-icons = {
deactivated = "󰒲 ";
activated = "󰒳 ";
};
};
};
};
};
xdg.configFile."waybar/style.css".source = ./config/waybar/style.css;
};
horseman.wm.hyprland.config = {
execOnce = [
"hyprpaper"
@ -302,153 +115,6 @@ in {
};
};
animations = {
enabled = true;
beziers = [
{
name = "easeOutQuint";
startX = 0.23;
startY = 1.0;
endX = 0.32;
endY = 1.0;
}
{
name = "easeInOutCubic";
startX = 0.65;
startY = 0.05;
endX = 0.36;
endY = 1.0;
}
{
name = "linear";
startX = 0.0;
startY = 0.0;
endX = 1.0;
endY = 1.0;
}
{
name = "almostLinear";
startX = 0.5;
startY = 0.5;
endX = 0.75;
endY = 1.0;
}
{
name = "quick";
startX = 0.15;
startY = 0.0;
endX = 0.1;
endY = 1.0;
}
];
animations = [
{
name = "global";
on = true;
speed = 10.0;
curve = "default";
}
{
name = "border";
on = true;
speed = 5.39;
curve = "easeOutQuint";
}
{
name = "windows";
on = true;
speed = 4.79;
curve = "easeOutQuint";
}
{
name = "windowsIn";
on = true;
speed = 4.1;
curve = "easeOutQuint";
style = "popin 87%";
}
{
name = "windowsOut";
on = true;
speed = 1.49;
curve = "linear";
style = "popin 87%";
}
{
name = "fadeIn";
on = true;
speed = 1.73;
curve = "almostLinear";
}
{
name = "fadeOut";
on = true;
speed = 1.46;
curve = "almostLinear";
}
{
name = "fade";
on = true;
speed = 3.03;
curve = "quick";
}
{
name = "layers";
on = true;
speed = 3.81;
curve = "easeOutQuint";
}
{
name = "layersIn";
on = true;
speed = 4.0;
curve = "easeOutQuint";
style = "fade";
}
{
name = "layersOut";
on = true;
speed = 1.5;
curve = "linear";
style = "fade";
}
{
name = "fadeLayersIn";
on = true;
speed = 1.79;
curve = "almostLinear";
}
{
name = "fadeLayersOut";
on = true;
speed = 1.39;
curve = "almostLinear";
}
{
name = "workspaces";
on = true;
speed = 1.94;
curve = "almostLinear";
style = "fade";
}
{
name = "workspacesIn";
on = true;
speed = 1.21;
curve = "almostLinear";
style = "fade";
}
{
name = "workspacesOut";
on = true;
speed = 1.94;
curve = "almostLinear";
style = "fade";
}
];
};
dwindle = {
pseudotile = true;
preserveSplit = true;
@ -529,6 +195,109 @@ in {
}
];
};
waybar = {
formats = {
horizontal = {
"clock" = {
format = "󰥔 {:%H:%M:%S}";
format-alt = "{:%a %d %b %Y}";
};
};
vertical = {
"clock" = {
format = "{:%H\n%M\n%S}";
format-alt = "{:%d\n%m\n%y}";
};
};
};
modules = {
"clock" = {
interval = 1;
tooltip = false;
};
"cpu" = {
interval = 3;
format = " {usage}%";
on-click = "kitty btop &";
};
"memory" = {
interval = 3;
format = " {percentage}%";
on-click = "kitty btop &";
};
"pulseaudio" = {
format = " {volume}";
on-click = "kitty pulsemixer &";
};
"network" = {
interval = 3;
format = "{ipaddr}";
format-ethernet = " {ipaddr}";
format-disconnected = "󰣽 Disconnected";
format-wifi = "󰤨 {essid}";
tooltip = false;
};
"battery" = {
interval = 3;
# TODO This needs to be fixed
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"active" = "";
"default" = "";
"empty" = "";
};
persistent-workspaces = {
"*" = [1 2 3 4 5 6 7 8 9 10];
};
};
"group/power" = {
orientation = "horizontal";
drawer = {
};
modules = [
"custom/power"
"custom/reboot"
"custom/lock"
"idle_inhibitor"
];
};
"custom/lock" = {
format = "󰍁 ";
tooltip = false;
on-click = "hyprlock";
};
"custom/reboot" = {
format = "󰜉 ";
tooltip = false;
on-click = "reboot";
};
"custom/power" = {
format = " ";
tooltip = false;
on-click = "shutdown now";
};
"idle_inhibitor" = {
tooltip = false;
format = "{icon}";
format-icons = {
deactivated = "󰒲 ";
activated = "󰒳 ";
};
};
};
};
};
services.logind.extraConfig = ''

View file

@ -3,10 +3,11 @@
config,
...
}: let
inherit (lib) mkOption types mkIf trivial strings;
inherit (lib) mkOption types mkIf trivial strings lists;
inherit (builtins) concatStringsSep elem genList elemAt;
inherit (trivial) boolToString;
inherit (strings) floatToString;
inherit (lists) remove;
cfg = config.horseman.wm.hyprland;
homeCfg = config.horseman;
@ -1175,6 +1176,10 @@ in {
type = types.nullOr types.path;
default = null;
};
bar = mkOption {
type = types.enum ["" "left" "right" "top" "bottom"];
default = "";
};
};
});
};
@ -1215,6 +1220,20 @@ in {
});
};
};
waybar = {
formats = {
horizontal = mkOption {
type = types.attrs;
};
vertical = mkOption {
type = types.attrs;
};
};
modules = mkOption {
type = types.attrs;
};
};
};
config = mkIf cfg.enable {
@ -1676,6 +1695,71 @@ in {
)
}
'';
programs.waybar = {
enable = true;
settings = let
outputMap = location: (
remove null (
map (disp:
if (disp.bar == location)
then disp.output
else null)
cfg.config.monitors.displays
)
);
in {
topBar =
{
layer = "top";
position = "top";
output = outputMap "top";
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"];
}
// cfg.config.waybar.modules // cfg.config.waybar.formats.horizontal;
bottomBar =
{
layer = "top";
position = "bottom";
output = outputMap "bottom";
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"];
}
// cfg.config.waybar.modules // cfg.config.waybar.formats.horizontal;
rightBar =
{
layer = "top";
position = "right";
output = outputMap "right";
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["battery" "clock"];
}
// cfg.config.waybar.modules // cfg.config.waybar.formats.vertical;
leftBar =
{
layer = "top";
position = "left";
output = outputMap "left";
modules-left = ["group/power"];
modules-center = ["hyprland/workspaces"];
modules-right = ["battery" "clock"];
}
// cfg.config.waybar.modules // cfg.config.waybar.formats.vertical;
};
};
xdg.configFile."waybar/style.css".source = ./config/waybar/style.css;
};
};
}