Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec command: Add support for window stack references (%1, %@, etc) #433

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

1 participant