Start idle time monitor only if xprintidle is available
This commit is contained in:
parent
1286389658
commit
1298d69838
|
@ -67,6 +67,8 @@ class SafeEyesCore:
|
||||||
self.skip_break_window_classes = [x.lower() for x in config['active_window_class']['skip_break']]
|
self.skip_break_window_classes = [x.lower() for x in config['active_window_class']['skip_break']]
|
||||||
self.take_break_window_classes = [x.lower() for x in config['active_window_class']['take_break']]
|
self.take_break_window_classes = [x.lower() for x in config['active_window_class']['take_break']]
|
||||||
self.custom_exercises = config['custom_exercises']
|
self.custom_exercises = config['custom_exercises']
|
||||||
|
# Enable idle time pause only if xprintidle is available
|
||||||
|
self.context['idle_pause_enabled'] = Utility.command_exist('xprintidle')
|
||||||
|
|
||||||
exercises = language['exercises']
|
exercises = language['exercises']
|
||||||
for short_break_config in config['short_breaks']:
|
for short_break_config in config['short_breaks']:
|
||||||
|
@ -120,6 +122,7 @@ class SafeEyesCore:
|
||||||
self.active = True
|
self.active = True
|
||||||
self.running = True
|
self.running = True
|
||||||
Utility.start_thread(self.__scheduler_job)
|
Utility.start_thread(self.__scheduler_job)
|
||||||
|
if self.context['idle_pause_enabled']:
|
||||||
Utility.start_thread(self.__start_idle_monitor)
|
Utility.start_thread(self.__start_idle_monitor)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,9 @@ class SettingsDialog:
|
||||||
self.switch_audible_alert.set_active(config['audible_alert'])
|
self.switch_audible_alert.set_active(config['audible_alert'])
|
||||||
self.spin_time_to_screen_lock.set_value(config['time_to_screen_lock'])
|
self.spin_time_to_screen_lock.set_value(config['time_to_screen_lock'])
|
||||||
|
|
||||||
|
# Enable idle_time_to_pause only if xprintidle is available
|
||||||
|
self.spin_idle_time_to_pause.set_sensitive(Utility.command_exist('xprintidle'))
|
||||||
|
|
||||||
# Check lock screen command
|
# Check lock screen command
|
||||||
able_to_lock_screen = False
|
able_to_lock_screen = False
|
||||||
if config['lock_screen_command'] or Utility.lock_screen_command():
|
if config['lock_screen_command'] or Utility.lock_screen_command():
|
||||||
|
|
Loading…
Reference in New Issue