mirror of
https://github.com/StepanovPlaton/dotfiles.git
synced 2026-04-03 20:30:46 +04:00
12 lines
376 B
Bash
Executable File
12 lines
376 B
Bash
Executable File
#!/bin/env bash
|
|
colors_path=$HOME/.cache/wal/colors.sh
|
|
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
|
|
|
|
# cpu_usage=$(echo "$cpu_usage" | cut -c1-1)
|
|
cpu_usage=$(printf "%.0f" "$cpu_usage")
|
|
|
|
if [ -f "$colors_path" ]; then
|
|
source $colors_path
|
|
echo "^b$color1^^c$color0^ ^d^^b$color8^^c$color0^ $cpu_usage% ^d^"
|
|
fi
|