#!/bin/sh num=$(top -b -n 1 | sed -n '3p' | awk '{print $8}') cpu_use=$(awk -v y=$num 'BEGIN{printf "%.1f\n",100-y}') notify-send "CPU使用率:$cpu_use"
#!/bin/sh num=$(top -b -n 1 | sed -n '3p' | awk '{print $8}') cpu_use=$(awk -v y=$num 'BEGIN{printf "%.1f\n",100-y}') notify-send "CPU使用率:$cpu_use"