Stable v0.1.0

garclip

X11 clipboard manager with history, filtering, and persistence

garclip is a clipboard manager for the gardesk ecosystem that monitors both CLIPBOARD and PRIMARY X11 selections. It maintains a searchable history with configurable limits, supports text, images, and file URIs, provides content filtering by regex patterns and window class, and includes a keyboard-driven picker UI for selecting from history. Built with XFixes for efficient event-driven monitoring.

🎯 RPM Available

Installation

garclip is available as an RPM package for Fedora and RHEL-compatible distributions.

Using DNF (Recommended)

$sudo dnf config-manager --add-repo https://repos.musicsian.com/musicsian.repo
$sudo dnf install garclip

Building from Source

$git clone https://github.com/espadon/gardesk
$cd gardesk/garclip
$cargo build --release
$sudo cp target/release/garclip /usr/local/bin/
$sudo cp target/release/garclipctl /usr/local/bin/
$sudo cp target/release/garclip-picker /usr/local/bin/

Components

  • garclip - Main daemon with built-in CLI commands
  • garclipctl - Standalone control utility
  • garclip-picker - GUI picker for selecting from history

Quick Start

Start the daemon and interact with the clipboard.

Starting the Daemon

$garclip daemon# start in background (default)
$garclip daemon --foreground# start in foreground for debugging

Basic Operations

$garclip copy "Hello, World!"# copy text
$echo "From stdin" | garclip copy# copy from stdin
$garclip paste# output clipboard to stdout
$garclip history# show recent history
$garclip select 42# select entry #42 from history

Using the Picker

$garclip-picker# open GUI picker

Use arrow keys to navigate, type to filter, Enter to select, Escape to cancel.

Autostart with gar

Add garclip to your gar configuration with a keybinding for the picker.

-- ~/.config/gar/init.lua

-- Start clipboard daemon
gar.exec_once("garclip daemon")

-- Bind Super+V to open clipboard picker
gar.bind("mod+v", function()
  gar.spawn("garclip-picker")
end)

systemd Service

Create a user service for automatic startup.

# ~/.config/systemd/user/garclip.service
[Unit]
Description=garclip clipboard manager
PartOf=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/garclip daemon --foreground
Restart=on-failure

[Install]
WantedBy=graphical-session.target
$systemctl --user daemon-reload
$systemctl --user enable --now garclip.service

CLI Commands

Option Type Default Description
daemon [--foreground] - - Start the clipboard daemon (--foreground for debugging)
copy [TEXT] - - Copy text to clipboard (reads from stdin if TEXT not provided)
paste - - Output current clipboard content to stdout
history [--limit N] [--json] - - Show clipboard history (default: 20 entries)
select ID - - Select an entry from history (makes it current clipboard)
delete ID - - Delete an entry from history
clear - - Clear the clipboard
clear-history [--keep-pinned] - - Clear history (optionally keep pinned entries)
pin ID - - Pin an entry (survives history limit)
unpin ID - - Unpin an entry
list-pinned [--json] - - List pinned entries
search QUERY [--limit N] [--json] - - Search history by text content
status [--json] - - Show daemon status
reload - - Reload configuration
stop - - Stop the daemon