Update linux.py

This commit is contained in:
chrys87 2016-09-23 11:25:19 +02:00 committed by GitHub
parent 45186d7e6d
commit 70fd0a1311

View File

@ -31,11 +31,12 @@ class driver():
def getCurrApplication(self, screen): def getCurrApplication(self, screen):
apps = [] apps = []
try: try:
apps = subprocess.Popen('ps a -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n') currScreen = str(screen)
apps = subprocess.Popen('ps -t tty' + currScreen + ' -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
except Exception as e: except Exception as e:
print(e) print(e)
return '' return ''
currScreen = str(screen)
try: try:
for i in apps: for i in apps:
i = i.upper() i = i.upper()