2023-06-25 18:11:21 +02:00
|
|
|
{ config, lib, ... }:
|
2023-06-22 17:13:46 +02:00
|
|
|
|
2023-06-26 18:01:50 +02:00
|
|
|
let
|
|
|
|
opacity = lib.strings.floatToString config.stylix.opacity.terminal;
|
2023-06-28 18:25:53 +02:00
|
|
|
icons = true;
|
2023-06-27 11:53:07 +02:00
|
|
|
position = "top";
|
2023-06-27 11:20:06 +02:00
|
|
|
opposite = builtins.replaceStrings ["left" "right" "top" "bottom"] ["right" "left" "bottom" "top"] position;
|
2023-06-27 11:53:07 +02:00
|
|
|
isVertical = position == "left" || position == "right";
|
2023-06-26 18:01:50 +02:00
|
|
|
in
|
2023-06-22 17:13:46 +02:00
|
|
|
{
|
2023-06-16 13:23:35 +02:00
|
|
|
programs.waybar = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
mainBar = {
|
|
|
|
layer = "top";
|
2023-06-27 11:20:06 +02:00
|
|
|
position = position;
|
2023-06-27 11:53:07 +02:00
|
|
|
width = if isVertical then 45 else null;
|
|
|
|
height = if isVertical then null else 45;
|
2023-06-16 13:23:35 +02:00
|
|
|
spacing = 8;
|
|
|
|
|
2023-06-29 06:34:45 +02:00
|
|
|
autohide = true;
|
|
|
|
exclusive = false;
|
|
|
|
autohide-starthidden = true;
|
|
|
|
|
2023-06-28 18:25:53 +02:00
|
|
|
modules-left = if icons then [ "wlr/taskbar" ] else [ "wlr/workspaces" "custom/new-workspace" ];
|
2023-06-16 13:23:35 +02:00
|
|
|
modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ];
|
|
|
|
|
|
|
|
tray = {
|
|
|
|
icon-size = 24;
|
|
|
|
spacing = 8;
|
|
|
|
};
|
2023-05-25 19:08:01 +02:00
|
|
|
|
2023-06-27 14:41:42 +02:00
|
|
|
"wlr/taskbar" = {
|
|
|
|
icon-size = 32;
|
|
|
|
on-click = "activate";
|
|
|
|
on-click-middle = "activate";
|
|
|
|
on-click-right = "activate";
|
|
|
|
};
|
|
|
|
|
2023-06-24 14:51:34 +02:00
|
|
|
"hyprland/window" = {
|
2023-06-27 11:53:07 +02:00
|
|
|
rotate = if isVertical then 90 else 0;
|
2023-06-24 14:51:34 +02:00
|
|
|
};
|
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
"wlr/workspaces" = {
|
|
|
|
on-click = "activate";
|
|
|
|
sort-by-number = true;
|
|
|
|
format = "{icon}";
|
|
|
|
format-icons = {
|
|
|
|
"1" = "一";
|
|
|
|
"2" = "二";
|
|
|
|
"3" = "三";
|
|
|
|
"4" = "四";
|
|
|
|
"5" = "五";
|
|
|
|
"6" = "六";
|
|
|
|
"7" = "七";
|
|
|
|
"8" = "八";
|
|
|
|
"9" = "九";
|
|
|
|
"10" = "十";
|
|
|
|
};
|
|
|
|
};
|
2023-06-06 02:37:52 +02:00
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
wireplumber = {
|
|
|
|
format = "{icon}";
|
|
|
|
tooltip-format = "{volume}% {node_name}";
|
|
|
|
format-muted = "";
|
|
|
|
format-icons = [ "" "" ];
|
|
|
|
};
|
2023-05-25 19:08:01 +02:00
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
battery = {
|
2023-06-25 01:40:31 +02:00
|
|
|
format = "{icon}";
|
|
|
|
tooltip-format = "{capacity}% {timeTo}";
|
|
|
|
format-icons = [ "" "" "" "" "" ];
|
2023-06-16 13:23:35 +02:00
|
|
|
};
|
2023-05-25 19:08:01 +02:00
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
clock = {
|
2023-06-27 11:53:07 +02:00
|
|
|
format = if isVertical then "{:%H\n%M}" else "{:%H:%M}";
|
2023-06-25 01:40:31 +02:00
|
|
|
tooltip-format = "<tt>{calendar}</tt>";
|
|
|
|
calendar = {
|
|
|
|
mode = "month";
|
|
|
|
weeks-pos = "right";
|
|
|
|
format = {
|
|
|
|
months = "<span color='#ffead3'><b>{}</b></span>";
|
|
|
|
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
|
|
|
weeks = "<span size='14pt' color='#99ffdd'><b>W{}</b></span>";
|
|
|
|
weekdays = "<span size='18pt' color='#ffcc66'><b>{}</b></span>";
|
|
|
|
today = "<span color='#ff6699'><b>{}</b></span>";
|
2023-06-06 02:37:52 +02:00
|
|
|
};
|
2023-05-16 23:09:05 +02:00
|
|
|
};
|
|
|
|
};
|
2023-05-25 19:08:01 +02:00
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
backlight = {
|
2023-06-25 01:40:31 +02:00
|
|
|
format = "{icon}";
|
|
|
|
format-icons = [ "" "" ];
|
2023-06-16 13:23:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
"custom/new-workspace" = {
|
2023-06-25 01:40:31 +02:00
|
|
|
format = "+";
|
|
|
|
on-click = "hyprctl dispatch workspace empty && sleep 0.1 && rofi -show drun";
|
|
|
|
on-click-right = "sleep 0.1 && rofi -show drun";
|
|
|
|
on-click-middle = "hyprctl dispatch workspace empty";
|
|
|
|
tooltip = false;
|
2023-06-16 13:23:35 +02:00
|
|
|
};
|
2023-06-06 02:37:52 +02:00
|
|
|
};
|
2023-06-16 13:23:35 +02:00
|
|
|
};
|
|
|
|
|
2023-06-25 18:24:57 +02:00
|
|
|
style = with config.lib.stylix.colors; lib.mkForce /* css */ ''
|
|
|
|
@define-color base00 #${base00};
|
|
|
|
@define-color base01 #${base01};
|
|
|
|
@define-color base02 #${base02};
|
|
|
|
@define-color base03 #${base03};
|
|
|
|
@define-color base04 #${base04};
|
|
|
|
@define-color base05 #${base05};
|
|
|
|
@define-color base06 #${base06};
|
|
|
|
@define-color base07 #${base07};
|
|
|
|
@define-color base08 #${base08};
|
|
|
|
@define-color base09 #${base09};
|
|
|
|
@define-color base0A #${base0A};
|
|
|
|
@define-color base0B #${base0B};
|
|
|
|
@define-color base0C #${base0C};
|
|
|
|
@define-color base0D #${base0D};
|
|
|
|
@define-color base0E #${base0E};
|
|
|
|
@define-color base0F #${base0F};
|
2023-06-16 13:23:35 +02:00
|
|
|
|
|
|
|
* {
|
|
|
|
color: @base05;
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
window#waybar {
|
2023-06-26 18:01:50 +02:00
|
|
|
background: alpha(@base00, ${opacity});
|
2023-06-27 11:20:06 +02:00
|
|
|
border-${opposite}: 1px solid alpha(@base02, 0.67);
|
2023-06-16 13:23:35 +02:00
|
|
|
}
|
|
|
|
|
2023-06-22 13:17:51 +02:00
|
|
|
window#waybar.fullscreen #workspaces button.active {
|
|
|
|
background: alpha(@base09, 0.5);
|
|
|
|
}
|
|
|
|
|
2023-06-16 13:23:35 +02:00
|
|
|
#workspaces button {
|
2023-06-27 11:53:07 +02:00
|
|
|
padding: ${if isVertical then "12px 0" else "0 12px"};
|
2023-06-16 13:23:35 +02:00
|
|
|
border-radius: 0;
|
|
|
|
border-bottom: 1px solid alpha(@base02, 0.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button:hover {
|
|
|
|
background: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button.active {
|
|
|
|
background: alpha(@base02, 0.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
#window {
|
2023-06-27 11:53:07 +02:00
|
|
|
padding-${if isVertical then "top" else "left"}: 8px;
|
|
|
|
padding-${if isVertical then "bottom" else "right"}: 12px;
|
2023-06-16 13:23:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tooltip, #tray menu {
|
|
|
|
background: @base00;
|
|
|
|
border: 1px solid alpha(@base09, 0.93);
|
|
|
|
padding: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#backlight, #battery, #wireplumber {
|
|
|
|
font-family: "Font Awesome 6 Free Solid";
|
|
|
|
font-size: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#custom-new-workspace {
|
|
|
|
font-family: "Font Awesome 6 Free Solid";
|
2023-06-27 11:53:07 +02:00
|
|
|
padding-${if isVertical then "top" else "left"}: 8px;
|
|
|
|
padding-${if isVertical then "bottom" else "right"}: 8px;
|
2023-06-16 13:23:35 +02:00
|
|
|
color: alpha(@base0A, 0.67);
|
|
|
|
}
|
|
|
|
|
|
|
|
#clock {
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: bold;
|
2023-06-27 11:53:07 +02:00
|
|
|
padding-${if isVertical then "bottom" else "right"}: 8px;
|
2023-06-16 13:23:35 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2023-05-16 23:09:05 +02:00
|
|
|
}
|