Solved (almost). I'm keeping this question unanswered and will give to whoever completes the remaining ~5%. Steps to get the 95% solution with xfce4-terminal
version 0.8.3-1
:
Install launchy
and launchy-plugins
(both are version 2.5-4 for me):
apt-get install launchy
apt-get install launchy-plugins
Open terminal to default location of ~/
and create collectednotes.md
:
echo "# Launchy Notes Collected Here" > collectednotes.md
Create note.sh
shell script:
echo '#!/bin/sh' > note.sh
Create shell script line 2:
echo ALL_ARGUMENTS='"$@"' >> note.sh
Create shell script line 3:
echo 'echo "$ALL_ARGUMENTS" >> ~/collectednotes.md' >> note.sh
If you open note.sh
, it will look like:
#!/bin/sh
ALL_ARGUMENTS="$@"
echo "$ALL_ARGUMENTS" >> ~/collectednotes.md
Make note.sh
executable:
chmod +x note.sh
Launch launchy
and click the gear icon in upper right for settings. If consistency with launchy
for Windows is desired, set launchy
Hotkey to Alt+Space. If you receive a keyboard shortcut conflict message as I do on Debian with Xfce, first go to Settings, Window Manager, Keyboard tab, and clear Alt+Space as the shortcut for Window operations menu.
Next in launchy
settings, go to Plugins tab and enable the plugin Runner
. Click the +
button and create a new Runner
custom command as follows:
- Name: note
- Program: /home/YOURUSERNAMEHERE/note.sh
(launchy
does not like Program path of ~/note.sh
, so a specific path with username is required)
- Arguments: '$$'
Click the Catalog tab and hit Rescan Catalog
just in case. Hit OK
to close launchy
settings.
Now let's test it.
- launch launchy
with Alt+Space or your hotkey
- type note
(You may have to wait 10 second or so on first run. You'll know things are as expected when you see the text "note" with a orange/yellow icon containing silhouette of a person.)
- hit Tab
- enter some text (no need for single or double quotes or escapes), e.g.: Remember to donate at least $3 to Josh at Launchy https://www.launchy.net/donate.php
- hit Enter
Now open collectednotes.md
to confirm the text was captured.
The remaining issues seem to be dealing with single quotes and double quotes. For example, consider the following note:
I don't know what I'd do without Launchy.
Which results in the following in collectednotes.md
:
I dont know what Id do without Launchy.
Or:
Would David Allen like universal text capture from anywhere in Linux? My bet is "yes!"
Results in the following in collectednotes.md
:
Would David Allen like universal text capture from anywhere in Linux? My bet is \yes!\
Single quoting and/or double quoting the input to launchy
doesn't solve it. Note the launchy
Runner
custom plugin construction component of '$$'
is a piece of this puzzle.
I'll give the answer to anyone that can adjust this process (via note.sh
and/or launchy
plugin setup) to appropriately handle all special characters. Maybe this would add proper escapes to user input with something like gsub
.
The rationale for being exacting regarding proper character handling is that this process is useful for copying and logging random chunks of text from web pages, but if common characters like single quotes are not handled as expected, confidence in the system is much reduced.