clipy

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 17 Imported by: 0

README

📋clipy: Manage Your Clipboard History

clipy is a simple tool that saves your clipboard history to a local sqlite database and lets you browse and select entries using an fzf-like interface.

How to install

To install clipy using Go, run:

$ go install github.com/szktkfm/clipy/cmd/clipy@latest

Or, download it:

GitHub Releases

How to use

Run clipy shell to generate a shell script, and then add it to your zshrc or bashrc file for seamless integration.

$ clipy shell zsh | tee -a ~/.zshrc

# https://github.com/szktkfm/clipy
# Run daemon
clipy

__clipy_history() {
    BUFFER="${BUFFER}"$(clipy history --tmux)
    CURSOR=${#BUFFER}
    zle redisplay
}
zle -N __clipy_history

# Bind the function to Ctrl+j
bindkey "^j" __clipy_history
$ source ~/.zshrc

Use the clipy command to start a background daemon. This daemon monitors your clipboard for new entries and saves them to the local sqlite database.

$ clipy

Access your clipboard history with the clipy history command. If you've set up the shell integration, you can invoke this with Ctrl + J for quick access.

$ clipy history 

Use the --limit option to specify the maximum number of entries to display initially.

$ clipy history --limit 100

If you're using tmux, you can display the history in a popup using tmux display-popup.

That's it! 🚀

Future Work or Idea

Sync Across Machines: Integrate with Litestream to sync clipboard history between machines seamlessly.

Clipboard Server: Run clipy as a centralized clipboard server to share and manage history across multiple devices.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(dbpath string) error

func GenerateShellScript

func GenerateShellScript(sh string)

func ListHistories

func ListHistories(dbPath string, limit int) error

func StopAllInstances

func StopAllInstances() error

Types

type Clipboard

type Clipboard struct {
	gorm.Model
	ClipText string
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(dbpath string) (*Repository, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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