summaryrefslogtreecommitdiff
path: root/archey
diff options
context:
space:
mode:
authorLaurie <bluepeppers@archlinux.us>2010-01-20 16:49:20 +0000
committerLaurie <bluepeppers@archlinux.us>2010-01-20 16:49:20 +0000
commit6588f23c1064d58ad8699e0fb821614c7ed73586 (patch)
treea670385542588c9d787c130bae16645109502c09 /archey
parent9f233527a88e3a8e00d033b42f07f80e6fe6e72f (diff)
Temp output changes color with different tempratures. Also changed os detect support to use lsb method, unless specific function found
Diffstat (limited to 'archey')
-rw-r--r--archey26
1 files changed, 20 insertions, 6 deletions
diff --git a/archey b/archey
index ace4e4d..85a1c52 100644
--- a/archey
+++ b/archey
@@ -93,7 +93,8 @@ sh_dict = {'zsh': 'Z-Shell',
'tcsh': 'The C Shell'}
os_dict = {'arch': 'Arch Linux',
- 'ubuntu': 'Ubuntu'}
+ 'ubuntu': 'Ubuntu',
+ 'debian': 'Debian'}
# Find running processes.
def xmonadfix(str):
@@ -136,8 +137,17 @@ def screenshot():
def coretemp_display():
tempinfo = Popen(['sensors', 'coretemp-*'], stdout=PIPE).communicate()[0].split('\n')[2::4]
temps = ''
+ orange = '\x1b[1;31m'
+ red = '\x1b[1;33m'
+ blue = '\x1b[1;34m'
for line in tempinfo:
- temps = temps + line.split(':')[1].replace(' ','').split('(')[0]+ ','
+ value = line.split(':')[1].replace(' ','').split('(')[0]
+ if int(value[1:3]) > 40:
+ temps = temps + red + line.split(':')[1].replace(' ','').split('(')[0] + clear + ','
+ elif int(value[1:3]) in range(31,41):
+ temps = temps + orange + line.split(':')[1].replace(' ','').split('(')[0] + clear + ','
+ elif int(value[1:3]) < 30:
+ temps = temps + blue + line.split(':')[1].replace(' ','').split('(')[0] + clear + ','
temps = temps[:-1]
output ('Core Temp', temps)
@@ -145,7 +155,10 @@ def coretemp_display():
def os_display():
global os
for key in os_dict:
- if eval('os_' + key)() == True: os = os_dict[key]
+ try:
+ if eval('os_' + key)(): os = os_dict[key]
+ except NameError:
+ if os_lsb(key): os = os_dict[key]
output('OS', os + ' ' + arch)
# Arch finding function
@@ -158,10 +171,11 @@ def os_arch():
file.close()
return True
-# Ubuntu finding function
-def os_ubuntu():
+# OS finding using lsb
+def os_lsb(key):
try:
- file = open('/etc/issue.conf')
+ file = open('/etc/lsb-release')
+ if not os[key] in file.readlines()[0]: raise IOError
except IOError:
return False
else: