This commit is contained in:
parent
2d488eaa7a
commit
d1eaa83712
2 changed files with 18 additions and 0 deletions
17
modules/hosts/t480/dwm/dwmblocks/cpu.nix
Normal file
17
modules/hosts/t480/dwm/dwmblocks/cpu.nix
Normal 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}'
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
{"", "free -h | awk '/^Mem/ { printf \"%s/%s RAM\\n\", $3, $2 }' | sed 's/i//g'", 30, 0},
|
{"", "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},
|
{"", "date '+%x %R'", 30, 0},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue