Spotlight | Reviews | Current Issue | Academy | Newsletter | Subscribe | Shop |
Departments

Partner Links
Make your own website
WinWeb OnlineOffice
Comparing prices of hardware is worth it.
Price Comparison
What:
Where:
Country:
vacatures Netherlands njobs Linux vacatures
arbeit Deutschland njobs Linux arbeit
work United Kingdom njobs Linux jobs
Lavoro Italia njobs Linux lavoro
Emploi France njobs Linux emploi
trabajo Espana njobs Linux trabajo

user friendly

Admin Magazine

ADMIN Network & Security

Subscribe now and save!

 ADMIN - Explore the new world of system administration! ADMIN is a smart, technical magazine for IT pros on heterogeneous networks. Each issue delivers technical solutions to the real-world problems you face every day. Learn the latest techniques for better:

  • network security
  • system management
  • troubleshooting
  • performance tuning
  • virtualization
  • cloud computing

 on Windows, Linux, Solaris, and popular varieties of Unix.

http://www.admin-magazine.com/

  linux-magazine.com » Online » Blogs » Productivity Sauce » Save Text Selection as a Tomboy Note with Autokey  

Productivity Sauce
Productivity Sauce

Save Text Selection as a Tomboy Note with Autokey

Since Autokey supports Python, you can automate virtually any task using simple (or complex) scripts. A recent addition to my ever-growing collection of handy Autokey scripts is a relatively simple solution for saving text selections as Tomboy notes:

import sys, dbus, gobject, dbus.glib 
snippet = clipboard.get_selection() 
retCode, title = dialog.input_dialog("Note Title", "Enter note title:") 
bus = dbus.SessionBus() 
obj = bus.get_object("org.gnome.Tomboy", "/org/gnome/Tomboy/RemoteControl") 
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl") 
newnote=tomboy.CreateNamedNote(title) 
tomboy.SetNoteContents(newnote, 
  tomboy.GetNoteTitle(newnote) + "\n\n" + snippet) 
tomboy.DisplayNote(newnote)

The script above is largely based on stuff from the Using the Tomboy D-Bus interface article published on Ars Technica. All I had to do is to tweak a few things; for example, I added an input dialog that prompts the user to specify a note title.

Comments


Print this page. Recommend
Share