summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelik Manukyan <melik@remus.gateway.2wire.net>2009-12-13 20:56:33 -0800
committerMelik Manukyan <melik@remus.gateway.2wire.net>2009-12-13 20:56:33 -0800
commit6516828325af9dfdea772c6b32e91a9565ca3d34 (patch)
treed5a2c28644f87e860dd696465eb988fcd8cf4d3b
parent0116ce8f191a26bec77a1dd39d9b4af130d76a21 (diff)
added hostname function
-rw-r--r--archey8
1 files changed, 7 insertions, 1 deletions
diff --git a/archey b/archey
index d411ce0..b5f8f6c 100644
--- a/archey
+++ b/archey
@@ -8,6 +8,7 @@ from optparse import OptionParser
# Display
display = [
'os',
+ 'hostname',
'kernel',
# 'battery',
'uptime',
@@ -24,7 +25,7 @@ list = []
# Options
if __name__=='__main__':
- parser = OptionParser('usage: %prog [-c COLOR]')
+ parser = OptionParser(usage='%prog [-c COLOR] [-s, --screenshot]', description='To customize the data displayed on archey, edit "/usr/bin/archey" directly and look for the display array. Note: Archey can only allow up to 13 fields.')
parser.add_option('-c',
action='store', default='blue', type='choice', dest='color', choices=('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'), help='choose a color: black, red, green, yellow, blue, magenta, cyan, white [Default: blue]')
parser.add_option('-s', '--screenshot',
@@ -67,6 +68,11 @@ def kernel_display():
kernel = Popen(['uname', '-r'], stdout=PIPE).communicate()[0].rstrip('\n')
output ('Kernel', kernel)
+# Kernel Function
+def hostname_display():
+ hostname = Popen(['uname', '-n'], stdout=PIPE).communicate()[0].rstrip('\n')
+ output ('Hostname', hostname)
+
# Uptime Function
def uptime_display():
fuptime = int(open('/proc/uptime').read().split('.')[0])