From 81ab3a736c155e9726fa809061d4a2ef2ef1b6a8 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 30 Jun 2010 11:55:39 -0400 Subject: Show the CPU Frequency on the dashboard if it's not running at full speed (due to powerd) --- .../www/widgets/widgets/system_information.widget.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'usr/local/www/widgets/widgets/system_information.widget.php') diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 066133f..bbdd6b5 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -130,7 +130,19 @@ $curcfg = $config['system']['firmware']; $cpumodel = ""; exec("/sbin/sysctl -n hw.model", $cpumodel); $cpumodel = implode(" ", $cpumodel); - echo (htmlspecialchars($cpumodel)); ?> + echo (htmlspecialchars($cpumodel)); + + $cpufreqs = ""; + exec("/sbin/sysctl -n dev.cpu.0.freq_levels", $cpufreqs); + $cpufreqs = explode(" ", trim($cpufreqs[0])); + $maxfreq = explode("/", $cpufreqs[0]); + $maxfreq = $maxfreq[0]; + $curfreq = ""; + exec("/sbin/sysctl -n dev.cpu.0.freq", $curfreq); + $curfreq = trim($curfreq[0]); + if ($curfreq != $maxfreq) + echo "
Current: {$curfreq} MHz, Max: {$maxfreq} MHz"; + ?> -- cgit v1.1