nixos/home/common/optional/desktop/dwm/scripts/sb-cpu-pct.nix

9 lines
186 B
Nix
Raw Normal View History

2024-06-14 21:48:43 +01:00
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "sb-cpu-pct" ''
echo $(top -bn 1 |grep "Cpu(s)" | awk '{print $2+$6 "%"}' | sed "s/\..//g")
'')
];
}