Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Web Security TippsNew manual calculation setting in Google Sheets(21.09.2026 um 20:54 Uhr)
Videos & KonferenzenTechquickie: The Steam Frame Shouldn't Work - Here's Why It Does(21.09.2026 um 21:17 Uhr)
Sichere ProgrammierungHow to Build a Production-Ready iOS App With AI-Generated Code(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungAfriex Integrations: Sandbox, Idempotency, and Webhook Simulation(21.09.2026 um 21:50 Uhr)
Sichere ProgrammierungBridging Local and Cloud Databases for Centralized Data Management(21.09.2026 um 21:51 Uhr)
Web Security TippsNew manual calculation setting in Google Sheets(21.09.2026 um 20:54 Uhr)
Videos & KonferenzenTechquickie: The Steam Frame Shouldn't Work - Here's Why It Does(21.09.2026 um 21:17 Uhr)
Sichere ProgrammierungHow to Build a Production-Ready iOS App With AI-Generated Code(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungAfriex Integrations: Sandbox, Idempotency, and Webhook Simulation(21.09.2026 um 21:50 Uhr)
Sichere ProgrammierungBridging Local and Cloud Databases for Centralized Data Management(21.09.2026 um 21:51 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Shorts. Extra clipboard buffer with CopyQ

Hi! Linux has two clipboard buffers: primary for mouse selection and clipboard for Ctrl+C / Ctrl+V. But sometimes that's not enough and you want to keep some text around to paste later (like clipboard registers in Vim, but…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hi!



Linux has two clipboard buffers: primary for mouse selection and clipboard for Ctrl+C / Ctrl+V.

But sometimes that's not enough and you want to keep some text around to paste later (like clipboard registers in Vim, but system-wide).

We can make this possible with CopyQ clipboard manager, which allows us to have multiple tabs for our copied data.





DISCLAIMER




  1. I’m talking about text only, other media types won’t work with the script below.

  2. In CopyQ settings check the (1) Store clipboard and (2) Store text selected using mouse.



In CopyQ settings check the  raw `(1) Store clipboard` endraw  and  raw `(2) Store text selected using mouse` endraw





Code



Here is a simple bash-script, that adds new tab and uses it as an extra clipboard buffer:




#!/usr/bin/env bash
# Allows to save text to extra buffer in CopyQ.
# Bind `copy()` to Alt+C, `paste()` to Alt+V.
# Alt+C copies selected text to extra buffer, current clipboard remains unchanged.
# Alt+V copies latest item in extra buffer to clipboard (you still have to paste it manually with Ctrl+V, `copyq paste` is laggy).
# If item in extra buffer is already in clipboard, then Alt+V removes it from clipboard (extra buffer still has it).

set -e

CMD="$1" # One of: `copy`, `paste`
EXTRA_BUFFER="ExtraBuffer"

copy() {
local selected=$(copyq selection)
local old=$(copyq read -1)
copyq tab "$EXTRA_BUFFER" add "$selected"
copyq remove 0
copyq copy "$old"
}

paste() {
local clipboard=$(copyq read 0)
local extra=$(copyq tab "$EXTRA_BUFFER" read 0)

if [[ "$clipboard" == "$extra" ]]; then # Restoring old copied item from clipboard.
copyq remove 0
local old=$(copyq read 0)
copyq copy "$old"
else # Adding item from extra buffer to clipboard.
local extra=$(copyq tab "$EXTRA_BUFFER" read 0)
copyq write 0 "$extra"
copyq copy "$extra"
fi
}

case "$CMD" in
copy) copy;;
paste) paste;;
*) ;;
esac






You can bind it in i3wm like so (replace SCRIPT_PATH):




set $alt Mod1
bindsym $alt+C exec "bash SCRIPT_PATH copy"
bindsym $alt+V exec "bash SCRIPT_PATH paste"






Bye!

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Shorts. Extra clipboard buffer with CopyQ

Thematisch verwandte Begriffe: Shorts, Extra, clipboard, buffer · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94497 | jshERP through 3.6 fails to validate object ownership in by-id info, upd…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick