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