split waybar into multiple files
This commit is contained in:
parent
53c7532351
commit
7cff7f09c3
29 changed files with 953 additions and 617 deletions
250
modules/desktop/waybar/default.nix
Normal file
250
modules/desktop/waybar/default.nix
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.xyno.desktop.waybar;
|
||||
json = pkgs.formats.json { };
|
||||
|
||||
in
|
||||
{
|
||||
options.xyno.desktop.waybar.enable = mkEnableOption "enable mako notification daemon";
|
||||
options.xyno.desktop.waybar.wantedBy = mkOption {
|
||||
type = types.str;
|
||||
default = "niri.service";
|
||||
};
|
||||
options.xyno.desktop.waybar.package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.unstable.waybar;
|
||||
};
|
||||
options.xyno.desktop.waybar.config = mkOption {
|
||||
type = json.type;
|
||||
default = { modules-left = []; modules-right = []; };
|
||||
};
|
||||
options.xyno.desktop.waybar.style = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
};
|
||||
imports = [
|
||||
./cal.nix
|
||||
./kmonad.nix
|
||||
./laptop.nix
|
||||
./niri.nix
|
||||
];
|
||||
config = mkIf cfg.enable {
|
||||
programs.waybar.enable = true;
|
||||
programs.waybar.package = cfg.package.overrideAttrs (super: {
|
||||
# version = super.version + "-patched";
|
||||
patches = [
|
||||
./waybar-wireplumber-db.patch
|
||||
];
|
||||
});
|
||||
|
||||
systemd.user.services.waybar.wantedBy = mkForce [ cfg.wantedBy ];
|
||||
environment.etc."xdg/waybar/config".source = json.generate "waybar-config.json" cfg.config;
|
||||
environment.etc."xdg/waybar/style.css".source = pkgs.writeText "waybar.css" cfg.style;
|
||||
|
||||
xyno.desktop.waybar.config = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 20;
|
||||
modules-right = mkMerge [
|
||||
(mkBefore [
|
||||
"tray"
|
||||
"idle_inhibitor"
|
||||
"wireplumber"
|
||||
])
|
||||
(mkAfter [
|
||||
"temperature"
|
||||
"cpu"
|
||||
"memory"
|
||||
"disk"
|
||||
"network"
|
||||
])
|
||||
(mkOrder 2000 [ "clock" ])
|
||||
];
|
||||
wireplumber = {
|
||||
"format" = "{icon} {volume:.2f} dB";
|
||||
"format-muted" = " -inf dB";
|
||||
# "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol";
|
||||
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
"on-click-right" = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"on-scroll-up" = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ -l 1 1%+";
|
||||
"on-scroll-down" = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ -l 1 1%-";
|
||||
"format-icons" = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"idle_inhibitor" = {
|
||||
format = "{icon} ";
|
||||
format-icons = {
|
||||
"activated" = "";
|
||||
"deactivated" = "";
|
||||
};
|
||||
};
|
||||
"cpu" = {
|
||||
"interval" = 10;
|
||||
"format" = " {:0.0f}%";
|
||||
"max-length" = 10;
|
||||
};
|
||||
"temperature" = {
|
||||
"format" = " {temperatureC}°C";
|
||||
};
|
||||
memory = {
|
||||
interval = 30;
|
||||
format = " {used:0.0f}/{total:0.0f}GB";
|
||||
};
|
||||
clock = {
|
||||
interval = 1;
|
||||
format = "{:%a %Y-%m-%dT%H:%M:%S%z}";
|
||||
"tooltip-format" = "<tt><small>{calendar}</small></tt>";
|
||||
"calendar" = {
|
||||
"mode" = "year";
|
||||
"mode-mon-col" = 3;
|
||||
"weeks-pos" = "right";
|
||||
"on-scroll" = 1;
|
||||
"format" = {
|
||||
"months" = "<span color='#ffead3'><b>{}</b></span>";
|
||||
"days" = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
"weeks" = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
"weekdays" = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
"today" = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
"actions" = {
|
||||
"on-click-right" = "mode";
|
||||
"on-scroll-up" = "shift_up";
|
||||
"on-scroll-down" = "shift_down";
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
format = " {specific_used:0.1f}/{specific_total:0.1f}TB";
|
||||
unit = "TB";
|
||||
path = "/";
|
||||
};
|
||||
"network" = {
|
||||
"on-click" = "${pkgs.foot}/bin/footclient --app-id floating-alacritty ${pkgs.impala}/bin/impala";
|
||||
"format" = "{ifname}";
|
||||
"format-wifi" = " {essid}";
|
||||
"format-ethernet" = " {ifname}";
|
||||
"format-disconnected" = " ";
|
||||
"tooltip-format" = "{ifname} via {gwaddr}\n{ipaddr}/{cidr}";
|
||||
"tooltip-format-wifi" = "{essid} ({signaldBm} dBm) {frequency} GHz\n{ipaddr}/{cidr}";
|
||||
"tooltip-format-ethernet" = "{ifname}\n{ipaddr}/{cidr}";
|
||||
"tooltip-format-disconnected" = "Disconnected";
|
||||
"max-length" = 50;
|
||||
};
|
||||
};
|
||||
xyno.desktop.waybar.style = ''
|
||||
* {
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
font-family: "Source Sans 3";
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
color: #a89984;
|
||||
background-color: #1d2021;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
/*window#waybar.termite {
|
||||
background-color: #3F3F3F;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: #000000;
|
||||
border: none;
|
||||
}*/
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpd {
|
||||
padding: 0 2px;
|
||||
background-color: #1d2021;
|
||||
color: #ebdbb2;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
|
||||
#temperature {
|
||||
color: #fabd2f;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background-color: #fbf1c7;
|
||||
color: #b57614;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: #FCF434; /* enby yellow */
|
||||
}
|
||||
#disk {
|
||||
color: #FFFFFF; /* enby white */
|
||||
}
|
||||
#network {
|
||||
color: #b8bb26; /* enby green */
|
||||
}
|
||||
#clock {
|
||||
color: #9C59D1; /* enby purple */
|
||||
/*color: #2C2C2C; enby black */
|
||||
}
|
||||
|
||||
|
||||
#network.disconnected {
|
||||
background-color: #fbf1c7;
|
||||
color: #9d0006;
|
||||
}
|
||||
|
||||
|
||||
#wireplumber {
|
||||
color: #fe8019;
|
||||
}
|
||||
|
||||
#tray > .needs-attention {
|
||||
background-color: #fbf1c7;
|
||||
color: #3c3836;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
background-color: #1d2021;
|
||||
color: #ebdbb2;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #fbf1c7;
|
||||
color: #3c3836;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue