Add CPU usage percentage
All checks were successful
/ check (push) Successful in 52s

This commit is contained in:
Oliver Davies 2025-08-20 08:00:00 +01:00
parent 2d488eaa7a
commit d1eaa83712
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,17 @@
{
flake.modules.homeManager.gui =
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellApplication {
name = "status-cpu";
runtimeInputs = with pkgs; [ sysstat ];
text = ''
mpstat | grep -A 5 "%idle" | tail -n 1 | awk -F " " '{printf "%s%% CPU", 100 - $ 12}'
'';
})
];
};
}

View file

@ -14,6 +14,7 @@
{"", "free -h | awk '/^Mem/ { printf \"%s/%s RAM\\n\", $3, $2 }' | sed 's/i//g'", 30, 0},
{"", "status-cpu", 10, 0},
{"", "date '+%x %R'", 30, 0},
};