-
Notifications
You must be signed in to change notification settings - Fork 71
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
Added --run-command option, obsoletes --wrapper #104
base: develop
Are you sure you want to change the base?
Conversation
Update [see parent]
Wrapper was an idea exclusively useful for running the binary via i3-exec. While that is of utmost importance, the current --run-command feature subsets wrapper and a *lot more*. The current syntax is ``` --run-command "/usr/bin/anybinary {}" ``` The --wrapper *could* be replaced with a similar structure ``` --run-command "wrapper_binary '{}'" ``` I strongly advocate for `--run-command` and obsolete `--wrapper` as it is way more awesome. The idea was directly inspired by rofi's -run-command
|
// --run-command switch | ||
if (this->run_command.length()){ | ||
command = replace(this->run_command, this->run_command_token, command); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think command should be shell-quoted here, so that the command always gets the command line as a single argument? Not sure, really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say that totally depends on the end user. They can perfectly choose to shell quote the {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One the other hand, if we do shell-quote by default and the user then - by standard practice - quotes again, it would be something like "{}"
-> ""cmd""
which would completely defy the quotes. I guess the current approach should suffice. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only familiar with the {} syntax from find(1)
- there are likely others, which probably behave differently - which escapes the file name (e.g .find -exec strace -e execve echo {} \;
with some files with spaces in their names will look like this: execve("/usr/bin/echo", ["echo", "./foo bar baz"], ...
, so the {} becomes a single argument).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new commit to resolve this issue. This is as far I could think which would maintain $SHELL
usage and won't break with weird filenames (ones with quotes in them)
Similar to the `{}` syntax from `find(1)` which escapes the file name, -run-command now escapes the input `command`. The escaping is POSIX compliant, there may be issues if some weird shell is used.
Hi @enkore, is there any update on the PR ? |
Hey @Hritik14, are you still interested in adding this functionality to j4-dmenu-desktop? A lot has changed (partly thanks to me) since this pull request was made. I have added support for i3 IPC, which should replace the main usecase for This change makes While we're talking about usecases: do you have any specific usecase for |
Hey @meator, it's been a while and I've moved to dwm since. As far as I can recall, the usage was inspired from https://github.com/davatorium/rofi/blob/next/doc/rofi.1.markdown#run-settings I cannot foresee working on i3 for a considerable amount of time right now (due to my day job). |
I3 support is fully implemented. It is optional. It can be turned on with the Neither |
Wrapper was an idea exclusively useful for running the binary via
i3-exec
.While that is of utmost importance, the current --run-command feature subsets wrapper and a lot more.
The current syntax is
The --wrapper could be replaced with a similar structure
I strongly advocate for
--run-command
and obsolete--wrapper
as it is way more awesome and flexible. The idea was directly inspired by rofi's-run-command