2025-01-12 13:09:10 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2025-01-12 19:26:13 -08:00
|
|
|
cfg = config.marleyos.programs.waybar;
|
2025-01-12 13:09:10 -08:00
|
|
|
in {
|
2025-01-12 19:26:13 -08:00
|
|
|
options.marleyos.programs.waybar = {
|
|
|
|
enable = lib.mkEnableOption "waybar";
|
|
|
|
|
|
|
|
keybindings-script = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
default = "";
|
|
|
|
description = "The keybindings to use for a cheatsheet.";
|
|
|
|
};
|
|
|
|
};
|
2025-01-12 13:09:10 -08:00
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2025-01-12 17:38:45 -08:00
|
|
|
marleyos.services.swaync.enable = true;
|
|
|
|
|
2025-01-12 19:26:13 -08:00
|
|
|
programs.waybar = let
|
|
|
|
keybindings-script =
|
|
|
|
pkgs.writeShellScript "keybindings-cheatsheet-wayland"
|
|
|
|
# bash
|
|
|
|
''
|
|
|
|
${lib.getExe pkgs.yad} \
|
|
|
|
--width=800 \
|
|
|
|
--height=650 \
|
|
|
|
--center \
|
|
|
|
--fixed \
|
|
|
|
--title="Keybindings" \
|
|
|
|
--no-buttons \
|
|
|
|
--list \
|
|
|
|
--column=Key: \
|
|
|
|
--column=Description: \
|
|
|
|
--column=Command: \
|
|
|
|
--timeout=90 \
|
|
|
|
--timeout-indicator=right \
|
|
|
|
${lib.concatStringsSep "\\\n" cfg.keybindings-script} \
|
|
|
|
""
|
|
|
|
'';
|
|
|
|
in {
|
2025-01-12 13:09:10 -08:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# https://gitlab.com/Zaney/zaneyos/-/blob/main/config/waybar.nix
|
|
|
|
settings = [
|
|
|
|
{
|
|
|
|
layer = "top";
|
|
|
|
position = "top";
|
|
|
|
|
|
|
|
modules-left = [
|
|
|
|
"custom/startmenu"
|
|
|
|
"hyprland/window"
|
|
|
|
"pulseaudio"
|
|
|
|
"cpu"
|
|
|
|
"memory"
|
|
|
|
"idle_inhibitor"
|
|
|
|
];
|
|
|
|
modules-center = ["hyprland/workspaces"];
|
|
|
|
modules-right = [
|
|
|
|
"custom/hyprbindings"
|
|
|
|
"custom/notifications"
|
|
|
|
"custom/exit"
|
|
|
|
"battery"
|
|
|
|
"tray"
|
|
|
|
"clock"
|
|
|
|
];
|
|
|
|
|
2025-01-12 17:55:20 -08:00
|
|
|
"hyprland/workspaces" = let
|
|
|
|
hyprctl =
|
|
|
|
lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
|
|
|
|
in {
|
2025-01-12 13:09:10 -08:00
|
|
|
format = "{name}";
|
|
|
|
format-icons = {
|
|
|
|
default = " ";
|
|
|
|
active = " ";
|
|
|
|
urgent = " ";
|
|
|
|
};
|
2025-01-12 17:55:20 -08:00
|
|
|
on-scroll-up = "${hyprctl} dispatch workspace e+1";
|
|
|
|
on-scroll-down = "${hyprctl} dispatch workspace e-1";
|
2025-01-12 13:09:10 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
"clock" = {
|
|
|
|
format = " {:L%I:%M %p}";
|
|
|
|
tooltip = true;
|
|
|
|
tooltip-format = "<big>{:%A, %d.%B %Y }</big>\n<tt><small>{calendar}</small></tt>";
|
|
|
|
};
|
|
|
|
|
|
|
|
"hyprland/window" = {
|
|
|
|
max-length = 22;
|
|
|
|
separate-outputs = false;
|
|
|
|
rewrite = {
|
|
|
|
"" = " 🙈 No Windows? ";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"memory" = {
|
|
|
|
interval = 5;
|
|
|
|
format = " {}%";
|
|
|
|
tooltip = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"cpu" = {
|
|
|
|
interval = 5;
|
|
|
|
format = " {usage:2}%";
|
|
|
|
tooltip = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"disk" = {
|
|
|
|
format = " {free}";
|
|
|
|
tooltip = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"network" = {
|
|
|
|
format-icons = [
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
];
|
|
|
|
format-ethernet = " {bandwidthDownOctets}";
|
|
|
|
format-wifi = "{icon} {signalStrength}%";
|
|
|
|
format-disconnected = "";
|
|
|
|
tooltip = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
"tray" = {
|
|
|
|
spacing = 12;
|
|
|
|
};
|
|
|
|
|
|
|
|
"pulseaudio" = {
|
|
|
|
format = "{icon} {volume}% {format_source}";
|
|
|
|
format-bluetooth = "{volume}% {icon} {format_source}";
|
|
|
|
format-bluetooth-muted = " {icon} {format_source}";
|
|
|
|
format-muted = " {format_source}";
|
|
|
|
format-source = " {volume}%";
|
|
|
|
format-source-muted = "";
|
|
|
|
format-icons = {
|
|
|
|
headphone = "";
|
|
|
|
hands-free = "";
|
|
|
|
headset = "";
|
|
|
|
phone = "";
|
|
|
|
portable = "";
|
|
|
|
car = "";
|
|
|
|
default = [
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
];
|
|
|
|
};
|
|
|
|
on-click = "sleep 0.1 && ${lib.getExe pkgs.pwvucontrol}";
|
|
|
|
};
|
|
|
|
|
|
|
|
"custom/exit" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
on-click = "sleep 0.1 && ${lib.getExe pkgs.wlogout}";
|
|
|
|
};
|
|
|
|
|
|
|
|
"custom/startmenu" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
|
|
|
on-click = let
|
|
|
|
inherit (config.marleyos.apps) launcher;
|
|
|
|
in "sleep 0.1 && ${lib.getExe launcher.package} ${launcher.command}";
|
|
|
|
};
|
|
|
|
|
|
|
|
"custom/hyprbindings" = {
|
|
|
|
tooltip = false;
|
|
|
|
format = "";
|
2025-01-12 19:26:13 -08:00
|
|
|
on-click = "sleep 0.1 && ${keybindings-script}";
|
2025-01-12 13:09:10 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
"idle_inhibitor" = {
|
|
|
|
format = "{icon}";
|
|
|
|
format-icons = {
|
|
|
|
activated = "";
|
|
|
|
deactivated = "";
|
|
|
|
};
|
|
|
|
tooltip = "true";
|
|
|
|
};
|
|
|
|
|
2025-01-12 17:38:45 -08:00
|
|
|
"custom/notifications" = let
|
|
|
|
swaync-client =
|
|
|
|
lib.getExe' config.services.swaync.package "swaync-client";
|
|
|
|
in {
|
2025-01-12 13:09:10 -08:00
|
|
|
tooltip = false;
|
|
|
|
format = "{icon} {}";
|
|
|
|
format-icons = {
|
|
|
|
notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
none = "";
|
|
|
|
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
dnd-none = "";
|
|
|
|
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
inhibited-none = "";
|
|
|
|
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
|
|
dnd-inhibited-none = "";
|
|
|
|
};
|
|
|
|
return-type = "json";
|
2025-01-12 17:38:45 -08:00
|
|
|
exec = "${swaync-client} -swb";
|
|
|
|
on-click = "sleep 0.1 && ${swaync-client} -t";
|
2025-01-12 13:09:10 -08:00
|
|
|
escape = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"battery" = {
|
|
|
|
states = {
|
|
|
|
warning = 30;
|
|
|
|
critical = 15;
|
|
|
|
};
|
|
|
|
format = "{icon} {capacity}%";
|
|
|
|
format-charging = " {capacity}%";
|
|
|
|
format-plugged = " {capacity}%";
|
|
|
|
format-icons = [
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
""
|
|
|
|
];
|
|
|
|
on-click = "";
|
|
|
|
tooltip = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
style = let
|
|
|
|
transition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)";
|
|
|
|
in
|
|
|
|
lib.concatStrings [
|
2025-01-12 15:29:50 -08:00
|
|
|
(lib.optionalString config.rose-pine.enable
|
2025-01-12 13:09:10 -08:00
|
|
|
#css
|
|
|
|
''
|
2025-01-13 20:08:33 -08:00
|
|
|
@define-color zero @base;
|
|
|
|
@define-color one @surface;
|
|
|
|
@define-color two @overlay;
|
|
|
|
@define-color four @subtle;
|
|
|
|
@define-color seven @highlightHigh;
|
|
|
|
@define-color eight @love;
|
|
|
|
@define-color b @pine;
|
|
|
|
@define-color e @gold;
|
|
|
|
@define-color d @iris;
|
2025-01-12 13:09:10 -08:00
|
|
|
@define-color accentFour @foam;
|
|
|
|
'')
|
|
|
|
# css
|
|
|
|
''
|
|
|
|
* {
|
|
|
|
font-family: ${config.marleyos.theme.fonts.monospace.name};
|
|
|
|
font-size: 16px;
|
|
|
|
border-radius: 0;
|
|
|
|
border: none;
|
|
|
|
min-height: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
window#waybar {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces {
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @zero;
|
|
|
|
background: @one;
|
2025-01-12 13:09:10 -08:00
|
|
|
margin: 4px 4px;
|
|
|
|
padding: 5px 5px;
|
|
|
|
border-radius: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button {
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 0 5px;
|
|
|
|
margin: 0 3px;
|
|
|
|
border-radius: 16px;
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @zero;
|
|
|
|
background: linear-gradient(45deg, @eight, @d);
|
2025-01-12 13:09:10 -08:00
|
|
|
opacity: 0.5;
|
|
|
|
transition: ${transition};
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button.active {
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 0 5px;
|
|
|
|
margin: 0 3px;
|
|
|
|
border-radius: 16px;
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @zero;
|
|
|
|
background: linear-gradient(45deg, @eight, @d);
|
2025-01-12 13:09:10 -08:00
|
|
|
opacity: 1.0;
|
|
|
|
transition: ${transition};
|
|
|
|
min-width: 40px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button:hover {
|
|
|
|
font-weight: bold;
|
|
|
|
border-radius: 16px;
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @zero;
|
|
|
|
background: linear-gradient(45deg, @eight, @iris);
|
2025-01-12 13:09:10 -08:00
|
|
|
opacity: 0.8;
|
|
|
|
transition: ${transition};
|
|
|
|
}
|
|
|
|
|
|
|
|
tooltip {
|
2025-01-13 20:08:33 -08:00
|
|
|
background: @zero;
|
|
|
|
border: 1px solid @eight;
|
2025-01-12 13:09:10 -08:00
|
|
|
border-radius: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
tooltip label {
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @eight;
|
2025-01-12 13:09:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
#window, #pulseaudio, #cpu, #memory, #idle_inhibitor {
|
|
|
|
font-weight: bold;
|
|
|
|
margin: 4px 0;
|
|
|
|
margin-left: 7px;
|
|
|
|
padding: 0 18px;
|
2025-01-13 20:08:33 -08:00
|
|
|
background: @four;
|
|
|
|
color: @zero;
|
2025-01-12 13:09:10 -08:00
|
|
|
border-radius: 24px 10px 24px 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#custom-startmenu {
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @b;
|
|
|
|
background: @two;
|
2025-01-12 13:09:10 -08:00
|
|
|
font-size: 28px;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 30px 0 15px;
|
|
|
|
border-radius: 0 0 40px 0;
|
|
|
|
}
|
|
|
|
|
2025-01-12 17:38:45 -08:00
|
|
|
#custom-hyprbindings, #network, #battery, #custom-notifications,
|
2025-01-12 13:09:10 -08:00
|
|
|
#tray, #custom-exit {
|
|
|
|
font-weight: bold;
|
2025-01-13 20:08:33 -08:00
|
|
|
background: @seven;
|
|
|
|
color: @zero;
|
2025-01-12 13:09:10 -08:00
|
|
|
margin: 4px 0;
|
|
|
|
margin-right: 7px;
|
|
|
|
border-radius: 10px 24px 10px 24px;
|
|
|
|
padding: 0 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#clock {
|
|
|
|
font-weight: bold;
|
2025-01-13 20:08:33 -08:00
|
|
|
color: @zero;
|
|
|
|
background: linear-gradient(90deg, @e, @accentFour);
|
2025-01-12 13:09:10 -08:00
|
|
|
margin: 0;
|
|
|
|
padding: 0 15px 0 30px;
|
|
|
|
border-radius: 0 0 0 40px;
|
|
|
|
}
|
|
|
|
''
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|