diff options
author | Melik Manukyan <melik@remus.gateway.2wire.net> | 2009-12-13 20:56:33 -0800 |
---|---|---|
committer | Melik Manukyan <melik@remus.gateway.2wire.net> | 2009-12-13 20:56:33 -0800 |
commit | 6516828325af9dfdea772c6b32e91a9565ca3d34 (patch) | |
tree | d5a2c28644f87e860dd696465eb988fcd8cf4d3b | |
parent | 0116ce8f191a26bec77a1dd39d9b4af130d76a21 (diff) |
added hostname function
-rw-r--r-- | archey | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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]) |