File: monCPU

package info (click to toggle)
xfce4-genmon-plugin 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 932 kB
  • sloc: ansic: 1,273; sh: 314; makefile: 129; perl: 21
file content (17 lines) | stat: -rwxr-xr-x 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# An example script for the genmon plugin displaying information on the CPU

echo "<img>/usr/local/share/icons/Tango/16x16/apps/utilities-system-monitor.png</img>"

declare -i cpuFreq
cpuFreq=$(cat /proc/cpuinfo | grep "cpu MHz" | sed 's/\ \ */ /g' | cut -f3 -d" " | cut -f1 -d".")

if [ $cpuFreq -ge 1000 ]
then
  cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz
else
  cpu=${cpuFreq}MHz
fi
echo "<txt>"$(cat /proc/acpi/thermal_zone/THM/temperature | sed 's/\ \ */ /g' | cut -f2 -d" ")"°C</txt>"
echo "<tool>Freq: "$cpu"</tool>"