From bd61e0a0c626e65adcc802031367e1f8dc20db08 Mon Sep 17 00:00:00 2001 From: Brikwerk Date: Tue, 15 Sep 2020 15:22:36 -0700 Subject: [PATCH] Fixed PermissionError while running as non-root --- nxbt/nxbt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nxbt/nxbt.py b/nxbt/nxbt.py index 3c9f1da..bf1e72b 100644 --- a/nxbt/nxbt.py +++ b/nxbt/nxbt.py @@ -209,8 +209,11 @@ class Nxbt(): self.resource_manager.shutdown() - # Re-enable the BlueZ input plugin - toggle_input_plugin(True) + # Re-enable the BlueZ input plugin, if we have permission + try: + toggle_input_plugin(True) + except PermissionError: + pass def _command_manager(self, task_queue, state): """Used as the main multiprocessing Process that is launched