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 DisqusIssue 262/2022
Buy this issue as a PDF
News
-
Kali Linux 2022.3 Released
From the creators of the most popular penetration testing distributions on the planet, comes a new release with some new tools and a community, real-time chat option.
-
The 14" Pinebook Pro Linux Laptop is Shipping
After a considerable delay, the 14" version of the Pinebook Pro laptop is, once again, available for purchase.
-
OpenMandriva Lx ROME Technical Preview Released
OpenMandriva’s rolling release distribution technical preview has been released for testing purposes and adds some of the latest/greatest software into the mix.
-
Linux Mint 21 is Now Available
The latest iteration of Linux Mint, codenamed Vanessa, has been released with a new upgrade tool and other fantastic features.
-
Firefox Adds Long-Anticipated Feature
Firefox 103 has arrived and it now includes a feature users have long awaited…sort of.
-
System76 Refreshes Their Popular Oryx Pro Laptop with a New CPU
The System76 Oryx Pro laptop has been relaunched with a 12th Gen CPU and more powerful graphics options.
-
Elive Has Released a New Beta
The Elive team is proud to announce the latest beta version (3.8.30) of its Enlightenment-centric Linux distribution.
-
Rocky Linux 9 Has Arrived
The latest iteration of Rocky Linux is now available and includes a host of new features and support for new architecture.
-
Slimbook Executive Linux Ultrabook Upgrading Their CPUs
The Spanish-based company, Slimbook, has made available their next generation Slimbook Executive Linux ultrabooks with a 12th Gen Intel Alder Lake CPU.
-
Fedora Linux is Coming to the Raspberry Pi 4
Thanks to significant work in the upstream, the upcoming release of Fedora 37 will introduce support for the Raspberry Pi 4.