diff options
Diffstat (limited to 'media-plugins/vdr-systeminfo')
-rw-r--r-- | media-plugins/vdr-systeminfo/Manifest | 1 | ||||
-rw-r--r-- | media-plugins/vdr-systeminfo/files/confd | 20 | ||||
-rw-r--r-- | media-plugins/vdr-systeminfo/files/rc-addon.sh | 13 | ||||
-rw-r--r-- | media-plugins/vdr-systeminfo/files/systeminfo.sh | 116 | ||||
-rw-r--r-- | media-plugins/vdr-systeminfo/metadata.xml | 10 | ||||
-rw-r--r-- | media-plugins/vdr-systeminfo/vdr-systeminfo-0.1.1.ebuild | 29 |
6 files changed, 189 insertions, 0 deletions
diff --git a/media-plugins/vdr-systeminfo/Manifest b/media-plugins/vdr-systeminfo/Manifest new file mode 100644 index 000000000000..a473bc796fe4 --- /dev/null +++ b/media-plugins/vdr-systeminfo/Manifest @@ -0,0 +1 @@ +DIST vdr-systeminfo-0.1.1.tar.bz2 16816 SHA256 2764e88c07a84e4d42ab318e0cd7ad186b549c9843c6fed8e6aa964658685cc1 diff --git a/media-plugins/vdr-systeminfo/files/confd b/media-plugins/vdr-systeminfo/files/confd new file mode 100644 index 000000000000..06819d29b433 --- /dev/null +++ b/media-plugins/vdr-systeminfo/files/confd @@ -0,0 +1,20 @@ +# Global config file for VDR systeminfo plugin +# $Id$ + +# I most cases here is no user activity needed +# Yust if you get wrong or no output in OSD of plugin +# you have something to change on next parameter +# Get right parameter by run 'sensors' on Konsole + +CPU_TEMP="temp2" + +MOBO_TEMP="temp1" + +FAN_1="fan2" + +FAN_2="fan1" + +DISK_1="/dev/hda" + +#DISK_2="/dev/hdc" + diff --git a/media-plugins/vdr-systeminfo/files/rc-addon.sh b/media-plugins/vdr-systeminfo/files/rc-addon.sh new file mode 100644 index 000000000000..1f4dab2ff7b7 --- /dev/null +++ b/media-plugins/vdr-systeminfo/files/rc-addon.sh @@ -0,0 +1,13 @@ +# $Id$ +# +# rc-addon-script for plugin systeminfo +# +# Joerg Bornkessel <hd_brummy@gentoo.org> + +: ${SYSTEMINFO_SCRIPT:=/usr/share/vdr/systeminfo/systeminfo.sh} + +plugin_pre_vdr_start() { + +add_plugin_param "-s ${SYSTEMINFO_SCRIPT}" + +}
\ No newline at end of file diff --git a/media-plugins/vdr-systeminfo/files/systeminfo.sh b/media-plugins/vdr-systeminfo/files/systeminfo.sh new file mode 100644 index 000000000000..48760e0b2ddc --- /dev/null +++ b/media-plugins/vdr-systeminfo/files/systeminfo.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# systeminfo.sh: external data collection script +# This file belongs to the VDR plugin systeminfo +# +# See the main source file 'systeminfo.c' for copyright information and +# how to reach the author. +# +# $Id$ +# +# possible output formats: +# (blanks around tabs only for better reading) +# 1) Name \t Value displays Name and Value +# 2) Name \t Value1 \t Value2 displays Name, Value1 and Value2 +# 3) Name \t total used displays an additional progress bar (percentage) after the values +# 4) s \t Name \t ... defines a static value, this line is only requested during the first cycle +# +# special keywords (they are replaced by the plugin with the actual value): +# CPU% CPU usage in percent +# +# test with: for i in $(seq 1 16); do systeminfo.sh $i;echo;done +# + +PATH=/usr/bin:/bin:/sbin:/usr/sbin + +source /etc/conf.d/vdr.systeminfo + +case "$1" in + 1) # kernel version (static) + KERNEL=$(uname -rm) + echo -ne "s\tLinux Kernel:\t"$KERNEL + ;; + + 2) # distribution release (static) + if test -f /etc/gentoo-release; then + DISTRI="Gentoo" + RELEASE=$(head -n 1 /etc/gentoo-release) + fi + echo -ne "s\tDistribution:\t"$RELEASE + exit + ;; + + 3) # CPU type (static) + CPUTYPE=$(grep 'model name' /proc/cpuinfo | cut -d':' -f 2 | cut -d' ' -f2- | uniq) + echo -ne "s\tCPU Type:\t"$CPUTYPE + ;; + + 4) # current CPU speed + VAR=$(grep 'cpu MHz' /proc/cpuinfo | sed 's/.*: *\([0-9]*\)\.[0-9]*/\1 MHz/') + echo -ne "CPU speed:\t"$VAR + exit + ;; + + 5) # hostname and IP (static) + hostname=$(hostname) + dnsname=$(dnsdomainname) + IP=$(ifconfig eth0 | grep inet | cut -d: -f2 | cut -d' ' -f1) + echo -ne "s\tHostname:\t"${hostname:-<unknown>}"."${dnsname:-<unknown>}"\tIP: "${IP:-N/A} + exit + ;; + + 6) # fan speeds + CPU=$( sensors | grep -i ${FAN_1:=FAN1} | tr -s ' ' | cut -d' ' -f 2) + CASE=$(sensors | grep -i ${FAN_2:=Fan2} | tr -s ' ' | cut -d' ' -f 2) + echo -ne "Fans:\tCPU: "$CPU" rpm\tCase: "$CASE" rpm" + exit + ;; + + 7) # temperature of CPU and mainboard + CPU=$(sensors | grep -i ${CPU_TEMP:=CPU Temp} | tr -s ' ' | cut -d' ' -f 2) + MB=$( sensors | grep -i ${MOBO_TEMP:=M/B Temp} | tr -s ' ' | cut -d' ' -f 2) + echo -ne "Temperatures:\tCPU: "$CPU"\tMB: "$MB + exit + ;; + + 8) # temperature of hard disks + DISK1=$(hddtemp ${DISK_1:=/dev/sda} | cut -d: -f1,3) + DISK2=$(hddtemp ${DISK_2} | cut -d: -f1,3) + echo -ne "\t"$DISK1"\t"$DISK2 + exit + ;; + + 9) # CPU usage + echo -e "CPU time:\tCPU%" + exit + ;; + + 10) # header (static) + echo -ne "s\t\ttotal / free" + exit + ;; + + 11) # video disk usage + VAR=$(df -h | grep hd | grep video | tail -n 1 | tr -s ' ' | cut -d' ' -f 2,4) + echo -ne "Video Disk:\t"$VAR + exit + ;; + + 12) # memory usage + VAR=$( grep -E 'MemTotal|MemFree' /proc/meminfo | cut -d: -f2 | tr -d ' ') + echo -ne "Memory:\t"$VAR + exit + ;; + + 13) # swap usage + VAR=$(grep -E 'SwapTotal|SwapFree' /proc/meminfo | cut -d: -f2 | tr -d ' ') + echo -ne "Swap:\t"$VAR + exit + ;; + test) + echo "" + echo "Usage: systeminfo.sh {1|2|3|4|...}" + echo "" + exit 1 + ;; +esac +exit diff --git a/media-plugins/vdr-systeminfo/metadata.xml b/media-plugins/vdr-systeminfo/metadata.xml new file mode 100644 index 000000000000..5f9f14619db8 --- /dev/null +++ b/media-plugins/vdr-systeminfo/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>media-tv</herd> +<maintainer> +<email>vdr@gentoo.org</email> +<name>Gentoo VDR Project</name> +</maintainer> +</pkgmetadata> + diff --git a/media-plugins/vdr-systeminfo/vdr-systeminfo-0.1.1.ebuild b/media-plugins/vdr-systeminfo/vdr-systeminfo-0.1.1.ebuild new file mode 100644 index 000000000000..0914ffddeddb --- /dev/null +++ b/media-plugins/vdr-systeminfo/vdr-systeminfo-0.1.1.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit vdr-plugin-2 + +DESCRIPTION="VDR Plugin: systeminfo" +HOMEPAGE="http://firefly.vdr-developer.org/systeminfo/" +SRC_URI="http://firefly.vdr-developer.org/systeminfo/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="" + +DEPEND=">=media-video/vdr-1.4.7" + +RDEPEND="sys-apps/lm_sensors + app-admin/hddtemp" + +src_install() { + vdr-plugin-2_src_install + + insinto /usr/share/vdr/systeminfo/ + insopts -m0755 + doins "${FILESDIR}"/systeminfo.sh +} |