Skip to content

Commit

Permalink
Add testing GPUTEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jun 28, 2014
1 parent 836c229 commit 7cddd90
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/i-nex/.src/MInit.module
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Public Sub _inits()
Logs("i-nex in home folder is exist", Logger.Info)
Logs("Try to remove files", Logger.Info)
Try Kill User.Home & "/.i-nex/screenfetch-dev"

Try Kill User.Home & "/.i-nex/gputemp"
Else
Logs("i-nex in home folder not exist", Logger.Error)
Try Mkdir User.Home & "/.i-nex/"
Expand All @@ -36,6 +36,8 @@ Public Sub _inits()
Logs("Copy nedded files", Logger.Info)
Logs("Copy screenfetch-dev from Data/screenfetch-dev to " & User.Home &/ ".i-nex/screenfetch-dev", Logger.Info)
Copy "Data/screenfetch-dev" To User.Home &/ ".i-nex/screenfetch-dev"
Logs("Copy gputemp from Data/gputemp to " & User.Home &/ ".i-nex/gputemp", Logger.Info)
Copy "Data/gputemp" To User.Home &/ ".i-nex/gputemp"
Logs("Execute copied files", Logger.Info)
Logs("Execute screenfetch-dev", Logger.Info)
Exec ["/bin/bash", "" & User.Home & "/.i-nex/screenfetch-dev"] Wait To Do_not_print
Expand Down
38 changes: 38 additions & 0 deletions src/i-nex/Data/gputemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################

TEMP="0"

if lspci -n | grep 0300 | grep -q 10de; then
[ -f /usr/bin/nvidia-smi ] && TEMP=`/usr/bin/nvidia-smi -q -x | grep 'gpu_temp' | awk '{ print $1 }' | sed 's,<gpu_temp>,,g'`
fi

if lspci -n | grep 0300 | grep -q 1002; then
if [ -f /storage/.config/xorg.conf ]; then
XORG="/storage/.config/xorg.conf"
else
XORG="/etc/X11/xorg-fglrx.conf"
fi
[ -f /usr/bin/aticonfig ] && TEMP=`/usr/bin/aticonfig -i $XORG --od-gettemperature | grep Temperature | cut -f 2 -d "-" | cut -f 1 -d "." | sed -e "s, ,,"`
fi

echo "${TEMP} C"

0 comments on commit 7cddd90

Please sign in to comment.