(trunk-1587) * Adjust the config section name to InactivityWatch for InactivityWatch class

* Add a new setting for ActivityWatch to set the time between activty notifications
This commit is contained in:
Stephen Boddy 2015-08-03 20:36:14 +02:00
parent 73d29ef997
commit c83e627a69
1 changed files with 5 additions and 3 deletions

View File

@ -23,10 +23,12 @@ except ImportError:
err(_('ActivityWatch plugin unavailable: please install python-notify'))
config = Config()
inactive_period = float(config.plugin_get('ActivityWatch', 'inactive_period',
inactive_period = float(config.plugin_get('InactivityWatch', 'inactive_period',
10.0))
watch_interval = int(config.plugin_get('ActivityWatch', 'watch_interval',
watch_interval = int(config.plugin_get('InactivityWatch', 'watch_interval',
5000))
hush_period = float(config.plugin_get('ActivityWatch', 'hush_period',
10.0))
class ActivityWatch(plugin.MenuItem):
"""Add custom commands to the terminal menu"""
@ -85,7 +87,7 @@ class ActivityWatch(plugin.MenuItem):
show_notify = True
else:
last_time = self.last_notifies[terminal]
if this_time - last_time > 10:
if this_time - last_time > hush_period:
show_notify = True
if show_notify == True: