mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-26 23:34:57 +08:00
Former-commit-id: 6c9faff508
Former-commit-id: 17d19dad6bdde82ff8c2bcc983f87a49bb4a5e6f
Former-commit-id: 4f66d0d17a4bb9ceb3eedf158bae309fa71fb8b1
27 lines
471 B
Bash
Executable file
27 lines
471 B
Bash
Executable file
#!/bin/bash
|
|
|
|
#
|
|
CPU="$[100-$(vmstat 1 2|tail -1|awk '{printf "%d", $15}')]"
|
|
# GOVERNOR="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
|
|
|
|
# if [[ "$GOVERNOR" == "performance" ]]; then
|
|
# echo " $CPU%"
|
|
# else
|
|
# echo " $CPU%"
|
|
# fi
|
|
|
|
# Lazy whitespace padding
|
|
# With icon
|
|
# if [ "$CPU" -ge "10" ]; then
|
|
# echo " $CPU%"
|
|
# else
|
|
# echo " $CPU%"
|
|
# fi
|
|
|
|
# Just text
|
|
if [ "$CPU" -ge "10" ]; then
|
|
echo "cpu $CPU%"
|
|
else
|
|
echo "cpu $CPU%"
|
|
fi
|
|
|