How to use clipboard managers on Linux

Become a copy and paste power user by using a Linux clipboard manager.
171 readers like this.
Top 5 Linux pain points in 2017

Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0

You probably copy and paste snippets of text on your computer multiple times a day without ever thinking about it. You may take it for granted, because it's older than Unix, with its earliest implementation through macros or manual repetition of line-editor commands. While the process has largely remained the same over the past 15 years, there's a side to copy and paste that many users never see: the clipboard manager.

The clipboard is a (usually invisible) place in memory that holds the contents of whatever you have copied or cut. It is generally global, meaning it has access to whatever you copy or cut across your entire operating system, regardless of what application you are using. In fact, it's because the clipboard is global that you can copy from one application to another, even though those applications are probably developed by different developers.

Long ago, early Unix desktops introduced the concept of a clipboard manager: a GUI application meant to track the history of what you copy and cut so that you can paste not only the most recent item but any of the most recent 10 or 20 things you copied.

In other words, imagine that during a session with your mundane desktop, you copy the word "zero" from a text file and then the word "one." Normally, the second item (the word "one") replaces whatever is in your clipboard (the word "zero"), so when you paste, you see the second item (the word "one"). That's how normal desktop copy and paste works, and it seems to be good enough for most users.

With a clipboard manager, though, you can copy "zero" and then "one" and then "penguin" and then anything else you like, and all of them are stored in your clipboard manager's history.

Clipboard history

That's how the Linux desktop works and has worked since even before the days of CDE. It might seem strange at first, but once you get used to it, you find it hard to live without. Here's how to enable a clipboard manager on your desktop.

KDE

If you're using the KDE Plasma Desktop, you already have a clipboard manager enabled. It's called Klipper, and it's fully functional by default in any KDE install.

Klipper

KDE is famous for being configurable, so it's no surprise that you can configure Klipper to suit your unique workflow. It's easy to move your mouse over to the Klipper icon in the KDE system tray, click it, and select the content you want to paste. However, if you're looking for greater efficiency, you can configure Klipper to open with a custom keyboard shortcut. You can also configure custom actions that are triggered when you copy specific content types.

Klipper settings

As usual with KDE, the clipboard manager appears simple but is actually a robust, scriptable, and customizable suite of useful utilities. Thanks to the modularity of Plasma widgets ("plasmoids," as they used to be called), Klipper can run as a system tray element in any desktop or window manager, such as Fluxbox, LXQT, i3, etc.

GNOME

The GNOME desktop tends to favor minimalism, and one of the things it swept under the rug is the clipboard manager. Luckily, a clipboard manager called Clipboard Indicator is available as a GNOME extension.

You can access GNOME extensions in two ways: through a Firefox browser add-on or the GNOME Tweaks package. Since you usually find extensions on the internet, it makes a lot of sense to use an internet browser to help manage them. (If you use another open source browser than Firefox, see below for information on GNOME Tweaks).

Firefox GNOME extensions

To enable GNOME extension management in Firefox, click the hamburger menu in the upper-right corner of Firefox and select Add-ons. In the Add-ons tab, click on the Extensions category in the left column. In the Search on addons.mozilla.org field, enter gnome. Find the add-on called GNOME Shell integration and click to navigate to its page.

Search result for GNOME Shell Integration

In the GNOME Shell integration page that opens, click the Add to Firefox button and then follow the prompts to install the add-on.

Once the add-on is installed, it appears in your Firefox toolbar in the shape of a footprint.

Installing the clipboard manager

To manage GNOME extensions, click the footprint icon in your Firefox toolbar. This navigates to extensions.gnome.org and displays a list of GNOME extensions available for installation. Search for clipboard in the text field on the page to filter the list, and then look for the Clipboard Indicator extension. Click on the title to open its page.

The Clipboard Indicator page features a link to its source code, a brief description of what it does, and a toggle to activate or deactivate it on your desktop.

GNOME extension toggle

Click the toggle button to activate it.

Follow the prompts to allow Firefox to download the GNOME extension to the appropriate location on your hard drive (they're stored in ~/.local/share/gnome-shell/extensions/, for the record) and activate the extension. As soon as it's downloaded and activated, you have a new icon in the top-right of your GNOME desktop.

Try copying some text from Firefox, then click the clipboard icon to see it in your clipboard history.

If you want your clipboard manager to stop recording the history of your copy-and-paste activities at any time, click the clipboard icon and select Private mode.

You can configure your clipboard manager with the Settings option. Available options include whether to display a notification when something is copied (you probably want this off if you copy and paste often), how far back you want your history to go before items are replaced with new ones, and what keyboard shortcuts you use to display and move through items in the menu.

GNOME Tweaks

The GNOME Tweaks application is casually known as "the configuration panel that GNOME forgot to include." It has many powerful features and choices, but for this article, the only one that matters is the ability to activate or deactivate extensions. You can install GNOME Tweaks through your package manager or in your software installer of choice.

For example, on Fedora, CentOS, or RHEL:

$ sudo dnf install gnome-tweaks

On Ubuntu or Debian, use apt install instead.

Before you can activate an extension, you must install it.

The quickest way to install the Clipboard Indicator extension is to use Git to clone the repository into your ~/.local/share/gnome-shell/extensions directory with:

$ git clone \
https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator.git \
~/.local/share/gnome-shell/extensions/clipboard-indicator@tudmotu.com

Now the extension is installed, so click Activities in the top-left of your GNOME desktop and launch GNOME Tweaks.

In GNOME Tweaks, click on Extensions in the left column.

GNOME Tweaks clipboard

Find the Clipboard Indicator in the list of extensions, and click the toggle button to activate it.

Master the power of clipboard management

Clipboard managers are powerful convenience tools, and they're hard to give up when you're using a non-Linux desktop. Luckily, developers for other operating systems have borrowed the idea of clipboard managers, so you can often find similar functionality for any OS you happen to be on.

Get started using a clipboard manager on Linux today. You won't be sorry!

What to read next
Tags
Seth Kenlon
Seth Kenlon is a UNIX geek, free culture advocate, independent multimedia artist, and D&D nerd. He has worked in the film and computing industry, often at the same time.

5 Comments

I use KDE, and when I highlight some text, then press Delete, I want it deleted, not placed in the Clipboard. I use Ctrl-X if I want it there. I don't see any setting for that. It's annoying to Delete, then pull up the Clipboard and delete again.
Incidentally, most of the time, if you want to Copy, Paste, and Cut, you use Ctrl-C, Ctrl-V, and Ctrl-X respectively. If you're working in Bash at the command line, the shortcuts are Shift-Ctrl-C, Shift-Ctrl-V, and Shift-Ctrl-X respectively.

Selecting text in X11 by default sends that text to the clipboard. It's what enables you to select text and NOT press ctrl+C but still be able to paste it with a middle-click. For me, it's a great feature, but I can see how it's also not always the desired outcome.

I'll file away your issue and maybe do a separate article about the subtleties of the X11 clipboard buffers. Who knows, maybe I'll stumble on an obvious work-around!

In reply to by Greg P

Thanks, Seth. I also found out that you can stop this behavior. In the Clipboard settings, under the General tab, select Ignore selection and Apply. Afterwards, selected text is not sent to the clipboard, yet if you then press Ctrl-C, it is.
Thanks for helping me find this.

In reply to by sethkenlon

And I should have added that if you select text and press Delete, it doesn't go to the clipboard. Annoyance fixed!

I've tried a lot of clipboard managers and my favorite is CopyQ. It is full of features, convenient and is cross-platform so I have it on all of my computers no matter what the OS.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.