mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-26 23:34:57 +08:00
Former-commit-id: 46c2bf7d26
Former-commit-id: ec0b4e689f3f8e97d837848929a1a6a9e45f779b
Former-commit-id: 19f055447f5fd666a270a51cf98b05d70716e826
28 lines
498 B
Bash
Executable file
28 lines
498 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%"
|
|
# echo "CPU $CPU%"
|
|
# else
|
|
# echo "CPU $CPU%"
|
|
# fi
|
|
|