Merge pull request #1366 from pypeclub/feature/idle_manager_on_mac

Temporary fix of Idle manager on MacOs
This commit is contained in:
Milan Kolar 2021-04-20 09:39:26 +02:00 committed by GitHub
commit 646d839fc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,4 @@
import platform
import collections
from abc import ABCMeta, abstractmethod
@ -40,7 +41,12 @@ class IdleManager(PypeModule, ITrayService):
name = "idle_manager"
def initialize(self, module_settings):
self.enabled = True
enabled = True
# Ignore on MacOs
# - pynput need root permissions and enabled access for application
if platform.system().lower() == "darwin":
enabled = False
self.enabled = enabled
self.time_callbacks = collections.defaultdict(list)
self.idle_thread = None