From 70fd0a13118f1c4096885ef531f809be83fa1b85 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Fri, 23 Sep 2016 11:25:19 +0200 Subject: [PATCH] Update linux.py --- src/fenrir-package/screenDriver/linux.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fenrir-package/screenDriver/linux.py b/src/fenrir-package/screenDriver/linux.py index 219c3bba..2d7514cf 100644 --- a/src/fenrir-package/screenDriver/linux.py +++ b/src/fenrir-package/screenDriver/linux.py @@ -31,11 +31,12 @@ class driver(): def getCurrApplication(self, screen): apps = [] 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: print(e) return '' - currScreen = str(screen) + try: for i in apps: i = i.upper()