0

For academic research I work with Firefox and many sites have the option to export entries as Bibtex files which opens a download dialog.

I'm looking for a way to directly copy those files to the clipboard to improve efficiency. The files contain just a couple of lines. My current workflow is to open them with GVim, then hit the keys for copying to clipboard. Then I can paste them wherever I need it.

It would be very nice to save a couple of keystrokes and just choose "Open with" -> copy to clipboard.

I know that it's possible to copy data to clipboards from command line using xclip.

I suppose the listed applications in the Firefox dialog have something to do with .desktop entries and xdg-open.

I just can't quite figure out how to put all of that together. Is it possible to write a small wrapper script, or create a .desktop file with xclip somehow?

0

Turned out to be simpler than expected, at least in Firefox 73 under Arch.

There's no possibility to add custom applications in the download dialog. However, it is possible in the settings, under Preferences - General - Applications.

For the desired content type (plain text in my case), click on the action, choose Use other... and select /usr/bin/xclip.

Now the option appears in the download dialog, and copying works just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.