summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD20
-rw-r--r--README.md4
-rwxr-xr-xparaboley (renamed from archey3)45
-rwxr-xr-xparaboley.new261
-rw-r--r--setup.py14
5 files changed, 303 insertions, 41 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2ac5d14..0767b86 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,12 +1,11 @@
-# Maintainer: Laurie Clark-Michalek <bluepeppers@archlinux.us>
-# Contributer: graysky <graysky AT archlinux DOR us>
+# Maintainer (Parabola) : Aurélien DESBRIÈRES <aurelien@hackers.camp>
-pkgname=archey3
-pkgver=0.5
+pkgname=paraboley
+pkgver=0.1
pkgrel=1
-pkgdesc="Python script to display system infomation alongside the Arch Linux logo."
+pkgdesc="Python script to display system infomation alongside the Parabola GNU / Linux-libre logo."
arch=('any')
-url="http://bluepeppers.github.com/archey3"
+url="http://XL04D.github.com/paraboley"
license=('GPL')
depends=('python')
makedepends=('git' 'python-distribute')
@@ -15,10 +14,9 @@ optdepends=(
'python-logbook-git: for logging'
'imagemagick: for default screenshot command'
)
-conflicts=('archey')
-provides=('archey')
-source="git://github.com/bluepeppers/archey3.git"
-md5sums=('SKIP')
+conflicts=()
+provides=('paraboley')
+source="git://github.com/XL04D/paraboley.git"
pkgver() {
cd ${pkgname}
@@ -28,5 +26,5 @@ pkgver() {
package() {
cd "$srcdir/$pkgname"
python setup.py install --root=${pkgdir}
- install -D -m644 COPYING ${pkgdir}/usr/share/licenses/archey/COPYING
+ install -D -m644 COPYING ${pkgdir}/usr/share/licenses/paraboley/COPYING
}
diff --git a/README.md b/README.md
index 24fe97a..e24e8fe 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-Archey 3
+Paraboley
========
-Archey 3 is a system infomation printer, designed to be used when taking screenshots of computer desktops to provide additional infomation about the operating system setup. Archey is designed to be used for Arch linux, and it acordingly prints out the Arch linux logo along side the system infomation. \ No newline at end of file
+Paraboley is a system infomation printer, designed to be used when taking screenshots of computer desktops to provide additional infomation about the operating system setup. Paraboley is designed to be used for Parabola GNU / Linux-libre, and it acordingly prints out the Parabola GNU / Linux-libre logo along side the system infomation. \ No newline at end of file
diff --git a/archey3 b/paraboley
index 773c523..122b3cb 100755
--- a/archey3
+++ b/paraboley
@@ -1,5 +1,8 @@
#!/usr/bin/env python
#
+# Paraboley is a forked made by Aurélien DESBIRÈRES <aurelien@hackers.camp>
+# of archey3 to present the Parabola GNU / Linux-libre logo and informations
+#
# archey3 [version 0.5]
#
# Copyright 2010 Melik Manukyan <melik@archlinux.us>
@@ -11,6 +14,7 @@
# Along with basic system information.
# Import libraries
+
import collections
import subprocess, optparse, re, sys, configparser
from subprocess import Popen, PIPE
@@ -47,25 +51,25 @@ UNAME_FLAG_MEANINGS = {
'i': 'Hardware Platform',
}
-LOGOS = {'Arch Linux': '''{c1}
-{c1} + {results[0]}
-{c1} # {results[1]}
-{c1} ### {results[2]}
-{c1} ##### {results[3]}
-{c1} ###### {results[4]}
-{c1} ; #####; {results[5]}
-{c1} +##.##### {results[6]}
-{c1} +########## {results[7]}
-{c1} ######{c2}#####{c1}##; {results[8]}
-{c1} ###{c2}############{c1}+ {results[9]}
-{c1} #{c2}###### ####### {results[10]}
-{c2} .######; ;###;`\". {results[11]}
-{c2} .#######; ;#####. {results[12]}
-{c2} #########. .########` {results[13]}
-{c2} ######' '###### {results[14]}
-{c2} ;#### ####; {results[15]}
-{c2} ##' '## {results[16]}
-{c2} #' `# {results[17]}
+LOGOS = {'Parabola': '''{c1}
+{c1} ## ### {results[0]}
+{c1} ## ## ##### {results[1]}
+{c1} ## ## ## ####### {results[2]}
+{c1} # ## ## ## ######## {results[3]}
+{c1} ### # ######### {results[4]}
+{c1} ### ######### {results[5]}
+{c1} ## ######## {results[6]}
+{c1} ####### {results[7]}
+{c1} ###### {results[8]}
+{c1} ###### {results[9]}
+{c1} ##### {results[10]}
+{c1} ##### {results[11]}
+{c1} #### {results[12]}
+{c1} #### {results[13]}
+{c1} ### {results[14]}
+{c1} ### {results[15]}
+{c1} ## {results[16]}
+{c1} # {results[17]}
\x1b[0m'''
}
@@ -425,7 +429,7 @@ class distroCheck(display):
except IOError:
distro = self.call_command("uname -o")
else:
- distro = "Arch Linux"
+ distro = "Parabola"
distro = '{0} {1}'.format(distro, self.call_command("uname -m"))
return "OS", distro
@@ -728,7 +732,6 @@ class Archey(object):
results = self.arrange_results(results)
return LOGOS[self.distro_name].format(c1=color(self.state, 1),
- c2=color(self.state, 2),
results = results
)
diff --git a/paraboley.new b/paraboley.new
new file mode 100755
index 0000000..30dc17c
--- /dev/null
+++ b/paraboley.new
@@ -0,0 +1,261 @@
+#!/usr/bin/env python3
+#
+# Parabola-eye is maintain by Aurélien DESBRIÈRES <aurelien@hackers.camp>
+# it is a fork inspired from:
+#
+# Archey [version 0.3.0]
+#
+# Archey is a simple system information tool written in Python.
+#
+# Copyright 2010 Melik Manukyan <melik@archlinux.us>
+#
+# ASCII art by Brett Bohnenkamper <kittykatt@silverirc.com>
+# Changes Jerome Launay <jerome@projet-libre.org>
+# Fedora support by YeOK <yeok@henpen.org>
+#
+# Distributed under the terms of the GNU General Public License v3.
+# See http://www.gnu.org/licenses/gpl.txt for the full license text.
+
+# Import libraries
+import os, sys, subprocess, optparse, re, linecache
+from subprocess import Popen, PIPE
+from optparse import OptionParser
+from getpass import getuser
+from time import ctime, sleep
+
+#---------------Output---------------#
+
+output = [
+ 'User',
+ 'Hostname',
+ 'Distro',
+ 'Kernel',
+ 'Uptime',
+ 'WindowManager',
+ 'DesktopEnvironment',
+ 'Shell',
+ 'Terminal',
+ 'Packages',
+ 'CPU',
+ 'RAM',
+ 'Disk'
+ ]
+
+#---------------Dictionaries---------------#
+
+colorDict = {
+ 'Parabola GNU / Linux-libre': ['\x1b[0;34m', '\x1b[1;34m'],
+ 'Ubuntu': ['\x1b[0;31m', '\x1b[1;31m', '\x1b[0;33m'],
+ 'Debian': ['\x1b[0;31m', '\x1b[1;31m'],
+ 'Mint': ['\x1b[0;32m', '\x1b[1;37m'],
+ 'Crunchbang': ['\x1b[1;37m'],
+ 'Fedora': ['\x1b[0;34m', '\x1b[1;37m'],
+ 'Sensors': ['\x1b[0;31m', '\x1b[0;32m', '\x1b[0;33m'],
+ 'Clear': ['\x1b[0m']
+ }
+
+deDict = {
+ 'gnome-session': 'GNOME',
+ 'ksmserver': 'KDE',
+ 'xfce4-session': 'Xfce',
+ 'lxsession': 'LXDE'
+ }
+
+wmDict = {
+ 'awesome': 'Awesome',
+ 'beryl': 'Beryl',
+ 'blackbox': 'Blackbox',
+ 'compiz': 'Compiz',
+ 'dwm': 'DWM',
+ 'enlightenment': 'Enlightenment',
+ 'fluxbox': 'Fluxbox',
+ 'fvwm': 'FVWM',
+ 'i3': 'i3',
+ 'icewm': 'IceWM',
+ 'kwin': 'KWin',
+ 'metacity': 'Metacity',
+ 'musca': 'Musca',
+ 'openbox': 'Openbox',
+ 'pekwm': 'PekWM',
+ 'ratpoison': 'ratpoison',
+ 'scrotwm': 'ScrotWM',
+ 'wmaker': 'Window Maker',
+ 'wmfs': 'Wmfs',
+ 'wmii': 'wmii',
+ 'xfwm4': 'Xfwm',
+ 'xmonad': 'xmonad'
+ }
+
+logosDict = {'Parabola GNU / Linux-libre': '''{color[1]}
+{color[1]} ## ### {results[1]}
+{color[1]} ## ## ##### {results[2]}
+{color[1]} ## ## ## ####### {results[3]}
+{color[1]} # ## ## ## ######## {results[4]}
+{color[1]} ### ## ## ## ####### {results[5]}
+{color[1]} ##### ## ## ## ####### {results[6]}
+{color[1]} ## ## ## ####### {results[7]}
+{color[1]} ## ####### {results[8]}
+{color[1]} ###### {results[9]}
+{color[0]} ###### {results[10]}
+{color[0]} ##### {results[11]}
+{color[0]} ##### {results[12]}
+{color[0]} #### {results[13]}
+{color[0]} ### {results[14]}
+{color[0]} ### {results[15]}
+{color[0]} ## {results[16]}
+{color[0]} # {reuslts[17]}
+\x1b[0m'''
+}
+
+processes = str(subprocess.check_output(('ps', '-u', getuser(), '-o', 'comm',
+ '--no-headers')), encoding='utf8').rstrip('\n').split('\n')
+
+#---------------Classes---------------#
+
+class Output:
+ results = []
+ results.extend(['']*(13))
+
+ def __init__(self):
+ self.distro = self.__detectDistro()
+
+ def __detectDistro(self):
+ if os.path.exists('/etc/pacman.conf'):
+ return 'Parabola GNU / Linux-libre'
+ else:
+ sys.exit(1)
+
+ def append(self, display):
+ self.results.append('%s%s: %s%s' % (colorDict[self.distro][1], display.key, colorDict['Clear'][0], display.value))
+
+ def output(self):
+ print(logosDict[self.distro].format(color = colorDict[self.distro], results = self.results))
+
+class User:
+ def __init__(self):
+ self.key = 'User'
+ self.value = os.getenv('USER')
+
+class Hostname:
+ def __init__(self):
+ hostname = Popen(['uname', '-n'], stdout=PIPE).communicate()[0].decode('Utf-8').rstrip('\n')
+ self.key = 'Hostname'
+ self.value = hostname
+
+class Distro:
+ def __init__(self):
+ if os.path.exists('/etc/pacman.conf'):
+ distro = 'Parabola GNU / Linux-libre'
+ self.key = 'Distro'
+ self.value = distro
+
+class Kernel:
+ def __init__(self):
+ kernel = Popen(['uname', '-r'], stdout=PIPE).communicate()[0].decode('Utf-8').rstrip('\n')
+ self.key = 'Kernel'
+ self.value = kernel
+
+class Uptime:
+ def __init__(self):
+ fuptime = int(open('/proc/uptime').read().split('.')[0])
+ day = int(fuptime / 86400)
+ fuptime = fuptime % 86400
+ hour = int(fuptime / 3600)
+ fuptime = fuptime % 3600
+ minute = int(fuptime / 60)
+ uptime = ''
+ if day == 1:
+ uptime += '%d day, ' % day
+ if day > 1:
+ uptime += '%d days, ' % day
+ uptime += '%d:%02d' % (hour, minute)
+ self.key = 'Uptime'
+ self.value = uptime
+
+class WindowManager:
+ def __init__(self):
+ wm = ''
+ for key in wmDict.keys():
+ if key in processes:
+ wm = wmDict[key]
+ break
+
+ self.key = 'Window Manager'
+ self.value = wm
+
+class DesktopEnvironment:
+ def __init__(self):
+ de = ''
+ for key in deDict.keys():
+ if key in processes:
+ wm = wmDict[key]
+ break
+
+ self.key = 'Desktop Environment'
+ self.value = de
+
+class Shell:
+ def __init__(self):
+ self.key = 'Shell'
+ self.value = os.getenv('SHELL')
+
+class Terminal:
+ def __init__(self):
+ self.key = 'Terminal'
+ self.value = os.getenv('TERM')
+
+class Packages:
+ def __init__(self):
+ p1 = Popen(['pacman', '-Q'], stdout=PIPE).communicate()[0].decode("Utf-8")
+ packages = len(p1.rstrip('\n').split('\n'))
+ self.key = 'Packages'
+ self.value = packages
+
+class CPU:
+ def __init__(self):
+ file = open('/proc/cpuinfo').readlines()
+ cpuinfo = re.sub(' +', ' ', file[4].replace('model name\t: ', '').rstrip('\n'))
+ output ('CPU', cpuinfo)
+
+class RAM:
+ def __init__(self):
+ raminfo = Popen(['free', '-m'], stdout=PIPE).communicate()[0].decode('Utf-8').split('\n')
+ ram = ''.join(filter(re.compile('M').search, raminfo)).split()
+ used = int(ram[2]) - int(ram[5]) - int(ram[6])
+ usedpercent = ((float(used) / float(ram[1])) * 100)
+ if usedpercent <= 33:
+ ramdisplay = '%s%s MB %s/ %s MB' % (colorDict['Sensors'][2], used, colorDict['Clear'][0], ram[1])
+ if usedpercent > 33 and usedpercent < 67:
+ ramdisplay = '%s%s MB %s/ %s MB' % (colorDict['Sensors'][1], used, colorDict['Clear'][0], ram[1])
+ if usedpercent >= 67:
+ ramdisplay = '%s%s MB %s/ %s MB' % (colorDict['Sensors'][0], used, colorDict['Clear'][0], ram[1])
+ self.key = 'RAM'
+ self.value = ramdisplay
+
+class Disk:
+ def __init__(self):
+ p1 = Popen(['df', '-Tlh', '--total', '-t', 'ext4', '-t', 'ext3', '-t', 'ext2', '-t', 'reiserfs', '-t', 'jfs', '-t', 'ntfs', '-t', 'fat32', '-t', 'btrfs', '-t', 'fuseblk'], stdout=PIPE).communicate()[0].decode("Utf-8")
+ total = p1.splitlines()[-1]
+ used = total.split()[3]
+ size = total.split()[2]
+ usedpercent = float(total.split()[5][:-1])
+
+ if usedpercent <= 33:
+ disk = '%s%s %s/ %s' % (colorDict['Sensors'][2], used, colorDict['Clear'][0], size)
+ if usedpercent > 33 and usedpercent < 67:
+ disk = '%s%s %s/ %s' % (colorDict['Sensors'][1], used, colorDict['Clear'][0], size)
+ if usedpercent >= 67:
+ disk = '%s%s %s/ %s' % (colorDict['Sensors'][0], used, colorDict['Clear'][0], size)
+ self.key = 'Disk'
+ self.value = disk
+
+## TEST ## <<< TEMPORARY
+out = Output()
+out.append(Shell())
+out.append(Packages())
+out.append(Disk())
+out.append(RAM())
+out.append(Distro())
+out.append(WindowManager())
+#out.append(DesktopEnvirornment())
+out.output()
diff --git a/setup.py b/setup.py
index b1986b5..9844d10 100644
--- a/setup.py
+++ b/setup.py
@@ -5,13 +5,13 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
- name="Archey3",
- version="0.4",
- author="Laurie Clark-Michalek",
- author_email="bluepeppers@archlinux.us",
- description="A simple python scrip to display an Archlinux logo in ASCII art along with basic system information.",
+ name="Paraboley",
+ version="0.1",
+ author="Aurélien DESBRIÈRES",
+ author_email="aurelien@hackers.camp",
+ description="A simple python scrip to display an Parabola GNU / Linux-libre logo in ASCII art along with basic system information.",
license="GPL",
- url="http://bluepeppers.github.com/archey3",
+ url="http://XL04D.github.com/paraboley",
long_description=read("README.md"),
- scripts=["archey3"]
+ scripts=["paraboley"]
)