Create a Simple Scratchpad with Autokey
A plain text file acting as a scratchpad can come in handy in many situations. You can use it to store text and code snippets, links, and other useful stuff. But copying and pasting text fragments into a text file manually is not the most sensible way to go. A simple script based on the AutoKey utility can solve the problem. AutoKey can handle Python scripts, and it has its own API which makes it supremely easy to create interactive scripts. The script itself is not particularly complicated:
snip = clipboard.get_selection() retCode, note = dialog.input_dialog("Note", "Enter note") filename = '/home/dmpop/Documents/Snips/snips.txt' file = open(filename, 'a') file.write(note+": "+snip+"\n\n") file.close()
First, the script grabs the contents of the clipboard and prompts you to enter a short note that describes the new entry. It then opens the snipx.txt file and appends the description and the clipboard contents.
I use the script for storing links, so I also added the following code block that saves the contents in the snips.html file formatted as a simple link list.
filename = '/home/dmpop/Documents/Snips/snips.html' file = open(filename, 'a') file.write(note + ": <a href=\""+snip+"\">"+snip+"</a><br> \n") file.close()
I enabled synchronization for the Documents folder via the Ubuntu One server, so I can access my scratchpad file and link list from multiple machines and via a browser.comments powered by Disqus
The Bavarian capital shuns Microsoft, Google, and other alternatives to implement an open-source groupware solution.
Phone vendor partnerships bring Mark Shuttleworth's dream of Ubuntu on a phone a step closer to reality.
Donors will get to vote on new features for the free video editor.
Debian project puts init out to pasture and says no to Ubuntu's Upstart.
Ultra-sophisticated attack tool might have originated from a state-sponsored intelligence service.
New alternative for init comes with a small footprint and minimal configuration.
X marks the target for the next-generation windowing system.
Super-clone CentOS Linux gets beamed up to the mother ship.
HTML technology will enable new video editing and playback options.
New Linux distro is optimzed for gaming.