Handle initial parentheses, allow multiple arguments for program.
This commit is contained in:
parent
75087e5fdb
commit
2377c2eb4c
1 changed files with 3 additions and 0 deletions
|
@ -167,6 +167,8 @@ def group_tokens(tokens: list[str]):
|
|||
return groups
|
||||
|
||||
def build_expression(tokens: list[str]) -> Expression:
|
||||
if tokens[0] == '(' and tokens[-1] == ')':
|
||||
tokens = tokens[1:-1]
|
||||
token_groups = group_tokens(tokens)
|
||||
|
||||
expressions = [build_expression(ts) for ts in token_groups[1:]] if len(token_groups) > 1 else []
|
||||
|
@ -283,6 +285,7 @@ def main(filter, debug, workspace, program):
|
|||
|
||||
"""
|
||||
filter = parse(filter)
|
||||
program = ' '.join(program)
|
||||
ipc = i3ipc.Connection()
|
||||
ipc.on('window::new', window_new(filter, workspace=workspace, debug=debug))
|
||||
ipc.command(f'exec {program}')
|
||||
|
|
Loading…
Reference in a new issue