Install the
xsel application (
xclip will work too), to allow you scripting access the visual selection. Then just set up a hotkey (using the binding feature your desktop offers, or
xbindkeys) to run a simple script like this:
Code:
#!/bin/bash
echo >> "$1"
xsel >> "$1"
exit 0
The first and only argument for the script will be the name of the file you want to use, so the command for your hotkey will be:
Code:
/path/to/scriptname /path/to/filename