clipassist

module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: 0BSD

README

ClipAssist

Test Lint Go Reference

Note: this project integrates with the system clipboard and the notifications system of your device, and as a result, requires CGO.

This tool serves as a framework for operating on selected text. It provides functionality to run in the background of your system and listen in on your clipboard operations. When a piece of text is copied that matches a specified regex, a function can be called against that piece of text.

Built-in Modules

Module Detects Action
millis 13-digit Unix millisecond timestamps Shows human-readable date/time
seconds 10-digit Unix second timestamps Shows human-readable date/time
uuid UUIDs (v1–v7) Shows UUID version info
hexcolor CSS hex colors (#rgb, #rrggbb, #rrggbbaa) Shows RGB(A) breakdown + OKLCH
jwt JSON Web Tokens Shows header info, subject, issuer, expiry
ipaddr IPv4 & IPv6 addresses Shows address type (private/public/loopback)
base64 Base64-encoded strings Decodes and shows preview of content

Writing Your Own Module

A module is simply a function that returns []matchers.Matcher. Each matcher pairs a regular expression with a callback:

package mymodule

import (
    "regexp"
    "github.com/taigrr/clipassist/matchers"
)

func Matchers() []matchers.Matcher {
    return []matchers.Matcher{
        {
            Regex: regexp.MustCompile(`pattern`),
            ID:    "my-module",
            F:     func(matched string) {
                // Do something with the matched text
            },
        },
    }
}

Then register it in cmd/clipassist/main.go:

matchers.Add(mymodule.Matchers()...)

Set FullText: true on a matcher if you only want it to fire when the entire clipboard content matches (not substrings).

Installation

go install github.com/taigrr/clipassist/cmd/clipassist@latest

A sample systemd unit file to be placed into /etc/systemd/user/clipassist.service is provided. Be sure to change the path to the binary to match your home folder.

License

Released under the 0BSD license.

Directories

Path Synopsis
cmd
clipassist command
Command clipassist watches the system clipboard and runs registered matcher modules against copied text, surfacing helpful information via desktop notifications.
Command clipassist watches the system clipboard and runs registered matcher modules against copied text, surfacing helpful information via desktop notifications.
modules
base64decode
Package base64decode provides a clipboard matcher that detects base64-encoded strings and shows a notification with the decoded content.
Package base64decode provides a clipboard matcher that detects base64-encoded strings and shows a notification with the decoded content.
hexcolor
Package hexcolor provides a clipboard matcher that detects CSS hex color codes (#rgb, #rrggbb, #rrggbbaa) and shows an informational notification with the RGB(A) breakdown and OKLCH approximation.
Package hexcolor provides a clipboard matcher that detects CSS hex color codes (#rgb, #rrggbb, #rrggbbaa) and shows an informational notification with the RGB(A) breakdown and OKLCH approximation.
ipaddr
Package ipaddr provides a clipboard matcher that detects IPv4 and IPv6 addresses and shows a notification with address type information.
Package ipaddr provides a clipboard matcher that detects IPv4 and IPv6 addresses and shows a notification with address type information.
jwt
Package jwt provides a clipboard matcher that detects JSON Web Tokens and shows a notification with the decoded header and payload.
Package jwt provides a clipboard matcher that detects JSON Web Tokens and shows a notification with the decoded header and payload.
millis
Package millis provides a clipboard matcher that detects 13-digit Unix millisecond timestamps and shows a human-readable notification.
Package millis provides a clipboard matcher that detects 13-digit Unix millisecond timestamps and shows a human-readable notification.
seconds
Package seconds provides a clipboard matcher that detects 10-digit Unix timestamps (seconds since epoch) and shows a human-readable notification.
Package seconds provides a clipboard matcher that detects 10-digit Unix timestamps (seconds since epoch) and shows a human-readable notification.
uuid
Package uuid provides a clipboard matcher that detects UUIDs and shows a desktop notification confirming the format and version.
Package uuid provides a clipboard matcher that detects UUIDs and shows a desktop notification confirming the format and version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL