401 lines
11 KiB
Nix
Executable File
401 lines
11 KiB
Nix
Executable File
{ pkgs, ... }:
|
|
let
|
|
theme = import ../../theme.nix { inherit pkgs; };
|
|
|
|
defaultOpacity = "opacity: 0.85;";
|
|
defaultBorderRadius = "border-radius: 1rem;";
|
|
defaultCenterOptions = ''
|
|
padding: 0.5rem 1rem;
|
|
margin: 5px 0;
|
|
'';
|
|
borderRight = ''
|
|
padding: 0.5rem 1rem;
|
|
margin: 5px 0;
|
|
border-radius: 0rem 1rem 1rem 0rem;
|
|
margin-right: 1rem;
|
|
'';
|
|
borderLeft = ''
|
|
padding: 0.5rem 1rem;
|
|
margin: 5px 0;
|
|
border-radius: 1rem 0rem 0rem 1rem;
|
|
margin-left: 1rem;
|
|
'';
|
|
in
|
|
{
|
|
imports = [
|
|
./scripts/weather.nix
|
|
];
|
|
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
|
|
# https://www.nerdfonts.com/cheat-sheet
|
|
|
|
programs.waybar = {
|
|
enable = true;
|
|
systemd.enable = true;
|
|
settings = {
|
|
mainBar = {
|
|
layer = "bottom";
|
|
position = "top";
|
|
mod = "dock";
|
|
exclusive = true;
|
|
passthrough = false;
|
|
gtk-layer-shell = true;
|
|
height = 0;
|
|
|
|
# Module Layout
|
|
modules-left = [ "hyprland/workspaces" ];
|
|
|
|
modules-center = [ "hyprland/window" ];
|
|
|
|
modules-right = [
|
|
"tray"
|
|
# "custom/updates"
|
|
"custom/lights"
|
|
"temperature"
|
|
"temperature#gpu"
|
|
"keyboard-state#capslock"
|
|
"keyboard-state#numlock"
|
|
"wireplumber#sink"
|
|
"wireplumber#source"
|
|
"bluetooth"
|
|
"clock"
|
|
"custom/weather"
|
|
];
|
|
|
|
# Module Definitions
|
|
# Left
|
|
"hyprland/workspaces" = {
|
|
disable-scroll = true;
|
|
all-outputs = true;
|
|
on-click = "activate";
|
|
persistent_workspaces = {
|
|
"*" = 1;
|
|
};
|
|
};
|
|
|
|
# Center
|
|
"hyprland/window" = {
|
|
separate-outputs = true;
|
|
format = { };
|
|
};
|
|
|
|
# Left
|
|
tray = {
|
|
icon-size = 16;
|
|
spacing = 10;
|
|
};
|
|
|
|
# "custom/updates" = {
|
|
# tooltip = true;
|
|
# format = { };
|
|
# interval = 30;
|
|
# exec = "waybar-updates";
|
|
# return-type = "json";
|
|
# };
|
|
|
|
"custom/lights" = {
|
|
tooltip = false;
|
|
format = "";
|
|
on-click = "nix-shell /home/matt/.config/waybar/scripts/hass.nix --run \"python /home/matt/.config/waybar/scripts/hass.py --toggle_light light.bedroom_lights\"";
|
|
};
|
|
|
|
temperature = {
|
|
hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input";
|
|
critical-threshold = 100;
|
|
format-critical = "{temperatureC}°C {icon}";
|
|
format = "{temperatureC}°C {icon}";
|
|
format-icons = [
|
|
"" # fa-temperature-empty
|
|
"" # fa-temperature-quarter
|
|
"" # fa-temperature-half
|
|
"" # fa-temperature-three-quarters
|
|
"" # fa-temperature-full
|
|
"" # fa-temperature-high
|
|
];
|
|
tooltip-format = "CPU: {temperatureC}°C";
|
|
};
|
|
|
|
"temperature#gpu" = {
|
|
hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input";
|
|
critical-threshold = 100;
|
|
format-critical = "{temperatureC}°C {icon}";
|
|
format = "{temperatureC}°C {icon}";
|
|
format-icons = [
|
|
"" # fa-temperature-empty
|
|
"" # fa-temperature-quarter
|
|
"" # fa-temperature-half
|
|
"" # fa-temperature-three-quarters
|
|
"" # fa-temperature-full
|
|
"" # fa-temperature-high
|
|
];
|
|
on-click = "lact";
|
|
tooltip-format = "GPU: {temperatureC}°C";
|
|
};
|
|
|
|
"keyboard-state#capslock" = {
|
|
capslock = true;
|
|
icon-size = 20;
|
|
format = "{icon}";
|
|
tooltip-format = "Caps Lock {state}";
|
|
format-icons = {
|
|
locked = "";
|
|
unlocked = "";
|
|
};
|
|
};
|
|
|
|
"keyboard-state#numlock" = {
|
|
numlock = true;
|
|
icon-size = 60;
|
|
format = "{icon}";
|
|
tooltip-format = "Num Lock {state}";
|
|
format-icons = {
|
|
locked = "";
|
|
unlocked = "";
|
|
};
|
|
};
|
|
|
|
"wireplumber#sink" = {
|
|
format = "{icon} {volume}%";
|
|
tooltip = false;
|
|
format-muted = "{icon} Muted";
|
|
on-click = "wpctl set-mute @DEFAULT_SINK@ toggle";
|
|
on-click-right = "pavucontrol -t 1";
|
|
on-scroll-up = "wpctl set-volume @DEFAULT_SINK@ 5%+";
|
|
on-scroll-down = "wpctl set-volume @DEFAULT_SINK@ 5%-";
|
|
scroll-step = 5;
|
|
format-icons = {
|
|
headphone = "";
|
|
headphone-muted = "";
|
|
hands-free = "";
|
|
headset = "";
|
|
phone = "";
|
|
portable = "";
|
|
car = "";
|
|
default = [
|
|
""
|
|
""
|
|
""
|
|
""
|
|
];
|
|
};
|
|
};
|
|
|
|
"wireplumber#source" = {
|
|
node-type = "Audio/Source";
|
|
format = "";
|
|
format-muted = "";
|
|
tooltip = false;
|
|
# tooltip-format = "{source_desc} | {source_volume}%";
|
|
on-click = "wpctl set-mute @DEFAULT_SOURCE@ toggle";
|
|
on-click-right = "pavucontrol -t 2";
|
|
on-scroll-up = "wpctl set-volume @DEFAULT_SOURCE@ 5%+";
|
|
on-scroll-down = "wpctl set-volume @DEFAULT_SOURCE@ 5%-";
|
|
scroll-step = 5;
|
|
};
|
|
|
|
"bluetooth" = {
|
|
on-click = "overskride";
|
|
tooltip = true;
|
|
format = "{format-off}";
|
|
format-disabled = "";
|
|
format-off = "";
|
|
format-on = "";
|
|
format-connected = "";
|
|
tooltip-format = "{status}";
|
|
tooltip-format-disabled = "{status}";
|
|
tooltip-format-off = "{status}";
|
|
tooltip-format-on = "{status}";
|
|
tooltip-format-connected = "{status}";
|
|
tooltip-format-enumerate-connected = { };
|
|
};
|
|
|
|
clock = {
|
|
format = "{:%I:%M %p}";
|
|
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
|
calendar = {
|
|
mode = "month";
|
|
format = {
|
|
months = "<span color='${theme.nord.frost.nord9}'><b>{}</b></span>";
|
|
days = "<span color='${theme.nord.frost.nord10}'><b>{}</b></span>";
|
|
weekdays = "<span color='${theme.nord.frost.nord8}'><b>{}</b></span>";
|
|
today = "<span color='${theme.nord.aurora.nord14}'><b><u>{}</u></b></span>";
|
|
};
|
|
};
|
|
};
|
|
|
|
"custom/weather" = {
|
|
tooltip = true;
|
|
format = { };
|
|
interval = 30;
|
|
exec = "waybar-weather";
|
|
return-type = "json";
|
|
};
|
|
};
|
|
};
|
|
|
|
style = ''
|
|
* {
|
|
font-family:
|
|
Jetbrains Mono Nerd Font,
|
|
monospace;
|
|
font-size: 14px;
|
|
min-height: 0;
|
|
}
|
|
|
|
#waybar {
|
|
background: transparent;
|
|
color: ${theme.nord.snowStorm.nord6};
|
|
margin: 5px 5px;
|
|
}
|
|
|
|
#workspaces {
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultBorderRadius}
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
margin-left: 1rem;
|
|
}
|
|
|
|
#workspaces button {
|
|
color: ${theme.nord.frost.nord10};
|
|
${defaultBorderRadius}
|
|
padding: 0.4rem;
|
|
}
|
|
|
|
#workspaces button.active {
|
|
color: ${theme.nord.frost.nord8};
|
|
${defaultBorderRadius}
|
|
}
|
|
|
|
#workspaces button:hover {
|
|
color: ${theme.nord.frost.nord7};
|
|
${defaultBorderRadius}
|
|
}
|
|
|
|
#workspaces button.focused {
|
|
color: ${theme.nord.snowStorm.nord6};
|
|
background: ${theme.nord.aurora.nord13};
|
|
${defaultBorderRadius}
|
|
}
|
|
|
|
#workspaces button.urgent {
|
|
color: ${theme.nord.polarNight.nord0};
|
|
background: ${theme.nord.snowStorm.nord6};
|
|
${defaultBorderRadius}
|
|
}
|
|
|
|
#tooltip {
|
|
background: ${theme.nord.polarNight.nord0};
|
|
border-color: ${theme.nord.polarNight.nord0};
|
|
${defaultBorderRadius}
|
|
border-width: 1rem;
|
|
border-style: solid;
|
|
}
|
|
|
|
#window {
|
|
color: ${theme.nord.aurora.nord15};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultBorderRadius}
|
|
${defaultCenterOptions}
|
|
margin-left: 6rem;
|
|
margin-right: 6rem;
|
|
}
|
|
|
|
#custom-weather {
|
|
color: ${theme.nord.frost.nord10};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${borderRight}
|
|
}
|
|
|
|
#clock {
|
|
color: ${theme.nord.frost.nord9};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${borderLeft}
|
|
}
|
|
|
|
/* ------------- */
|
|
|
|
#bluetooth {
|
|
color: ${theme.nord.frost.nord9};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${borderRight}
|
|
}
|
|
|
|
#wireplumber.source {
|
|
color: ${theme.nord.frost.nord8};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#wireplumber.sink {
|
|
color: ${theme.nord.frost.nord7};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#keyboard-state.numlock {
|
|
color: ${theme.nord.frost.nord8};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#keyboard-state.capslock {
|
|
color: ${theme.nord.frost.nord9};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#temperature.gpu {
|
|
color: ${theme.nord.frost.nord10};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#temperature {
|
|
color: ${theme.nord.frost.nord9};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
border-radius: 0;
|
|
}
|
|
|
|
#custom-updates {
|
|
color: ${theme.nord.frost.nord8};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${borderLeft}
|
|
}
|
|
|
|
#custom-lights {
|
|
color: ${theme.nord.frost.nord8};
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${borderLeft}
|
|
}
|
|
|
|
/* ------------- */
|
|
|
|
#tray {
|
|
background-color: ${theme.nord.polarNight.nord0};
|
|
${defaultOpacity}
|
|
${defaultCenterOptions}
|
|
${defaultBorderRadius}
|
|
margin-right: 1rem;
|
|
}
|
|
'';
|
|
};
|
|
}
|