check_delay and after_exec_delay in config
This commit is contained in:
parent
d5fe060b92
commit
33483bfe5b
|
@ -18,7 +18,7 @@ def do():
|
|||
def task_exec():
|
||||
msg = type_exec(action)
|
||||
notify(msg)
|
||||
sleep(1)
|
||||
sleep(config['after_exec_delay'])
|
||||
|
||||
position = get_cursor_position()
|
||||
for action in config['actions']:
|
||||
|
@ -40,7 +40,7 @@ def do():
|
|||
elif action['corner'] == 'left' or action['corner'] == 'right':
|
||||
if position['x'] == corners[ action['corner'] ] and position['y'] > config['corners']['middle_y_start'] and position['y'] < config['corners']['middle_y_end']:
|
||||
task_exec()
|
||||
sleep(0.3)
|
||||
sleep(config['check_delay'])
|
||||
|
||||
|
||||
# Detect type and execute
|
||||
|
|
|
@ -37,6 +37,12 @@ def load():
|
|||
config = ast.literal_eval(config)
|
||||
config['corners'] = get_middle_areas()
|
||||
|
||||
if not 'check_delay' in config.keys():
|
||||
config['check_delay'] = 0.3
|
||||
|
||||
if not 'after_exec_delay' in config.keys():
|
||||
config['after_exec_delay'] = 1
|
||||
|
||||
return config
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ By default it's stored in ~/.config/azot/config.json
|
|||
* command: command to execute
|
||||
* corner: Screen corner 'left', 'right', 'top', 'bottom'
|
||||
* position: 'left', 'right', 'middle'
|
||||
* check_delay and after_exec_delay are set in seconds
|
||||
|
||||
### Depends
|
||||
|
||||
|
|
|
@ -18,5 +18,7 @@
|
|||
'type': 'exec',
|
||||
'command': 'scrot'
|
||||
}
|
||||
]
|
||||
],
|
||||
'check_delay': 0.3,
|
||||
'after_exec_delay': 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user