diff --git a/.config/polybar/cpu-wattage.sh b/.config/polybar/cpu-wattage.sh new file mode 100755 index 0000000..ec9ab53 --- /dev/null +++ b/.config/polybar/cpu-wattage.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +wattage=$(sensors zenpower-pci-00c3 | grep SVI2_P_Core | sed "s/SVI2_P_Core: //g") + +if [ -z "$wattage" ]; then + wattage="" +fi + +echo "$wattage" diff --git a/home-manager/i3.nix b/home-manager/i3.nix index 8066e82..e0c14a0 100644 --- a/home-manager/i3.nix +++ b/home-manager/i3.nix @@ -56,7 +56,7 @@ in { modules-left = "i3 xwindow"; modules-center = ""; modules-right = - "music network memory cpu cpu-temp gpu pulseaudio date tray"; + "music network memory cpu cpu-wattage cpu-temp gpu pulseaudio date tray"; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; @@ -177,6 +177,11 @@ in { format-prefix-foreground = config.stylix.base16Scheme.base0D; label = "%percentage:2%%"; }; + "module/cpu-wattage" = { + type = "custom/script"; + exec = "~/.config/polybar/cpu-wattage.sh"; + interval = 3; + }; "module/cpu-temp" = { type = "custom/script"; exec = "~/.config/polybar/temperature.sh"; diff --git a/modules/misc/cli-tools.nix b/modules/misc/cli-tools.nix index 60988bc..e46fad2 100644 --- a/modules/misc/cli-tools.nix +++ b/modules/misc/cli-tools.nix @@ -32,6 +32,7 @@ in environment.systemPackages = with pkgs; [ getTotalPowerUsed watchCurrentPowerUsed + powerjoular # monitor power usage fzf # fuzzy finder bat # fancy cat fd # nicer find diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index b808d9c..2ea2f6b 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -112,6 +112,11 @@ EndSection ''; + + #zenpower for ryzen + boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; + boot.kernelModules = ["zenpower"]; + boot.blacklistedKernelModules = [ "k10temp" ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true;