2024-05-11 13:55:23 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2024-05-11 17:05:42 +01:00
|
|
|
hostname,
|
2024-05-11 13:55:23 +01:00
|
|
|
fonts,
|
|
|
|
accentColour ? "base07",
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
systemd.user.targets.tray.Unit = {
|
|
|
|
Description = "Home Manager System Tray";
|
2024-05-27 21:07:45 +01:00
|
|
|
Requires = ["graphical-session.target"];
|
2024-05-11 13:55:23 +01:00
|
|
|
};
|
|
|
|
programs.waybar = {
|
|
|
|
enable = true;
|
|
|
|
systemd = {
|
|
|
|
enable = true;
|
|
|
|
target = "sway-session.target";
|
|
|
|
};
|
|
|
|
settings = rec {
|
|
|
|
main = {
|
|
|
|
name = "main";
|
|
|
|
layer = "top";
|
|
|
|
position = "top";
|
|
|
|
# Layout
|
2024-05-27 21:07:45 +01:00
|
|
|
"modules-left" = ["mpris"];
|
|
|
|
"modules-center" = ["sway/workspaces"];
|
2024-05-11 13:55:23 +01:00
|
|
|
"modules-right" = [
|
|
|
|
"custom/notification"
|
|
|
|
"pulseaudio"
|
|
|
|
"network"
|
|
|
|
"bluetooth"
|
|
|
|
"clock#calendar"
|
|
|
|
"clock"
|
|
|
|
"backlight"
|
|
|
|
"battery"
|
|
|
|
"custom/weather"
|
|
|
|
"tray"
|
|
|
|
];
|
|
|
|
# Module config
|
|
|
|
"sway/workspaces" = {
|
|
|
|
format = "{icon}";
|
|
|
|
format-icons = {
|
|
|
|
"1" = " ";
|
|
|
|
"2" = " ";
|
|
|
|
"3" = " ";
|
|
|
|
"4" = " ";
|
|
|
|
"5" = " ";
|
|
|
|
"6" = " ";
|
|
|
|
default = " ";
|
|
|
|
urgent = " ";
|
|
|
|
};
|
|
|
|
# show-special = false;
|
|
|
|
# sort-by-number = true;
|
|
|
|
all-outputs = false;
|
|
|
|
persistent-workspaces = {
|
|
|
|
"1" = [];
|
|
|
|
"2" = [];
|
|
|
|
"3" = [];
|
|
|
|
"4" = [];
|
|
|
|
"5" = [];
|
|
|
|
"6" = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"sway/window" = {
|
|
|
|
"format" = "{title}";
|
|
|
|
"max-length" = 50;
|
|
|
|
"rewrite" = {
|
|
|
|
"(.*) - GNU Emacs at (.*)" = " $1 [$2]";
|
|
|
|
"(Alacritty.*)" = " $1";
|
|
|
|
"(.*) - mpv" = " $1";
|
|
|
|
"swayimg: (.*)" = " $1";
|
|
|
|
"(btm)" = " Resource Usage [$1]";
|
|
|
|
"(cava)" = " Music Visualiser [$1]";
|
|
|
|
"(.*) - Thunar" = " $1";
|
|
|
|
"Mozilla Firefox" = " $1";
|
|
|
|
"(.*) — Mozilla Firefox" = " $1";
|
|
|
|
"Nyxt - (.*)" = " $1";
|
|
|
|
"(.*) - Chromium" = " $1";
|
|
|
|
"((?:.*)WebCord.*)" = " $1";
|
|
|
|
"(Signal.*)" = " $1";
|
|
|
|
"([Ss]team)" = " $1";
|
|
|
|
"(Prism Launcher.*)" = " Minecraft ($1)";
|
|
|
|
"(X2Go Client)" = " $1";
|
|
|
|
"(NoMachine|Nxplayer.bin) (.*)" = " $1 $2";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mpris = {
|
|
|
|
"format" = "{status_icon} {player_icon} {artist} - {title}";
|
|
|
|
"tooltip-format" = "{player_icon} ({player}) {dynamic}";
|
|
|
|
"title-len" = 64;
|
|
|
|
"interval" = 1;
|
|
|
|
"dynamic-order" = [
|
|
|
|
"album"
|
|
|
|
"artist"
|
|
|
|
"title"
|
|
|
|
"position"
|
|
|
|
"length"
|
|
|
|
];
|
|
|
|
"player-icons" = {
|
|
|
|
"default" = " ";
|
|
|
|
"emms" = " ";
|
|
|
|
"firefox" = " ";
|
|
|
|
"mpv" = " ";
|
|
|
|
};
|
|
|
|
"status-icons" = {
|
|
|
|
"playing" = "";
|
|
|
|
"paused" = "";
|
|
|
|
"stopped" = "";
|
|
|
|
};
|
|
|
|
"ignored-players" = [];
|
|
|
|
};
|
|
|
|
pulseaudio = {
|
|
|
|
scroll-step = 5;
|
|
|
|
format = "{format_source}{icon}{volume}%";
|
|
|
|
format-muted = "{format_source} ";
|
|
|
|
format-source = " ";
|
|
|
|
format-source-muted = " ";
|
|
|
|
format-icons = {
|
|
|
|
car = " ";
|
|
|
|
default = [" " " " " "];
|
|
|
|
hands-free = " ";
|
|
|
|
headset = " ";
|
|
|
|
phone = " ";
|
|
|
|
portable = " ";
|
|
|
|
headphone = " ";
|
|
|
|
};
|
|
|
|
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
|
|
|
on-click-right = "${pkgs.pamixer}/bin/pamixer -t";
|
|
|
|
on-scroll-up = "${pkgs.pamixer}/bin/pamixer -i 5";
|
|
|
|
on-scroll-down = "${pkgs.pamixer}/bin/pamixer -d 5";
|
|
|
|
};
|
|
|
|
disk = {
|
|
|
|
format = " {percentage_used}%";
|
|
|
|
path = config.home.homeDirectory;
|
|
|
|
};
|
|
|
|
cpu = {
|
|
|
|
format = " {usage}%";
|
|
|
|
tooltip = false;
|
|
|
|
};
|
|
|
|
memory = {format = " {}%";};
|
|
|
|
temperature = {
|
|
|
|
critical-threshold = 80;
|
|
|
|
format = "{icon} {temperatureC}°C";
|
|
|
|
format-icons = ["" "" ""];
|
|
|
|
};
|
|
|
|
network = {
|
|
|
|
format-icons = [" " " " " " " "];
|
|
|
|
format-wifi = "{icon}";
|
|
|
|
format-ethernet = " ";
|
|
|
|
tooltip-format = "{essid} ({signalStrength}%)";
|
|
|
|
format-linked = " ";
|
|
|
|
format-disconnected = " ";
|
|
|
|
};
|
|
|
|
bluetooth = {
|
|
|
|
format = "";
|
|
|
|
format-disabled = "";
|
|
|
|
format-off = "";
|
|
|
|
format-on = "";
|
|
|
|
format-connected = "";
|
|
|
|
tooltip-format = "{status} | {device_alias}";
|
|
|
|
on-click = "${pkgs.bluez}/bin/bluetoothctl power on";
|
|
|
|
on-click-right = "${pkgs.bluez}/bin/bluetoothctl power off";
|
|
|
|
};
|
|
|
|
"clock#calendar" = {
|
|
|
|
# format = "{: %Y-%m-%d}";
|
|
|
|
format = "{:%Y-%m-%d}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021
|
|
|
|
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
|
|
|
calendar = {
|
|
|
|
mode = "month";
|
|
|
|
mode-mon-col = 3;
|
|
|
|
weeks-pos = "left";
|
|
|
|
on-scroll = 1;
|
|
|
|
on-click-right = "mode";
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
clock = {
|
|
|
|
# format = "{: %R}";
|
|
|
|
format = "{:%R}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021
|
|
|
|
};
|
|
|
|
backlight = {
|
|
|
|
format = "{icon}";
|
|
|
|
tooltip-format = "{percent}%";
|
|
|
|
format-icons = [" " " " " " " " " " " " " " " " " "];
|
|
|
|
};
|
|
|
|
battery = {
|
|
|
|
states = {
|
|
|
|
warning = 30;
|
|
|
|
critical = 20;
|
|
|
|
};
|
|
|
|
format = "{icon}";
|
|
|
|
format-charging = " ";
|
|
|
|
format-plugged = " ";
|
|
|
|
tooltip-format = "{capacity}% {time}";
|
|
|
|
format-icons = [" " " " " " " " " " " " " " " " " " " " " "];
|
|
|
|
};
|
|
|
|
"custom/notification" = let
|
|
|
|
swaync = pkgs.swaynotificationcenter;
|
|
|
|
in {
|
|
|
|
"tooltip" = false;
|
|
|
|
"format" = "{icon}{}";
|
|
|
|
"format-icons" = {
|
|
|
|
"notification" = " ";
|
|
|
|
"none" = " ";
|
|
|
|
"dnd-notification" = " ";
|
|
|
|
"dnd-none" = " ";
|
|
|
|
"inhibited-notification" = " ";
|
|
|
|
"inhibited-none" = " ";
|
|
|
|
"dnd-inhibited-notification" = " ";
|
|
|
|
"dnd-inhibited-none" = " ";
|
|
|
|
};
|
|
|
|
"return-type" = "json";
|
|
|
|
"exec-if" = "which ${swaync}/bin/swaync-client";
|
|
|
|
"exec" = "${swaync}/bin/swaync-client -swb";
|
|
|
|
"on-click" = "${swaync}/bin/swaync-client -t -sw";
|
|
|
|
"on-click-right" = "${swaync}/bin/swaync-client -d -sw";
|
|
|
|
"escape" = true;
|
|
|
|
};
|
|
|
|
"custom/weather" = let
|
|
|
|
date-format = "%Y-%m-%d";
|
|
|
|
custom-indicator = "{ICON}{temp_C}({FeelsLikeC})";
|
|
|
|
in {
|
|
|
|
"format" = "{}°";
|
|
|
|
"tooltip" = true;
|
|
|
|
"interval" = 900; # Every 15 minutes
|
|
|
|
"exec" = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"'';
|
|
|
|
"return-type" = "json";
|
|
|
|
};
|
|
|
|
tray = {
|
|
|
|
icon-size = builtins.floor fonts.sizes.popups;
|
|
|
|
show-passive-items = true;
|
|
|
|
spacing = 5;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# TEMP FIX
|
2024-05-11 17:05:42 +01:00
|
|
|
alt = lib.mkIf (hostname == "Vanguard") {
|
2024-05-11 13:55:23 +01:00
|
|
|
inherit (main) layer position "sway/workspaces";
|
|
|
|
name = "alt";
|
|
|
|
"modules-left" = [];
|
|
|
|
"modules-center" = ["sway/workspaces"];
|
|
|
|
"modules-right" = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
style = with config.scheme.withHashtag; let
|
|
|
|
accent = config.scheme.withHashtag.${accentColour};
|
2024-05-27 21:07:45 +01:00
|
|
|
alpha = "0.8";
|
2024-05-11 13:55:23 +01:00
|
|
|
in ''
|
|
|
|
* {
|
|
|
|
all: unset;
|
|
|
|
font-size: 1em;
|
|
|
|
font-family: ${fonts.monospace.name};
|
|
|
|
}
|
|
|
|
|
|
|
|
window {
|
|
|
|
background: transparent;
|
2024-05-13 16:51:05 +01:00
|
|
|
box-shadow: none;
|
2024-05-11 13:55:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
window > box {
|
|
|
|
color: ${base05};
|
2024-05-27 21:07:45 +01:00
|
|
|
background: alpha(${base00}, ${alpha});
|
2024-05-11 13:55:23 +01:00
|
|
|
padding: 0px;
|
2024-05-27 20:07:18 +01:00
|
|
|
border: none;
|
2024-05-11 13:55:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tooltip {
|
2024-05-27 21:07:45 +01:00
|
|
|
background: alpha(${base00}, ${alpha});
|
2024-05-27 20:07:18 +01:00
|
|
|
border: none;
|
2024-05-13 16:51:05 +01:00
|
|
|
box-shadow: none;
|
2024-05-11 13:55:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tooltip label {
|
|
|
|
color: ${base05};
|
|
|
|
border: none;
|
|
|
|
padding: 5px;
|
|
|
|
margin: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces,
|
|
|
|
#window,
|
|
|
|
#mpris,
|
|
|
|
#pulseaudio,
|
|
|
|
#network,
|
|
|
|
#bluetooth,
|
|
|
|
#backlight,
|
|
|
|
#battery,
|
|
|
|
#clock,
|
|
|
|
#custom-notification,
|
|
|
|
#custom-weather,
|
|
|
|
#tray {
|
|
|
|
margin: 0px;
|
|
|
|
padding: 1px 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces,
|
|
|
|
#window,
|
|
|
|
#mpris,
|
|
|
|
#tray,
|
|
|
|
#backlight,
|
|
|
|
#battery,
|
|
|
|
#custom-weather {
|
|
|
|
color: ${base05};
|
|
|
|
}
|
|
|
|
|
|
|
|
#workspaces button {
|
|
|
|
background: transparent;
|
|
|
|
color: ${base05};
|
|
|
|
margin: 0px;
|
|
|
|
padding: 0px 5px;
|
|
|
|
}
|
|
|
|
#workspaces button.persistent {
|
|
|
|
color: ${base03};
|
|
|
|
}
|
|
|
|
#workspaces button.focused {
|
|
|
|
color: ${accent};
|
|
|
|
}
|
|
|
|
#workspaces button.urgent {
|
|
|
|
color: ${base09};
|
|
|
|
}
|
|
|
|
|
|
|
|
#custom-notification {
|
|
|
|
color: ${base08};
|
|
|
|
}
|
|
|
|
#pulseaudio {
|
|
|
|
color: ${base09};
|
|
|
|
}
|
|
|
|
#network {
|
|
|
|
color: ${base0A};
|
|
|
|
}
|
|
|
|
#bluetooth {
|
|
|
|
color: ${base0B};
|
|
|
|
}
|
|
|
|
#clock.calendar {
|
|
|
|
color: ${base0C};
|
|
|
|
}
|
|
|
|
#clock {
|
|
|
|
color: ${base0D};
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|