██████╗██╗ ██╗██████╗ ██████╗ ██████╗ █████╗ ██████╗ ██████╗ ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗ ██║ ██║ ██║██████╔╝██████╔╝██║ ██║███████║██████╔╝██║ ██║ ██║ ██║ ██║██╔═══╝ ██╔══██╗██║ ██║██╔══██║██╔══██╗██║ ██║ ╚██████╗███████╗██║██║ ██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝ ╚═════╝╚══════╝╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝
The dms cl command provides a Wayland clipboard manager with history, search, and other configurable knobs. It uses the ext_data_control_v1 protocol for clipboard access.
dms cl copy [text]dms cl pastedms cl watch [cmd]dms cl historydms cl get <id>dms cl delete <id>dms cl cleardms cl search [query]dms cl config getdms cl config set# Copy text to clipboard
echo "hello" | dms cl copy
dms cl copy "hello world"
# Paste clipboard contents
dms cl paste
# View clipboard history
dms cl history
# Search history
dms cl search "password"
dms cl copy [text]Copies data to the Wayland clipboard. Forks a background process by default to serve paste requests.
dms cl copy [text] [flags]
Arguments:
text (optional): Text to copy. If omitted, reads from stdin.Flags:
-f, --foreground: Stay in foreground instead of forking-o, --paste-once: Exit after first paste (one-shot copy)-t, --type <mime>: MIME type (default: text/plain;charset=utf-8)Examples:
# Copy string directly
dms cl copy "Hello, world!"
# Copy from stdin
echo "piped content" | dms cl copy
# Copy file contents
dms cl copy < file.txt
# Copy image with MIME type
dms cl copy -t image/png < screenshot.png
# One-shot copy (clipboard cleared after first paste)
dms cl copy -o "temporary secret"
dms cl pasteReads current clipboard selection and writes to stdout.
dms cl paste
Examples:
# Paste to terminal
dms cl paste
# Paste to file
dms cl paste > output.txt
# Pipe to another command
dms cl paste | wc -l
dms cl watch [command]Watches for clipboard changes. Without arguments, prints changes to stdout.
dms cl watch [command] [flags]
Arguments:
command (optional): Command to pipe clipboard contents to.Flags:
--json: Output as JSON objects-s, --store: Store changes to history database (no server needed)Examples:
# Print clipboard changes to stdout
dms cl watch
# Pipe each clipboard change to a command
dms cl watch notify-send
# Output as JSON
dms cl watch --json
# Store to history without running the server
dms cl watch --store
JSON output format:
{"data": "clipboard content", "mimeType": "text/plain", "timestamp": 1699900000, "size": 17}
dms cl historyLists history entries with ID, type, timestamp, and preview. Requires the DMS server.
dms cl history [flags]
Flags:
--json: Output as JSON arrayExample output:
ID Type Timestamp Preview
─────────────────────────────────────────────────────────────
1 text/plain 2024-01-15 10:30:00 Hello, world!
2 image/png 2024-01-15 10:31:00 [image 1920x1080]
3 text/plain 2024-01-15 10:32:00 Some longer text that gets trunca...
dms cl get <id>Retrieves full entry data by ID. Outputs raw data by default.
dms cl get <id> [flags]
Arguments:
id (required): Entry ID from history.Flags:
--json: Output full entry as JSONExamples:
# Get raw data
dms cl get 42
# Get as JSON
dms cl get 42 --json
# Save image to file
dms cl get 42 > image.png
dms cl delete <id>Delete a history entry by ID. Requires the DMS server.
dms cl delete <id>
dms cl clearClear all clipboard history. Requires the DMS server.
dms cl clear
dms cl search [query]Search history with text matching and filters. Requires the DMS server.
dms cl search [query] [flags]
Arguments:
query (optional): Text to search for.Flags:
-l, --limit <n>: Max results (default: 50, max: 500)-o, --offset <n>: Result offset for pagination-m, --mime <type>: Filter by MIME type substring--images: Only image entries--text: Only text entries--json: Output as JSONExamples:
# Search for text
dms cl search "password"
# Find all images
dms cl search --images
# Find text entries containing "http"
dms cl search --text "http"
# Paginate results
dms cl search --limit 10 --offset 20
# Filter by MIME type
dms cl search -m "image/png"
dms cl config getGet current clipboard manager configuration as JSON.
dms cl config get
dms cl config setUpdate configuration options.
dms cl config set [flags]
Flags:
--max-history <n>: Max history entries to keep--auto-clear-days <n>: Delete entries older than N days (0 disables)--clear-at-startup / --no-clear-at-startup: Clear history on server start--disable / --enable: Disable/enable clipboard manager entirely--disable-history / --enable-history: Disable/enable history persistenceExamples:
# Set max history to 500 entries
dms cl config set --max-history 500
# Auto-clear entries older than 7 days
dms cl config set --auto-clear-days 7
# Disable history persistence
dms cl config set --disable-history
# Clear history on each startup
dms cl config set --clear-at-startup
Settings are stored at $XDG_CONFIG_HOME/DankMaterialShell/clsettings.json (defaults to ~/.config/DankMaterialShell/clsettings.json).
disabledfalsedisableHistoryfalsemaxHistory100maxEntrySize10485760autoClearDays0clearAtStartupfalseJSON schema:
{
"disabled": false,
"disableHistory": false,
"maxHistory": 100,
"maxEntrySize": 10485760,
"autoClearDays": 0,
"clearAtStartup": false
}
For programmatic access, the clipboard manager exposes JSON-RPC methods over the DMS IPC socket.
clipboard.getHistoryclipboard.getEntry{id: uint64}clipboard.deleteEntry{id: uint64}clipboard.clearHistoryclipboard.search{query?, limit?, offset?, mimeType?, isImage?}clipboard.getConfigclipboard.setConfigExample IPC call:
dms ipc call clipboard.search '{"query": "hello", "limit": 10}'
dms cl [command] [flags]
Available Commands:
copy [text]: Copy to clipboardpaste: Paste from clipboardwatch [cmd]: Watch clipboard changeshistory: List clipboard historyget <id>: Get entry by IDdelete <id>: Delete entry by IDclear: Clear all historysearch [query]: Search historyconfig get: Get configurationconfig set: Update configurationGlobal Flags:
-c, --config <path>: Specify custom DMS config directory-h, --help: Show help