From d6ea3790f48c54f8605cb125b7c8af9b9480e037 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Tue, 14 May 2024 17:59:41 -0700 Subject: [PATCH] powersaving options --- config/waybar.css | 4 ++++ hosts/goopnet-interface/hardware.nix | 6 ++++++ modules/desktop/waybar.nix | 23 ++++++++++++----------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/config/waybar.css b/config/waybar.css index 305d5a1..d739333 100644 --- a/config/waybar.css +++ b/config/waybar.css @@ -79,6 +79,10 @@ window#waybar.floating #window { color: @lavender; } +#power-profiles-daemon { + color: @teal; +} + #pulseaudio { color: @pink; } diff --git a/hosts/goopnet-interface/hardware.nix b/hosts/goopnet-interface/hardware.nix index ecca96a..610d2ba 100755 --- a/hosts/goopnet-interface/hardware.nix +++ b/hosts/goopnet-interface/hardware.nix @@ -21,8 +21,14 @@ efi.canTouchEfiVariables = true; }; + # support power features such as suspend to ram + powerManagement.enable = true; + # tune power saving options on boot; + powerManagement.powertop.enable = true; # thermald proactively prevents overheating on intel CPUs and works well with other tools services.thermald.enable = true; + # power-profile-daemon for power management + services.power-profiles-daemon.enable = true; # nvidia driver services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 0e4df6d..f4cb378 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -165,17 +165,7 @@ in { format = " {percentage}%"; tooltip-format = "{used:0.1f}GiB/{avail:0.1f}GiB used\n{swapUsed:0.1f}GiB/{swapAvail:0.1f}GiB swap"; }; - "network" = { - format = ""; - format-ethernet = ""; - format-wifi = " {signalStrength}%"; - format-disconnected = ""; - tooltip-format = "{ifname} via {gwaddr}"; - tooltip-format-wifi = "connected to {essid}"; - tooltip-format-ethernet = "{ifname}"; - tooltip-format-disconnected = "Disconnected"; - }; - "clock" = { + clock = { format = "{:%H:%M}"; format-alt = "{:%a %b %d %R}"; tooltip-format = "{calendar}"; @@ -201,6 +191,17 @@ in { }; }; }; + power-profiles-daemon = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + default = ""; + performance = " perf"; + balanced = " balance"; + power-saver = " save"; + }; + }; }; }; };