firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
214 stars 38 forks source link

Executing more complex commands #51

Closed basxto closed 6 years ago

basxto commented 6 years ago

I tried to give the URLs to more complex commands, which failed.

man awesome | BROWSER="tmux save-buffer " urlscan -d
man awesome | BROWSER="notify-send -u critical " urlscan -d

Maybe something like --command -c would be better for that. I think, this would make it neccessary to invoke a shell.

man awesome | urlscan -c "tmux save-buffer %s" -d
man awesome | urlscan -c "echo %s | xclip -i -sel clipboard" -d
firecat53 commented 6 years ago

Yeah, I definitely want to keep the BROWSER functionality intact because it's an expected interface. I use the webbrowser module to open URLs, which is why the complex commands fail.

firecat53 commented 6 years ago

Ok, give that a try. The flag is -r or --run, and use {} to substitute in the URL value.

firecat53 commented 6 years ago

Works here, so it's merged. You can reopen if it doesn't work like you expect.