Refactored file structure to make more sense, made default.nixes less verbose
This commit is contained in:
6
modules/home/environment/waybar/default.nix
Normal file
6
modules/home/environment/waybar/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{...}: {
|
||||
imports =
|
||||
[(import ./waybar.nix)]
|
||||
++ [(import ./settings.nix)]
|
||||
++ [(import ./style.nix)];
|
||||
}
|
||||
147
modules/home/environment/waybar/settings.nix
Normal file
147
modules/home/environment/waybar/settings.nix
Normal file
@@ -0,0 +1,147 @@
|
||||
{...}: {
|
||||
programs.waybar.settings.mainBar = {
|
||||
position = "top";
|
||||
layer = "top";
|
||||
height = 5;
|
||||
margin-top = 0;
|
||||
margin-bottom = 0;
|
||||
margin-left = 0;
|
||||
margin-right = 0;
|
||||
modules-left = [
|
||||
"custom/launcher"
|
||||
"custom/separator"
|
||||
"hyprland/workspaces"
|
||||
];
|
||||
modules-center = [
|
||||
"clock"
|
||||
];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"custom/separator"
|
||||
"cpu"
|
||||
"memory"
|
||||
"disk"
|
||||
"custom/separator"
|
||||
"pulseaudio"
|
||||
"battery"
|
||||
"network"
|
||||
"custom/separator"
|
||||
"custom/notification"
|
||||
];
|
||||
clock = {
|
||||
calendar = {
|
||||
format = {today = "<span color='#b4befe'><b><u>{}</u></b></span>";};
|
||||
};
|
||||
format = " {:%H:%M}";
|
||||
tooltip = "true";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
format-alt = " {:%d/%m}";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
active-only = false;
|
||||
disable-scroll = true;
|
||||
format = "{icon}";
|
||||
on-click = "activate";
|
||||
format-icons = {
|
||||
"1" = "一";
|
||||
"2" = "二";
|
||||
"3" = "三";
|
||||
"4" = "四";
|
||||
"5" = "五";
|
||||
"6" = "六";
|
||||
urgent = "";
|
||||
default = "";
|
||||
sort-by-number = true;
|
||||
};
|
||||
persistent-workspaces = {
|
||||
"1" = [];
|
||||
"2" = [];
|
||||
"3" = [];
|
||||
"4" = [];
|
||||
"5" = [];
|
||||
"6" = [];
|
||||
};
|
||||
};
|
||||
memory = {
|
||||
format = " {}%";
|
||||
format-alt = " {used} GiB"; #
|
||||
interval = 2;
|
||||
};
|
||||
cpu = {
|
||||
format = " {usage}%";
|
||||
format-alt = " {avg_frequency} GHz";
|
||||
interval = 2;
|
||||
};
|
||||
disk = {
|
||||
# path = "/";
|
||||
format = " {percentage_used}%";
|
||||
interval = 60;
|
||||
};
|
||||
network = {
|
||||
format-wifi = " {signalStrength}%";
|
||||
format-ethernet = " ";
|
||||
tooltip-format = "Connected to {essid} {ifname} via {gwaddr}";
|
||||
format-linked = "{ifname} (No IP)";
|
||||
format-disconnected = " ";
|
||||
};
|
||||
tray = {
|
||||
icon-size = 20;
|
||||
spacing = 8;
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = " {volume}%";
|
||||
format-icons = {
|
||||
default = [" "];
|
||||
};
|
||||
scroll-step = 5;
|
||||
on-click = "pamixer -t";
|
||||
on-click-right = "pavucontrol";
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
format-charging = " {capacity}%";
|
||||
format-full = " {capacity}%";
|
||||
format-warning = " {capacity}%";
|
||||
interval = 5;
|
||||
states = {
|
||||
warning = 20;
|
||||
};
|
||||
format-time = "{H}h{M}m";
|
||||
tooltip = true;
|
||||
tooltip-format = "{time}";
|
||||
};
|
||||
"custom/launcher" = {
|
||||
format = "";
|
||||
on-click = "fuzzel";
|
||||
on-click-right = "wallpaper-picker";
|
||||
tooltip = "false";
|
||||
};
|
||||
"custom/notification" = {
|
||||
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";
|
||||
exec-if = "which swaync-client";
|
||||
exec = "swaync-client -swb";
|
||||
on-click = "swaync-client -t -sw";
|
||||
on-click-right = "swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
"custom/separator" = {
|
||||
exec = "echo ' | '";
|
||||
interval = 600;
|
||||
tooltip = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
98
modules/home/environment/waybar/style.nix
Normal file
98
modules/home/environment/waybar/style.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{...}: let
|
||||
custom = {
|
||||
font = "JetBrainsMono Nerd Font";
|
||||
font_size = "22px";
|
||||
font_weight = "bold";
|
||||
text_color = "#cdd6f4";
|
||||
secondary_accent = "#89b4fa";
|
||||
tertiary_accent = "#f5f5f5";
|
||||
background = "#11111B";
|
||||
};
|
||||
in {
|
||||
programs.waybar.style = ''
|
||||
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-height: 0px;
|
||||
font-family: ${custom.font};
|
||||
font-weight: ${custom.font_weight};
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: ${custom.background};
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
font-size: ${custom.font_size};
|
||||
|
||||
}
|
||||
#workspaces button {
|
||||
color: ${custom.text_color};
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
}
|
||||
#workspaces button.empty {
|
||||
color: #6c7086;
|
||||
}
|
||||
#workspaces button.active {
|
||||
color: #b4befe;
|
||||
}
|
||||
|
||||
#tray, #pulseaudio, #network, #cpu, #memory, #disk, #clock, #battery, #custom-notification {
|
||||
font-size: ${custom.font_size};
|
||||
color: ${custom.text_color};
|
||||
}
|
||||
|
||||
#cpu {
|
||||
padding-left: 5px;
|
||||
padding-right: 9px;
|
||||
}
|
||||
#memory {
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
}
|
||||
#disk {
|
||||
padding-left: 9px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-left: 7px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
padding-left: 5px;
|
||||
padding-right: 9px;
|
||||
}
|
||||
#battery {
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
}
|
||||
#network {
|
||||
padding-left: 9px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
custom-notification {
|
||||
padding-left: 15px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding-left: 9px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#custom-launcher {
|
||||
font-size: ${custom.font_size};
|
||||
color: #b4befe;
|
||||
font-weight: ${custom.font_weight};
|
||||
padding-left: 10px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
'';
|
||||
}
|
||||
8
modules/home/environment/waybar/waybar.nix
Normal file
8
modules/home/environment/waybar/waybar.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{pkgs, ...}: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
};
|
||||
programs.waybar.package = pkgs.waybar.overrideAttrs (oa: {
|
||||
mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"];
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user