I often find myself pasting the same strings into the browser (I have a youtube channel, and at the end of the videos I constantly post the same links: channel URL, website, email, introductory video, etc).
I thought about creating a text file and then adding it to the Unity panel, but unfortunately while I see the way to add the text editor to it, I can't add the text file to be opened with the text editor. I could probably put a script together and add that to the panel, but then it struck me that other people probably had the same time wasting experience, and probably have already found the solution.
In the perfect world I need an application that stores commonly needed strings, when loaded it would right away start on top of other windows and stay as such, it would have buttons for different strings, and they would be placed into the buffer as soon as pressed. This way I would just assign that which I need to those buttons and be very very happy.
If no good solution exists, I will just have to create it myself, I guess. After all my channel is about programming, and I can probably make a wonderful lesson just out of creating such a tool.
You can install
autokey
withsudo apt-get install autokey-gtk
for the GTK+ version orsudo apt-get install autokey-qt
for the Qt version.autokey
allows you to define abbreviations which when typed in anywhere in your xsession will expand to a defined phrase: E.g I defined an abbreviationxyy
for the phrase Thank you for your help. I ticked in the Always prompt before pasting this phrase option in theautokey
configuration. From now on, anywhere I typexyy
and hit a space, a small pop-up appears, which I can select with a down-arrow key and an ENTER and the typedxyy
is replaced with the phrase Thank you for your help.If you don't tick in the "prompt before pasting" option then the abbreviation is replaced immediately after you hit space. You can also define scripts, like for inserting the current date.
I use
autokey-gtk
on 12.04 which has a minor problem that theautokey
tray icon doesn't show up on the panel. To correct this just launchdconf-editor
and add'Autokey'
to the Desktop->Unity->Panel->systray-whitelist array. E.g. for me it contained['JavaEmbeddedFrame', 'Wine', 'Update-notifier']
and I modified it to['JavaEmbeddedFrame', 'Wine', 'Update-notifier', 'Autokey']
. If you are using Unity2D then this won't solve the problem because of a bug in Unity2D. For Unity2D you have to change the array to['all']
to whitelist every app. After these modifications log-out/log-in and the tray icon should be visible now.Don't forget to set
autokey
to start up on login, on the Edit->Preferences->General tab.Personally I've found ClipIt to cover all my copy/paste needs.
With it's hotkey combinations you can pretty much get to any paste item super quickly. I have set Ctrl+Alt+H to "manage history" which allows me to instantly launch a floating window, type a search for the item I want to paste and paste it directly into whatever window I'm in (make sure "Automatically paste selected item" is checked in Preferences > Settings).
There's also the fast access "Manage hotkey" which shows you a list of the most recent 20 clips for quick access. If the items you're pasting are used commonly they'll be in your history.
If you're not pasting them that commonly you could use ClipIt's "Actions" feature to place items into the clipboard quickly.
For example, in actions you could add:
You can then run the actions hotkey (default ctrl+alt+a), select your command title, and then ctrl+v to paste.
Works pretty sweetly. Sadly I haven't worked out how to make the action auto-paste into the current window. I tried piping to xclip -o but that doesn't work.
This can be done by creating a custom launcher for GEdit to open your text file
Install gnome-panel. The package will provides the tool to create launcher:
Create custom launcher with gnome-desktop-item-edit:
2.1. Set launcher type to Applications
2.2. Give a name for it (eg: Youtube Channel,...)
2.3. Set the command to
gedit <path to text file>
2.4. Give it a comment (optional)
2.5. Click OK :p
Search the new launcher in Dash
Add it to panel and volia! You've done ;)
UPDATE: If you want click-to-copy then install
xsel
And you have click-to-copy launcher (NOTE: there will be no output showing that you have copied the text)