From 9978f6dcee6f8844367efe3189fa62f2a6e0cc0e Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 13 Mar 2018 22:45:52 +0100 Subject: [PATCH] add ignoreFile for screens --- config/settings/espeak.settings.conf | 1 + config/settings/settings.conf | 1 + config/settings/settings.conf.example | 1 + config/settings/settings.conf.storm | 1 + config/settings/speech-dispatcher.settings.conf | 1 + src/fenrir/core/screenManager.py | 10 +++++++++- src/fenrir/core/settingsData.py | 1 + 7 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf index 98cb1e6c..e94a9d8b 100644 --- a/config/settings/espeak.settings.conf +++ b/config/settings/espeak.settings.conf @@ -122,6 +122,7 @@ driver=vcsaDriver encoding=auto screenUpdateDelay=0.05 suspendingScreen= +suspendingScreenFile=/tmp/fenrirSuspend autodetectSuspendingScreen=True [keyboard] diff --git a/config/settings/settings.conf b/config/settings/settings.conf index b535c58b..1e4d5a0d 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -124,6 +124,7 @@ driver=vcsaDriver encoding=auto screenUpdateDelay=0.05 suspendingScreen= +suspendingScreenFile=/tmp/fenrirSuspend autodetectSuspendingScreen=True [keyboard] diff --git a/config/settings/settings.conf.example b/config/settings/settings.conf.example index 01fb662c..1e4dd243 100644 --- a/config/settings/settings.conf.example +++ b/config/settings/settings.conf.example @@ -125,6 +125,7 @@ driver=vcsaDriver encoding=auto screenUpdateDelay=0.05 suspendingScreen= +suspendingScreenFile=/tmp/fenrirSuspend autodetectSuspendingScreen=True [keyboard] diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 04a9a3a0..ea2d68af 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -79,6 +79,7 @@ driver=vcsaDriver encoding=auto screenUpdateDelay=0.05 suspendingScreen= +suspendingScreenFile=/tmp/fenrirSuspend autodetectSuspendingScreen=True [keyboard] diff --git a/config/settings/speech-dispatcher.settings.conf b/config/settings/speech-dispatcher.settings.conf index 6fa5b96b..a6ead851 100644 --- a/config/settings/speech-dispatcher.settings.conf +++ b/config/settings/speech-dispatcher.settings.conf @@ -124,6 +124,7 @@ driver=vcsaDriver encoding=auto screenUpdateDelay=0.05 suspendingScreen= +suspendingScreenFile=/tmp/fenrirSuspend autodetectSuspendingScreen=True [keyboard] diff --git a/src/fenrir/core/screenManager.py b/src/fenrir/core/screenManager.py index e337d039..a7fbc7d1 100644 --- a/src/fenrir/core/screenManager.py +++ b/src/fenrir/core/screenManager.py @@ -5,7 +5,7 @@ # By Chrys, Storm Dragon, and contributers. from core import debug -import time +import time, os class screenManager(): def __init__(self): @@ -60,6 +60,14 @@ class screenManager(): if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'): ignoreScreens.extend(self.env['screen']['autoIgnoreScreens']) self.env['runtime']['debug'].writeDebugOut('screenManager:isSuspendingScreen ' + str(ignoreScreens) + ' '+ str(self.env['screen']['newTTY']),debug.debugLevel.INFO) + try: + ignoreFileName = self.env['runtime']['settingsManager'].getSetting('screen', 'suspendingScreenFile') + if ignoreFileName != '': + if os.access(ignoreFileName, os.R_OK): + with open(ignoreFileName) as fp: + ignoreScreens.extend(fp.read().replace('\n','').split(',')) + except: + pass return (screen in ignoreScreens) def isScreenChange(self): diff --git a/src/fenrir/core/settingsData.py b/src/fenrir/core/settingsData.py index 1bc23b40..cb99ac10 100644 --- a/src/fenrir/core/settingsData.py +++ b/src/fenrir/core/settingsData.py @@ -51,6 +51,7 @@ settingsData = { 'encoding': 'auto', 'screenUpdateDelay': 0.1, 'suspendingScreen': '', + 'suspendingScreenFile': '/tmp/fenrirSuspend', 'autodetectSuspendingScreen': False, }, 'general':{