2025-03-02 11:53:58 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
2025-03-02 19:00:20 +00:00
|
|
|
lib,
|
2025-03-02 11:53:58 +00:00
|
|
|
...
|
2025-03-02 19:00:20 +00:00
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.universe.de.waybar;
|
|
|
|
|
2025-03-02 11:53:58 +00:00
|
|
|
music-script = pkgs.callPackage ./scripts/music {};
|
|
|
|
in {
|
2025-03-02 19:00:20 +00:00
|
|
|
options.universe.de.waybar = {
|
|
|
|
enable = mkEnableOption "waybar";
|
2025-03-02 11:53:58 +00:00
|
|
|
settings = {
|
2025-03-02 19:00:20 +00:00
|
|
|
radiuses = {
|
|
|
|
outer = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 100;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
inner = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 40;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
bar = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 25;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
};
|
|
|
|
gapps = {
|
|
|
|
outer = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 6;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
inner = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 8;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
chips = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 4;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
};
|
|
|
|
sizes = {
|
|
|
|
icons = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 20;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
text = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 15;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
2025-03-02 19:00:20 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.waybar = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.waybar;
|
|
|
|
settings = {
|
|
|
|
main = {
|
|
|
|
name = "main";
|
|
|
|
layer = "top";
|
|
|
|
position = "bottom";
|
|
|
|
height = 50;
|
|
|
|
width = 1800;
|
|
|
|
spacing = 0;
|
|
|
|
margin-top = -15;
|
|
|
|
margin-bottom = 0;
|
|
|
|
|
|
|
|
modules-left = [
|
|
|
|
"tray"
|
|
|
|
|
|
|
|
"custom/cpu"
|
|
|
|
"cpu"
|
|
|
|
|
|
|
|
"custom/memory"
|
|
|
|
"memory"
|
|
|
|
|
|
|
|
"custom/player-btn-play"
|
|
|
|
"custom/player-text"
|
|
|
|
];
|
|
|
|
|
|
|
|
modules-center = [
|
|
|
|
"hyprland/workspaces"
|
|
|
|
];
|
|
|
|
|
|
|
|
modules-right = [
|
|
|
|
"wireplumber#icon"
|
|
|
|
"wireplumber#text"
|
|
|
|
|
|
|
|
"custom/language"
|
|
|
|
"hyprland/language"
|
|
|
|
|
|
|
|
"custom/clock"
|
|
|
|
"clock"
|
|
|
|
|
|
|
|
"custom/date"
|
|
|
|
"clock#date"
|
|
|
|
];
|
|
|
|
|
|
|
|
"tray" = {
|
|
|
|
cfg.sizes.icons = 15;
|
|
|
|
spacing = 16;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/cpu" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
};
|
|
|
|
"cpu" = {
|
|
|
|
interval = 1;
|
|
|
|
format = "{usage}%";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/memory" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
};
|
|
|
|
"memory" = {
|
|
|
|
interval = 1;
|
|
|
|
format = "{used:0.1f}Gb";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/player-btn-prev" = {
|
|
|
|
tooltip = false;
|
|
|
|
on-click = "${pkgs.playerctl}/bin/playerctl previous";
|
|
|
|
format = "{}";
|
|
|
|
return-type = "json";
|
|
|
|
exec = "${music-script}/bin/main.py --icon-text ''";
|
|
|
|
};
|
|
|
|
"custom/player-btn-play" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "{}";
|
|
|
|
max-length = 40;
|
|
|
|
return-type = "json";
|
|
|
|
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
exec = "${music-script}/bin/main.py --icon";
|
|
|
|
};
|
|
|
|
"custom/player-btn-next" = {
|
|
|
|
tooltip = false;
|
|
|
|
on-click = "${pkgs.playerctl}/bin/playerctl next";
|
|
|
|
format = "{}";
|
|
|
|
return-type = "json";
|
|
|
|
exec = "${music-script}/bin/main.py --icon-text ''";
|
|
|
|
};
|
|
|
|
"custom/player-text" = {
|
|
|
|
tooltip-format = "{}";
|
|
|
|
format = "{}";
|
|
|
|
max-length = 40;
|
|
|
|
return-type = "json";
|
|
|
|
escape = false;
|
|
|
|
exec = "${music-script}/bin/main.py";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"hyprland/workspaces" = {
|
|
|
|
format = "{name}";
|
|
|
|
on-click = "activate";
|
|
|
|
tooltip = false;
|
|
|
|
"persistent_workspaces" = {
|
|
|
|
"*" = [];
|
|
|
|
};
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"wireplumber#icon" = {
|
|
|
|
tooltip = false;
|
|
|
|
scroll-step = 2;
|
|
|
|
format = "{icon}";
|
|
|
|
format-icons = ["" "" ""];
|
|
|
|
format-muted = "";
|
|
|
|
on-click = "pwvucontrol";
|
|
|
|
max-volume = 100;
|
|
|
|
};
|
|
|
|
"wireplumber#text" = {
|
|
|
|
scroll-step = 2;
|
|
|
|
format = "{volume}%";
|
|
|
|
on-click = "pwvucontrol";
|
|
|
|
max-volume = 100;
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/language" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
};
|
|
|
|
"hyprland/language" = {
|
|
|
|
format = "{}";
|
|
|
|
format-en = "Eng";
|
|
|
|
format-ru = "Rus";
|
|
|
|
tooltip-format = "{}";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/clock" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
};
|
|
|
|
"clock" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "{:%H:%M}";
|
|
|
|
timezone = "Asia/Yekaterinburg";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
"custom/date" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
};
|
|
|
|
"clock#date" = {
|
|
|
|
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
|
|
|
format = "{:%b %d}";
|
|
|
|
timezone = "Asia/Yekaterinburg";
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-03-02 19:00:20 +00:00
|
|
|
style = let
|
|
|
|
s = x: builtins.toString x;
|
|
|
|
half = x: s ((builtins.floor (x * 10 / 2) * 1.0) / 10);
|
|
|
|
in
|
|
|
|
with config.lib.stylix.colors.withHashtag;
|
|
|
|
/*
|
|
|
|
css
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
* {
|
|
|
|
font-family: "${config.stylix.fonts.serif.name}";
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: ${s cfg.settings.sizes.text}px;
|
|
|
|
min-height: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
window#waybar {
|
|
|
|
background-color: ${base01};
|
|
|
|
transition-duration: 0.5s;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.bar}px ${s cfg.settings.radiuses.bar}px 0px 0px;
|
|
|
|
/* border-radius: ${s cfg.settings.radiuses.bar}px; */
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces {
|
|
|
|
font-size: 14px;
|
|
|
|
background-color: ${base00};
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.inner}px;
|
|
|
|
padding: 4px;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.outer}px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button {
|
|
|
|
background-color: ${base00};
|
|
|
|
color: ${base04};
|
|
|
|
padding: 2px 4px;
|
|
|
|
margin: 3px;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.outer}px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button:hover {
|
|
|
|
background-color: ${base02};
|
|
|
|
color: ${base06};
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button.active {
|
|
|
|
background-color: ${base05};
|
|
|
|
color: ${base01};
|
|
|
|
}
|
|
|
|
|
|
|
|
/* global rules */
|
|
|
|
#custom-cpu,
|
|
|
|
#custom-memory,
|
|
|
|
#custom-language,
|
|
|
|
#custom-clock,
|
|
|
|
#custom-date,
|
|
|
|
#custom-player-btn-play,
|
|
|
|
#custom-player-btn-prev,
|
|
|
|
#custom-player-btn-next,
|
|
|
|
#custom-player-text,
|
|
|
|
#battery,
|
|
|
|
#wireplumber,
|
|
|
|
#tray,
|
|
|
|
#language,
|
|
|
|
#clock,
|
|
|
|
#cpu,
|
|
|
|
#memory,
|
|
|
|
#custom-spotify {
|
|
|
|
background: ${base00};
|
|
|
|
border-style: none;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.outer}px;
|
|
|
|
color: ${base05};
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.inner}px;
|
|
|
|
padding: 0px 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#tray {
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px ${s cfg.settings.gapps.outer}px ${s cfg.settings.gapps.outer}px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* icon chips */
|
|
|
|
#wireplumber.icon,
|
|
|
|
#custom-memory,
|
|
|
|
#custom-language,
|
|
|
|
#custom-clock,
|
|
|
|
#custom-date,
|
|
|
|
#custom-player-btn-prev,
|
|
|
|
#custom-player-btn-next,
|
|
|
|
#custom-player-btn-play,
|
|
|
|
#custom-cpu {
|
|
|
|
font-size: ${s cfg.settings.sizes.icons}px;
|
|
|
|
font-family: "Material Symbols Rounded";
|
|
|
|
min-width: 25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* text chips */
|
|
|
|
#wireplumber.text,
|
|
|
|
#memory,
|
|
|
|
#language,
|
|
|
|
#clock,
|
|
|
|
#cpu {
|
|
|
|
min-width: 40px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* start chips */
|
|
|
|
#custom-cpu,
|
|
|
|
#custom-memory,
|
|
|
|
#custom-player-btn-play,
|
|
|
|
#wireplumber.icon,
|
|
|
|
#custom-language,
|
|
|
|
#custom-clock,
|
|
|
|
#custom-date {
|
|
|
|
padding: 0px 7px 0px 10px;
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.inner}px;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.outer}px ${s cfg.settings.radiuses.inner}px ${s cfg.settings.radiuses.inner}px ${s cfg.settings.radiuses.outer}px
|
|
|
|
}
|
|
|
|
|
|
|
|
/* center chips */
|
|
|
|
#custom-player-btn-next,
|
|
|
|
#custom-player-btn-prev {
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px;
|
|
|
|
border-radius: ${s (cfg.settings.radiuses.inner / 4)}px;
|
|
|
|
min-width: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* end chips */
|
|
|
|
#cpu,
|
|
|
|
#memory,
|
|
|
|
#custom-player-text,
|
|
|
|
#wireplumber.text,
|
|
|
|
#language,
|
|
|
|
#clock{
|
|
|
|
padding: 0px 10px 0px 7px;
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.inner}px ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px;
|
|
|
|
border-radius: ${s cfg.settings.radiuses.inner}px ${s cfg.settings.radiuses.outer}px ${s cfg.settings.radiuses.outer}px ${s cfg.settings.radiuses.inner}px
|
|
|
|
}
|
|
|
|
|
|
|
|
#wireplumber.icon.muted {
|
|
|
|
color: ${base08};
|
|
|
|
}
|
|
|
|
|
|
|
|
#clock.date {
|
|
|
|
margin: ${s cfg.settings.gapps.outer}px ${s cfg.settings.gapps.outer}px ${s cfg.settings.gapps.outer}px ${half cfg.settings.gapps.chips}px;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2025-03-02 11:53:58 +00:00
|
|
|
};
|
|
|
|
}
|