diff options
| author | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
|---|---|---|
| committer | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
| commit | 0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch) | |
| tree | 11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/sysinfo | |
| download | x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2 | |
hello world
Diffstat (limited to 'plugins/sysinfo')
| -rw-r--r-- | plugins/sysinfo/patches/sysinfo-0.1.0a-fontfix.diff | 199 | ||||
| -rw-r--r-- | plugins/sysinfo/patches/sysinfo-0.1.0a-gcc43.diff | 35 | ||||
| -rw-r--r-- | plugins/sysinfo/plugin.sh | 59 |
3 files changed, 293 insertions, 0 deletions
diff --git a/plugins/sysinfo/patches/sysinfo-0.1.0a-fontfix.diff b/plugins/sysinfo/patches/sysinfo-0.1.0a-fontfix.diff new file mode 100644 index 0000000..1d6f353 --- /dev/null +++ b/plugins/sysinfo/patches/sysinfo-0.1.0a-fontfix.diff @@ -0,0 +1,199 @@ +diff -ruN sysinfo-0.1.0a-orig/osdresources.c sysinfo-0.1.0a/osdresources.c +--- sysinfo-0.1.0a-orig/osdresources.c 2007-07-02 16:06:07.000000000 -0700 ++++ sysinfo-0.1.0a/osdresources.c 2007-07-02 16:09:24.000000000 -0700 +@@ -92,9 +92,8 @@ + char cTemp[100]; + strcpy(cTemp, itoa(iValue)); + strcat(cTemp, "%"); +- static const cFont *font = cFont::GetFont(fontOsd); + +- oProgressOsd->DrawText(iTextLeft, iTextTop, cTemp, clrWhite, clrBlack, font); ++ oProgressOsd->DrawText(iTextLeft, iTextTop, cTemp, clrWhite, clrBlack, cFont::GetFont(fontOsd)); + } + + +diff -ruN sysinfo-0.1.0a-orig/sysinfo.c sysinfo-0.1.0a/sysinfo.c +--- sysinfo-0.1.0a-orig/sysinfo.c 2007-07-02 16:06:29.000000000 -0700 ++++ sysinfo-0.1.0a/sysinfo.c 2007-07-02 16:09:29.000000000 -0700 +@@ -72,6 +72,7 @@ + + cOsdObject *cSysInfo::MainMenuAction(void) { + // Perform the action when selected from the main VDR menu. ++ const int LINEHEIGHT = cFont::GetFont(fontOsd)->Height(); + config.height=8 * (LINEHEIGHT + 4); + return new cSysInfoOsd; + } +diff -ruN sysinfo-0.1.0a-orig/sysinfoosd.c sysinfo-0.1.0a/sysinfoosd.c +--- sysinfo-0.1.0a-orig/sysinfoosd.c 2007-07-02 16:06:15.000000000 -0700 ++++ sysinfo-0.1.0a/sysinfoosd.c 2007-07-02 16:09:36.000000000 -0700 +@@ -98,7 +98,7 @@ + int iHalfHeight = (int)(iHeight/2); + sprintf(cTemp, tr("PLEASE WAIT...")); + +- osd->DrawText(iHalfWidth-100, iHalfHeight-20, cTemp, pal[3],pal[1],font); ++ osd->DrawText(iHalfWidth-100, iHalfHeight-20, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + DisplayBitmap(); + } + +@@ -201,30 +201,30 @@ + cOsdResources::DrawVerticallLine(osd, iWidth-2, 0, iHeight-2, pal[2]); + cOsdResources::DrawVerticallLine(osd, iWidth-129, 0, 33, pal[2]); + // Draw test +- osd->DrawText(10, 3, "SysInfo 0.1.0a", pal[2],pal[3],font); +- osd->DrawText(iWidth-120, 3, "by Kikko77", pal[2],pal[3],font); ++ osd->DrawText(10, 3, "SysInfo 0.1.0a", pal[2],pal[3],cFont::GetFont(fontOsd)); ++ osd->DrawText(iWidth-120, 3, "by Kikko77", pal[2],pal[3],cFont::GetFont(fontOsd)); + } + + void cSysInfoOsd::SensorData(int iTop) { + // Temperature + char cTemp[100]; + sprintf(cTemp, tr("Cpu temperature:")); +- osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + sprintf(cTemp, tr("M/B temperature:")); +- osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("sysinfo.sh cputemp", cTemp); +- osd->DrawText(270, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(270, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("sysinfo.sh mbtemp", cTemp); +- osd->DrawText(270, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(270, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Fan rpm + sprintf(cTemp, tr("Fan1:")); +- osd->DrawText(((config.width/2)+20), iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(((config.width/2)+20), iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + sprintf(cTemp, tr("Fan2:")); +- osd->DrawText(((config.width/2)+20), iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(((config.width/2)+20), iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("sysinfo.sh cpufan", cTemp); +- osd->DrawText(((config.width/2)+170), iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(((config.width/2)+170), iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("sysinfo.sh mbfan", cTemp); +- osd->DrawText(((config.width/2)+170), iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(((config.width/2)+170), iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Draw line separator + cOsdResources::DrawOrizontalLine(osd, iTop+74, 0, iWidth, pal[2]); + } +@@ -233,9 +233,9 @@ + void cSysInfoOsd::VideoSpace(int iTop) { + char cTemp[100]; + sprintf(cTemp, tr("Video disk free space:")); +- osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("sysinfo.sh vidspace", cTemp); +- osd->DrawText(285, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(285, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Draw line separator + cOsdResources::DrawOrizontalLine(osd, iTop+46, 0, iWidth, pal[2]); + } +@@ -244,20 +244,20 @@ + char cTemp[100]; + + sprintf(cTemp, tr("Linux kernel:")); +- osd->DrawText(15, 40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, 40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + sprintf(cTemp, tr("Cpu type:")); +- osd->DrawText(15, 70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, 70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Kernel e cpu type + ExecShellCmd("uname -r", cTemp); +- osd->DrawText(160, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(160, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("cat //proc//cpuinfo | grep 'processor' |grep '1'", cTemp); + if (cTemp[0]=='\0') { + ExecShellCmd("cat //proc//cpuinfo | grep 'model name' | cut -c 14-58 | uniq", cTemp); +- osd->DrawText(160, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(160, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + } else { + ExecShellCmd("cat //proc//cpuinfo | grep 'model name' | cut -c 14-58 | uniq", cTemp); +- osd->DrawText(160, iTop+70, "2 x ", pal[3],pal[1],font); +- osd->DrawText(200, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(160, iTop+70, "2 x ", pal[3],pal[1],cFont::GetFont(fontOsd)); ++ osd->DrawText(200, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + } + // Draw line separator + cOsdResources::DrawOrizontalLine(osd, iTop+104, 0, iWidth, pal[2]); +@@ -273,25 +273,25 @@ + + // Cpu Speed + sprintf(cTemp, tr("Cpu speed:")); +- osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("cat /proc/cpuinfo | grep 'cpu MHz' | cut -c 12-60", cTemp); + strcpy(cTemp, itoa(cUtility::CharToInt(cTemp))); + strcat(cTemp, "Mhz"); +- osd->DrawText(215, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Calculate cpu free + ExecShellCmd("CPU=0; for I in `ps -eo ""%C"" | grep ""\\.""`; do CPU=`echo $CPU $I | awk '{ print $1 + $2 }'`; done; echo $CPU", cTemp); + iPerCentCpu=cUtility::CharToInt(cTemp); + if (iPerCentCpu>100) iPerCentCpu=100; + sprintf(cTemp, tr("Cpu used:")); +- osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + strcpy(cTemp, (itoa(iPerCentCpu))); + strcat(cTemp, "%"); +- osd->DrawText(215, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + sprintf(cTemp, tr("Cpu free:")); +- osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + strcpy(cTemp, itoa(100-iPerCentCpu)); + strcat(cTemp, "%"); +- osd->DrawText(215, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Cpu Graph + d=((iDownGraph-iTopGraph)/100)*iPerCentCpu; + i=(int)d; +@@ -312,29 +312,29 @@ + + // total memory + sprintf(cTemp, tr("Total memory:")); +- osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("cat /proc/meminfo | grep -i 'MEMTOTAL' | cut -c 16-23 | tr -d ' '", cTemp); + dTemp=atof(cTemp); + int iMemTot=(int)(dTemp/1000); + strcpy(cTemp, itoa(iMemTot)); + strcat(cTemp, "Mb"); +- osd->DrawText(215, iTop+10, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Free memory + sprintf(cTemp, tr("Free memory:")); +- osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + ExecShellCmd("cat /proc/meminfo | grep -i 'MEMFREE' | cut -c 16-23 | tr -d ' '", cTemp); + dTemp=atof(cTemp); + int iMemFree=(int)(dTemp/1000); + strcpy(cTemp, itoa(iMemFree)); + strcat(cTemp, "Mb"); +- osd->DrawText(215, iTop+40, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Used memory + sprintf(cTemp, tr("Used memory:")); +- osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + int iMemUsed=iMemTot-iMemFree; + strcpy(cTemp, itoa(iMemUsed)); + strcat(cTemp, "Mb"); +- osd->DrawText(215, iTop+70, cTemp, pal[3],pal[1],font); ++ osd->DrawText(215, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd)); + // Mem Graph + iPerCentMem=(100*iMemUsed)/iMemTot; + d=((iDownGraph-iTopGraph)/100)*iPerCentMem; +diff -ruN sysinfo-0.1.0a-orig/sysinfoosd.h sysinfo-0.1.0a/sysinfoosd.h +--- sysinfo-0.1.0a-orig/sysinfoosd.h 2007-07-02 16:06:14.000000000 -0700 ++++ sysinfo-0.1.0a/sysinfoosd.h 2007-07-02 16:09:40.000000000 -0700 +@@ -6,8 +6,8 @@ + #include "utility.h" + #include <ctype.h> + +-static const cFont *font = cFont::GetFont(fontOsd); +-static const int LINEHEIGHT = font->Height(); ++//static const cFont *font = cFont::GetFont(fontOsd); ++//static const int LINEHEIGHT = font->Height(); + #define NBLINES 4 + + class cSysInfoOsd : public cThread, public cOsdObject { diff --git a/plugins/sysinfo/patches/sysinfo-0.1.0a-gcc43.diff b/plugins/sysinfo/patches/sysinfo-0.1.0a-gcc43.diff new file mode 100644 index 0000000..5430abe --- /dev/null +++ b/plugins/sysinfo/patches/sysinfo-0.1.0a-gcc43.diff @@ -0,0 +1,35 @@ +--- utility.h.orig 2005-04-02 23:43:21.000000000 +0200 ++++ utility.h 2009-03-01 16:16:28.000000000 +0100 +@@ -1,19 +1,20 @@ + #ifndef CUTILITY_H +-#define CUTILITY_H
+-
+-#include <iostream>
++#define CUTILITY_H ++ ++#include <iostream> + #include <fstream> +-#include <string>
+-
+-using namespace std;
++#include <string> ++#include <stdlib.h> ++ ++using namespace std; + + class cUtility { +- public:
+- static string StrTrim(string sInput);
+- static string StrBeforeChar(string sLine, char cFind);
+- static string StrAfterChar(string sLine, char cFind);
+- static int StrToInt(string sInput); +- static int CharToInt(char *cInput);
++ public: ++ static string StrTrim(string sInput); ++ static string StrBeforeChar(string sLine, char cFind); ++ static string StrAfterChar(string sLine, char cFind); ++ static int StrToInt(string sInput); ++ static int CharToInt(char *cInput); + }; + + #endif // CUTILITY_H diff --git a/plugins/sysinfo/plugin.sh b/plugins/sysinfo/plugin.sh new file mode 100644 index 0000000..90f016f --- /dev/null +++ b/plugins/sysinfo/plugin.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis) +# von Marc Wernecke - www.zulu-entertainment.de +# 05.05.2008 +# +# vdr-sysinfo + +# defaults +source ./../../x-vdr.conf +source ./../../setup.conf +source ./../../functions + +WEB="http://vdr-wiki.de/vdr/vdr-sysinfo/vdr-sysinfo-0.1.0a.tgz" +VERSION="sysinfo-0.1.0a" +LINK="sysinfo" + +VAR=`basename $WEB` +DIR=`pwd` + +# plugin entfernen +function clean_plugin() { + cd $SOURCEDIR/VDR/PLUGINS/src + rm -rf $LINK* + rm -f $VDRLIBDIR/libvdr-$LINK* + rm -f $VDRBINDIR/sysinfo.sh + log "cleaning $LINK" +} + +# plugin installieren +function install_plugin() { + download_plugin + extract_plugin + cd $SOURCEDIR/VDR/PLUGINS/src + rm -f $LINK + ln -vfs $VERSION $LINK + patch_plugin + + + ## plugin specials - start ## + if [ -f $DIR/sysinfo.sh ] ; then + cp -f $DIR/sysinfo.sh $VDRBINDIR + else + cp -f $SOURCEDIR/VDR/PLUGINS/src/$LINK/script/sysinfo.sh $VDRBINDIR + fi + chmod 0755 $VDRBINDIR/sysinfo.sh + ## plugin specials - ende ## +} + +# plugin commands +if [ $# \> 0 ]; then + cmd=$1 + cmd_plugin +else + install_plugin + log "install-plugin fuer $VERSION ist fertig" +fi + +exit 0 |
