{ pkgs, config, ... }: let music-script = pkgs.callPackage ./scripts/music {}; in { programs.waybar = { enable = true; package = pkgs.waybar; settings = { main = { name = "main"; layer = "top"; position = "bottom"; # output = ["DP-1"]; 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-btn-prev" #"custom/player-btn-next" "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" = { icon-size = 15; spacing = 16; }; "custom/cpu" = { tooltip = false; format = ""; }; "cpu" = { interval = 1; format = "{usage}%"; }; "custom/memory" = { tooltip = false; format = ""; }; "memory" = { interval = 1; format = "{used:0.1f}Gb"; }; "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"; }; "hyprland/workspaces" = { format = "{name}"; on-click = "activate"; tooltip = false; "persistent_workspaces" = { "*" = []; }; }; "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; }; "custom/language" = { tooltip = false; format = ""; }; "hyprland/language" = { format = "{}"; format-en = "Eng"; format-ru = "Rus"; tooltip-format = "{}"; }; "custom/clock" = { tooltip = false; format = ""; }; "clock" = { tooltip = false; format = "{:%H:%M}"; timezone = "Asia/Yekaterinburg"; }; "custom/date" = { tooltip = false; format = ""; }; "clock#date" = { tooltip-format = "{:%Y %B}\n{calendar}"; format = "{:%b %d}"; timezone = "Asia/Yekaterinburg"; }; }; /* second = { name = "second"; layer = "top"; position = "bottom"; output = ["HDMI-A-1"]; height = 50; width = 900; spacing = 0; margin-top = -15; margin-bottom = 0; modules-left = [ "tray" ]; modules-center = [ "hyprland/workspaces" ]; modules-right = [ "wireplumber#icon" "wireplumber#text" "custom/clock" "clock" "custom/date" "clock#date" ]; "tray" = { icon-size = 15; spacing = 16; }; "hyprland/workspaces" = { format = "{name}"; on-click = "activate"; tooltip = false; "persistent_workspaces" = { "*" = []; }; }; "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; }; "custom/clock" = { tooltip = false; format = ""; }; "clock" = { tooltip = false; format = "{:%H:%M}"; timezone = "Asia/Yekaterinburg"; }; "custom/date" = { tooltip = false; format = ""; }; "clock#date" = { tooltip-format = "{:%Y %B}\n{calendar}"; format = "{:%b %d}"; timezone = "Asia/Yekaterinburg"; }; }; */ }; style = let outer-radius = 100; inner-radius = 40; bar-radius = 25; outer-gapps = 6; inner-gapps = 8; chip-gapps = 4; icon-size = 20; text-size = 15; 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 text-size}px; min-height: 0px; } window#waybar { background-color: ${base01}; transition-duration: 0.5s; border-radius: ${s bar-radius}px ${s bar-radius}px 0px 0px; /* border-radius: ${s bar-radius}px; */ } #workspaces { font-size: 14px; background-color: ${base00}; margin: ${s outer-gapps}px ${half inner-gapps}px; padding: 4px; border-radius: ${s outer-radius}px; } #workspaces button { background-color: ${base00}; color: ${base04}; padding: 2px 4px; margin: 3px; border-radius: ${s outer-radius}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 outer-radius}px; color: ${base05}; margin: ${s outer-gapps}px ${half inner-gapps}px; padding: 0px 10px; } #tray { margin: ${s outer-gapps}px ${half chip-gapps}px ${s outer-gapps}px ${s outer-gapps}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 icon-size}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 outer-gapps}px ${half chip-gapps}px ${s outer-gapps}px ${half inner-gapps}px; border-radius: ${s outer-radius}px ${s inner-radius}px ${s inner-radius}px ${s outer-radius}px } /* center chips */ #custom-player-btn-next, #custom-player-btn-prev { margin: ${s outer-gapps}px ${half chip-gapps}px ${s outer-gapps}px ${half chip-gapps}px; border-radius: ${s (inner-radius / 4)}px; min-width: 15px; } /* end chips */ #cpu, #memory, #custom-player-text, #wireplumber.text, #language, #clock{ padding: 0px 10px 0px 7px; margin: ${s outer-gapps}px ${half inner-gapps}px ${s outer-gapps}px ${half chip-gapps}px; border-radius: ${s inner-radius}px ${s outer-radius}px ${s outer-radius}px ${s inner-radius}px } #wireplumber.icon.muted { color: ${base08}; } #clock.date { margin: ${s outer-gapps}px ${s outer-gapps}px ${s outer-gapps}px ${half chip-gapps}px; } ''; }; }