qutebrowser-extensions icon indicating copy to clipboard operation
qutebrowser-extensions copied to clipboard

Yank decorator function

Open jgkamat opened this issue 6 years ago • 2 comments

It would be very nice to have an api to provide advice to various functions, for example, for yank.

Eg:

  • https://github.com/qutebrowser/qutebrowser -> [email protected]:qutebrowser/qutebrowser.git
  • https://github.com/qutebrowser/qutebrowser-extensions/issues/18 -> #18 (or qutebrowser/qutebrowser-extensions#18)
  • https://github.com/qutebrowser/qutebrowser -> github.com/qutebrowser/qutebrowser
  • http://no-www.org/ -> http://www.no-www.org/
  • https://badssl.com/ -> http://badssl.com/
  • https://github.com/qutebrowser/qutebrowser -> https://com.github/qutebrowser/qutebrowser

This would also be useful for paste and/or opened links:

  • https://www.reddit.com/ -> https://www.old.reddit.com/
  • https://www.facebook.com/ -> https://mbasic.facebook.com/
  • https://twitter.com/ -> https://mobile.twitter.com/
  • https://github.com/qutebrowser/qutebrowser -> https://gitlab.com/qutebrowser/qutebrowser

jgkamat avatar Jan 27 '19 05:01 jgkamat

A paste decorator is not needed, you can use the redirection api:

https://gitlab.com/jgkamat/dotfiles/blob/c84cdc1dd8c9dbf9670ee599686fe87ba881e7ec/qutebrowser/.config/qutebrowser/pyconfig/redirectors.py

jgkamat avatar Mar 23 '19 17:03 jgkamat

The yank function is pretty trivial, so I ended up just re-implementing it to get the functionality I wanted. I think that some sort of decorator api would still be pretty nice though.

http://gitlab.com/jgkamat/dotfiles/blob/531d216667d2195efa06fb4424b65eef73016202/qutebrowser/.config/qutebrowser/pyconfig/smartyank.py

jgkamat avatar Apr 13 '19 06:04 jgkamat