Save Text Selection as a Tomboy Note with Autokey
        Productivity Sauce
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 powered by DisqusSubscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
    Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
	
News
- 
		    					    		    
Linux Now Runs Most Windows Games
The latest data shows that nearly 90 percent of Windows games can be played on Linux.
 - 
		    					    		    
Fedora 43 Has Finally Landed
The Fedora Linux developers have announced their latest release, Fedora 43.
 - 
		    					    		    
KDE Unleashes Plasma 6.5
The Plasma 6.5 desktop environment is now available with new features, improvements, and the usual bug fixes.
 - 
		    					    		    
Xubuntu Site Possibly Hacked
It appears that the Xubuntu site was hacked and briefly served up a malicious ZIP file from its download page.
 - 
		    					    		    
LMDE 7 Now Available
Linux Mint Debian Edition, version 7, has been officially released and is based on upstream Debian.
 - 
		    					    		    
Linux Kernel 6.16 Reaches EOL
Linux kernel 6.16 has reached its end of life, which means you'll need to upgrade to the next stable release, Linux kernel 6.17.
 - 
		    					    		    
Amazon Ditches Android for a Linux-Based OS
Amazon has migrated from Android to the Linux-based Vega OS for its Fire TV.
 - 
		    					    		    
Cairo Dock 3.6 Now Available for More Compositors
If you're a fan of third-party desktop docks, then the latest release of Cairo Dock with Wayland support is for you.
 - 
		    					    		    
System76 Unleashes Pop!_OS 24.04 Beta
System76's first beta of Pop!_OS 24.04 is an impressive feat.
 - 
		    					    		    
Linux Kernel 6.17 is Available
Linus Torvalds has announced that the latest kernel has been released with plenty of core improvements and even more hardware support.
 
