This commit is contained in:
mjallen18
2025-11-12 20:01:54 -06:00
parent b42d9eff71
commit c2766e82af
4 changed files with 20 additions and 60 deletions

View File

@@ -101,19 +101,10 @@ in
layer = "bottom"; layer = "bottom";
modules-right = [ temperature = {
"temperature" cpu.enable = true;
"temperature#gpu" gpu.enable = true;
"keyboard-state#capslock" };
"keyboard-state#numlock"
"wireplumber#sink"
"bluetooth"
"network"
"idle_inhibitor"
"clock"
"battery"
"custom/weather"
];
extraModules = { extraModules = {
"custom/lights" = { "custom/lights" = {

View File

@@ -82,7 +82,7 @@ in
autostartCommands = [ autostartCommands = [
"[silent] firefox" "[silent] firefox"
"[silent] vesktop" "[silent] discord"
"[silent] chromium --app=\"https://music.apple.com\"" "[silent] chromium --app=\"https://music.apple.com\""
"[silent] steam" "[silent] steam"
]; ];
@@ -94,7 +94,7 @@ in
keybinds = { keybinds = {
bind = [ bind = [
"$mod, A, exec, chromium --app=\"https://music.apple.com\"" "$mod, A, exec, chromium --app=\"https://music.apple.com\""
"$mod, C, exec, vesktop" "$mod, C, exec, discord"
"$mod, G, exec, steam" "$mod, G, exec, steam"
]; ];
}; };
@@ -128,22 +128,11 @@ in
layer = "bottom"; layer = "bottom";
networkInterface = "wlp9s0"; network.interface = "wlp9s0";
temperature = {
modules-right = [ cpu.enable = true;
"custom/lights" gpu.enable = true;
"temperature" };
"temperature#gpu"
"keyboard-state#capslock"
"keyboard-state#numlock"
"wireplumber#sink"
"wireplumber#source"
"bluetooth"
"network"
"idle_inhibitor"
"clock"
"custom/weather"
];
extraModules = { extraModules = {
"custom/lights" = { "custom/lights" = {

View File

@@ -4,19 +4,6 @@ let
cfg = config.mjallen.programs.waybar; cfg = config.mjallen.programs.waybar;
palette = import cfg.theme.file; palette = import cfg.theme.file;
# Back-compat shims for deprecated options
rightModules =
if builtins.hasAttr "modules-right" cfg && (cfg."modules-right" != [ ]) then
cfg."modules-right"
else
cfg.layout.right;
netIf =
if (cfg ? networkInterface) && (cfg.networkInterface != "wlan0") then
cfg.networkInterface
else
cfg.network.interface;
defaultOpacity = palette.tokens.opacity or "opacity: 0.85;"; defaultOpacity = palette.tokens.opacity or "opacity: 0.85;";
defaultBorderRadius = palette.tokens.borderRadius or "border-radius: 1rem;"; defaultBorderRadius = palette.tokens.borderRadius or "border-radius: 1rem;";
defaultCenterOptions = defaultCenterOptions =
@@ -317,7 +304,7 @@ in
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
settings = ({ settings = {
mainBar = ( mainBar = (
(mkMerge [ (mkMerge [
{ {
@@ -332,7 +319,7 @@ in
# Module Layout # Module Layout
modules-left = cfg.layout.left; modules-left = cfg.layout.left;
modules-center = cfg.layout.center; modules-center = cfg.layout.center;
modules-right = rightModules; modules-right = cfg.layout.right;
# Base module definitions always present unless individually gated # Base module definitions always present unless individually gated
"hyprland/workspaces" = { "hyprland/workspaces" = {
@@ -365,7 +352,7 @@ in
}; };
network = { network = {
interface = netIf; interface = cfg.network.interface;
on-click = "nm-connection-editor"; on-click = "nm-connection-editor";
format = "{icon}"; format = "{icon}";
tooltip-format = "{ifname} via {gwaddr} 󰊗"; tooltip-format = "{ifname} via {gwaddr} 󰊗";
@@ -589,7 +576,7 @@ in
]) ])
// cfg.extra.settings // cfg.extra.settings
); );
}) }
// cfg.extraModules; # keep legacy top-level extra modules for compatibility // cfg.extraModules; # keep legacy top-level extra modules for compatibility
style = baseStyle + (cfg.extra.style or "") + (cfg.extraModulesStyle or ""); style = baseStyle + (cfg.extra.style or "") + (cfg.extraModulesStyle or "");

View File

@@ -23,18 +23,6 @@ in
description = "Waybar layer (compat). Prefer layout + feature flags."; description = "Waybar layer (compat). Prefer layout + feature flags.";
}; };
modules-right = mkOption {
type = listOf str;
default = [ ];
description = "DEPRECATED: use layout.right.";
};
networkInterface = mkOption {
type = str;
default = "wlan0";
description = "DEPRECATED: use network.interface.";
};
extraModules = mkOption { extraModules = mkOption {
type = attrs; type = attrs;
default = { }; default = { };
@@ -132,6 +120,11 @@ in
cpu = mkOption { cpu = mkOption {
type = submodule { type = submodule {
options = { options = {
enable = mkOption {
type = bool;
default = true;
description = "Enable CPU temperature module.";
};
hwmonPath = mkOption { hwmonPath = mkOption {
type = str; type = str;
default = "/sys/class/hwmon/hwmon4/temp1_input"; default = "/sys/class/hwmon/hwmon4/temp1_input";