Skip to content

Conversation

@jordansissel
Copy link
Owner

Window references will be replaced on the command-line in the same position that they occurred. In case of %@ (all windows), multiple arguments are inserted.

For example, if the window list is two entries: 123, 456

exec echo Hello %2 will run the command exactly as this list
[echo, "Hello", "456"]

exec echo World %@ will run the command exactly as this list
[echo, "World", "123", "456"]
with each window id being a separate argument.

For #431

@jordansissel
Copy link
Owner Author

There's some possible area for conflict like if someone has an old command that does 'xdotool ... exec some command %1' and the user expected a literal "%1" to get passed as it has previously... but now xdotool will replace the %1 with a window id (or an error message).

Other things needing improvement before merging:

  • Things like xdotool exec echo %1 should return an error code because there were no windows on the stack. At present, it only prints a message about this and still exits zero(success).
  • Any documentation changes

@jordansissel jordansissel changed the title Add support for window stack references (%1, %@, etc) to the exec command exec command: Add support for window stack references (%1, %@, etc) Jul 1, 2023
command

Window references will be replaced on the command-line in the same
position that they occurred. In case of %@ (all windows), multiple
arguments are inserted.

For example, if the window list is two entries: 123, 456

`exec echo Hello %2` will run the command exactly as this list
  [echo, "Hello", "456"]

`exec echo World %@` will run the command exactly as this list
  [echo, "World", "123", "456"]
with each window id being a separate argument.

For #431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants