Update linux.py

This commit is contained in:
chrys87 2016-09-20 10:32:32 +02:00 committed by GitHub
parent 4daa9b21e7
commit 3c9fff3968

View File

@ -34,13 +34,14 @@ class driver():
def getIgnoreScreens(self): def getIgnoreScreens(self):
xlist = [] xlist = []
try: try:
x = subprocess.Popen('ps a -o tty,comm | grep -e Xorg | grep -v "grep -e Xorg"', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n') x = subprocess.Popen('ps a -o tty,comm | grep Xorg', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
except Exception as e: except Exception as e:
print(e) print(e)
return xlist return xlist
for i in x: for i in x:
if i[:3].upper() == 'TTY': if not "grep" in i:
xlist.append(i[3]) if (i[:3].lower() == 'tty'):
xlist.append(i[3])
return xlist return xlist
def update(self, environment, trigger='updateScreen'): def update(self, environment, trigger='updateScreen'):