From 542ce26377db69ddfc0dd37066ef55e9bc6dd132 Mon Sep 17 00:00:00 2001 From: Ander <9and3r@gmail.com> Date: Sat, 28 Feb 2015 21:05:13 +0100 Subject: [PATCH] None option --- mopidy_touchscreen/touch_screen.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mopidy_touchscreen/touch_screen.py b/mopidy_touchscreen/touch_screen.py index 22a5632..d5c19b6 100644 --- a/mopidy_touchscreen/touch_screen.py +++ b/mopidy_touchscreen/touch_screen.py @@ -25,13 +25,19 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener): self.fullscreen = config['touchscreen']['fullscreen'] self.screen_size = (config['touchscreen']['screen_width'], config['touchscreen']['screen_height']) - os.environ["SDL_FBDEV"] = config['touchscreen']['sdl_fbdev'] - os.environ["SDL_MOUSEDRV"] = config['touchscreen'][ + + if config['touchscreen']['sdl_fbdev'].lower() != "none": + os.environ["SDL_FBDEV"] = config['touchscreen']['sdl_fbdev'] + if config['touchscreen']['sdl_mousdrv'].lower() != "none": + os.environ["SDL_MOUSEDRV"] = config['touchscreen'][ 'sdl_mousdrv'] - os.environ["SDL_MOUSEDEV"] = config['touchscreen'][ - 'sdl_mousedev'] - os.environ["SDL_AUDIODRIVER"] = \ - config['touchscreen']['sdl_audiodriver'] + + if config['touchscreen']['sdl_mousedev'].lower() != "none": + os.environ["SDL_MOUSEDEV"] = config['touchscreen']['sdl_mousedev'] + + if config['touchscreen']['sdl_audiodriver'].lower() != "none": + os.environ["SDL_AUDIODRIVER"] = config['touchscreen']['sdl_audiodriver'] + os.environ["SDL_PATH_DSP"] = config['touchscreen']['sdl_path_dsp'] pygame.init() pygame.display.set_caption("Mopidy-Touchscreen")