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 245/2021
Buy this issue as a PDF
News
-
OpenMandriva Lx 4.2 has Arrived
The latest stable version of OpenMandriva has been released and offers the newest KDE desktop and ARM support.
-
Thunderbird 78 is being ported to Ubuntu 20.04
The Ubuntu developers have made the decision to port the latest release of Thunderbird to the LTS version of the platform.
-
Elementary OS is Bringing Multi-Touch Gestures to the OS
User-friendly Linux distribution, elementary OS, is working to make using the fan-favorite platform even better for laptops.
-
Decade-Old Sudo Flaw Discovered
A vulnerability has been discovered in the Linux sudo command that’s been hiding in plain sight.
-
Another New Linux Laptop has Arrived
Slimbook has released a monster of a Linux gaming laptop.
-
Mozilla VPN Now Available for Linux
The promised subscription-based VPN service from Mozilla is now available for the Linux platform.
-
Wayland and New App Menu Coming to KDE
The 2021 roadmap for the KDE desktop environment includes some exciting features and improvements.
-
Deepin 20.1 has Arrived
Debian-based Deepin 20.1 has been released with some interesting new features.
-
CloudLinux Commits Over 1 Million Dollars to CentOS Replacement
An open source, drop-in replacement for CentOS is on its way.
-
Linux Mint 20.1 Beta has Been Released
The first beta of Linux Mint, Ulyssa, is now available for downloading.