nixos-config/modules/home-manager/awesome/simple/dotfiles/config/cpu.sh
2024-07-13 02:54:22 +09:00

5 lines
143 B
Bash

#!/usr/bin/env bash
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print int(100 - $1)}')
echo $cpu_usage