I want to raise a structural concern about Klipper that goes beyond two bug reports I have filed on bugs.kde.org (linked below). This is not a complaint about the existence of Klipper or the value of clipboard management — it is a focused argument that Klipper’s current defaults and architecture create a privacy problem that the KDE desktop should take seriously, and that there is a straightforward path to addressing it.
The problem in plain terms
Klipper, as shipped and configured by default on Kubuntu 24.04 LTS, silently records everything that passes through the clipboard — passwords, authentication tokens, personal correspondence, API keys, sensitive document content — with no entry limit, no expiry, no first-run notification to the user, and no default prompt to clear history on session end.
Furthermore, the standard OS-level tools that users and sysadmins reach for to clear clipboard contents — xsel, xclip, and equivalent X11 utilities — do not interact with Klipper’s history store at all. A user who diligently runs a clipboard-clearing script, or follows advice from a security guide, will clear the X11 clipboard buffer and believe they have cleared their clipboard. They have not. Klipper has retained everything in ~/.local/share/klipper/history2.lst, silently, across reboots.
This is not a niche edge case. It affects anyone who:
- Uses a password manager with clipboard-based copy (virtually all of them)
- Works with API keys, tokens, or credentials at the command line
- Handles confidential content in any professional capacity
- Operates on a shared or multi-user machine
- Follows any security hygiene guide that recommends clearing the clipboard
The defaults problem
The default configuration ships with unlimited clipboard history entries, history persistent across reboots, no notification to the user that history is being maintained, and no session-end clearing option.
These are, respectfully, the wrong defaults for a privacy-respecting desktop operating system. The Linux desktop user base skews strongly toward people who care about data control. The defaults should reflect that. A reasonable privacy-respecting default would be something like: 20 entries maximum, cleared on session end, with a clear opt-in path for users who want persistent unlimited history.
The missing feature
There is no built-in “clear all clipboard traces” function anywhere in the KDE desktop — not in Klipper’s own interface, not in System Settings, not as a keyboard shortcut. A user who wants to definitively clear the clipboard and its history must either know the DBus interface or manually delete a file in ~/.local/share/klipper/.
To illustrate how non-trivial this is in practice, I worked through the following layers before arriving at a reliable solution:
- The “Disable clipboard history” toggle in System Settings does not work (filed as bug)
sudo systemctl stop klipperfails — there is no systemd unit; Klipper is embedded in plasmashellxselandxclipdo not touch Klipper’s store- The correct DBus method (
clearClipboardHistory()) silently fails in scripted contexts without explicitDBUS_SESSION_BUS_ADDRESSexport (filed as bug)
The working solution, once fully debugged, is this script:
#!/bin/bash
# clear-traces.sh — wipe clipboard and shell history for user + root
export DISPLAY="${DISPLAY:-:0}"
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
# ── Clipboard (xsel + xclip) ──────────────────────────────────────
clear_clipboard() {
if command -v xsel &>/dev/null; then
xsel --primary --clear
xsel --clipboard --clear
xsel --secondary --clear
fi
if command -v xclip &>/dev/null; then
echo -n "" | xclip -selection primary
echo -n "" | xclip -selection clipboard
echo -n "" | xclip -selection secondary
fi
}
clear_clipboard
# ── Shell History (current user) ──────────────────────────────────
history -c
history -w
for f in \
~/.bash_history \
~/.zsh_history \
~/.sh_history \
~/.local/share/fish/fish_history; do
[ -f "$f" ] && > "$f"
done
# ── Root account ──────────────────────────────────────────────────
sudo bash -c '
history -c
history -w
for f in \
/root/.bash_history \
/root/.zsh_history \
/root/.sh_history \
/root/.local/share/fish/fish_history; do
[ -f "$f" ] && > "$f"
done
export DISPLAY="${DISPLAY:-:0}"
command -v xsel &>/dev/null && xsel --primary --clear && xsel --clipboard --clear
command -v xclip &>/dev/null && echo -n "" | xclip -selection clipboard
'
# ── Klipper ───────────────────────────────────────────────────────
shred -u ~/.local/share/klipper/history2.lst
touch ~/.local/share/klipper/history2.lst
# Must be last — prevents Klipper recapturing terminal output before the wipe lands
qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory
echo "Done. Clipboard and history wiped for user and root."
This works. But a user should not need to reverse-engineer four layers of the desktop environment and debug DBus environment variable inheritance to achieve what amounts to: clear my clipboard.
A constructive proposal
I am not asking for Klipper to be removed or disabled. I am asking the KDE team to consider the following:
-
Add a “Clear all clipboard history” button to the Klipper interface and/or System Settings → Clipboard. One click. Immediate. No scripts required.
-
Add a “Clear history on session end” option to System Settings → Clipboard, defaulting to enabled or at minimum prominently offered.
-
Revise the default entry limit from unlimited to a reasonable bounded number (20–50 entries).
-
Fix the broken UI toggle — if “Save clipboard history” is unchecked, it should actually stop saving clipboard history. This is filed separately as a bug.
-
Consider a first-run or post-install notice that clipboard history is being maintained, with a direct link to the relevant settings. This is standard practice for features that collect user data.
None of these are radical changes. They are the kind of privacy-respecting defaults and controls that users of a serious Linux desktop environment should be able to take for granted.
I have enormous respect for the work the KDE team puts into Plasma, and I raise this in the spirit of making an already excellent desktop environment better. The Linux desktop is increasingly important as a refuge for users who want genuine control over their computing environment. Klipper’s current behavior works against that goal in ways that I believe are unintentional rather than deliberate — which is exactly why I think they are worth fixing.
Related bug reports
- Bug #1: “Klipper clipboard history cannot be disabled by any documented or discoverable method — 9 reproducible failure modes”
- Bug #2: “
clearClipboardHistory()DBus method silently exits 0 without clearing history when called from a shell script”
Jonathan Brown — GitHub: github.com/black-vajra