summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurie <bluepeppers@archlinux.us>2010-01-26 07:57:35 +0000
committerLaurie <bluepeppers@archlinux.us>2010-01-26 07:57:35 +0000
commita7f776d914e10282ef0bd5644bdb20bbc18a21a5 (patch)
treedfecdd427828f562991935783133400161c7a27b
parentc8a67159ca82d249934a5445adb47f864661fb3f (diff)
Using os.getenv for shell detection
-rwxr-xr-xarchey17
1 files changed, 4 insertions, 13 deletions
diff --git a/archey b/archey
index fbbfe71..2c6673a 100755
--- a/archey
+++ b/archey
@@ -15,6 +15,7 @@ from subprocess import Popen, PIPE
from optparse import OptionParser
from getpass import getuser
from time import ctime, sleep
+from os import getenv
if sys.version_info[1] < 6:
from future import with_statement
@@ -84,14 +85,6 @@ wm_dict = {'awesome': 'Awesome',
'xmonad': 'xmonad',
'scrotwm': 'ScrotWM'}
-sh_dict = {'zsh': 'Z-Shell',
- 'bash': 'Bash',
- 'dash': 'Dash',
- 'fish': 'Fish',
- 'ksh': 'Korn Shell',
- 'jsh': 'Job control shell',
- 'tcsh': 'The C Shell'}
-
os_dict = {'arch': 'Arch Linux',
'ubuntu': 'Ubuntu',
'debian': 'Debian'}
@@ -235,11 +228,9 @@ def wm_display():
output ('WM', wm)
# Shell Function
-def sh_display():
- sh = 'None found'
- for key in processes:
- if key in sh_dict.keys(): sh = sh_dict[key]
- output ('Shell', sh)
+def sh_display():
+ shell = os.getenv("SHELL")].split('/')[-1]
+ output ('Shell', shell)
# Packages Function
def packages_display():