GPaste

KeruspeBSD-2-Clause活跃维护

基于 C 语言开发的剪贴板管理工具,能记录历史复制内容并支持搜索、分类和快速粘贴,适合需要频繁复用文本片段的桌面用户。

Clipboard management system

暂无版本963star +1 / 7 天71fork同步于 2026-11-10 17:54 UTC

怎么上手

由 README 提炼,执行前请确认
sudo apt install gpaste-2 gnome-shell-extension-gpaste
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

GNOME 剪贴板管理守护进程,记住你复制过的内容并随时取回

基于 C 语言开发的剪贴板管理工具,能记录历史复制内容并支持搜索、分类和快速粘贴,适合需要频繁复用文本片段的桌面用户。

核心能力

  • 跨会话持久保存多条命名历史,可独立切换备份删除
  • 支持纯文本、富文本、HTML、图片、URI 和颜色
  • 可选 libsodium 加密历史,口令可存入密钥环
  • 存储后端可插拔:XML 文件、SQLite 或完全不存
  • 密码条目以名称显示并支持超时失效,收藏项不被淘汰

容易踩的坑

Ubuntu 仓库版本落后多个大版本,需要新功能建议用 Debian unstable 或源码编译;源码编译要求 GLib 2.90、GTK 4.24、libadwaita 1.10,Debian 系需自行编译 libadwaita;安装后需在扩展应用中手动启用 GNOME Shell 扩展;升级后需执行 gpaste-client daemon-reexec 重启守护进程

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    GPaste

    GPaste is a clipboard management system for GNOME: a daemon that remembers what you copy, plus a GTK 4 interface, a GNOME Shell extension and a CLI to get it back.

    New to the idea? This post explains what clipboard managers are for.

    Features

    • Persistent history across sessions, with several named histories you can switch between, back up and delete independently.
    • Everything you copy: plain text, rich text and HTML, images (de-duplicated by checksum, kept as files or as database blobs depending on the storage backend), URIs and colours.
    • Encryption at rest — an optional libsodium-backed history, with the passphrase optionally kept in the keyring.
    • Pluggable storage: an XML file, a per-history SQLite database that persists incrementally, or nothing at all. Switch at any time from the preferences or with gpaste-client migrate.
    • Passwords: mark an item as a password to have it shown as a name instead of its contents, and excluded from the plain-text history. Give it a timeout and the clipboard stops handing it out once that runs out. A text a password manager marks as a secret (KDE's x-kde-passwordManagerHint) is taken in as a password on its own, and GPaste marks the passwords it puts on the clipboard the same way, so other clipboard managers can recognise them. Current GTK advertises the marker on X11 but cannot serve its value, so other managers may not recognise GPaste passwords there. Deleting a password entry clears its selection, including after a rename; a separate named entry with the same value is kept distinct.
    • Favourites: pin an item and the history never drops it on its own — the size and memory limits give way instead. Filter the list down to the pinned items from the UI, the extension or gpaste-client --favourites.
    • Search, merge and edit items from the UI, the extension or the CLI.
    • GNOME Shell integration through a native extension, whose menu names the history in use and switches to, creates, empties, backs up or deletes one, with an optional experimental mode that runs the daemon inside the Shell itself.
    • Global shortcuts through the XDG portal, so they work the same on Wayland and X11, and one switch in the preferences turns every one of them off.

    Installation

    Fedora

    sudo dnf install gpaste gpaste-ui gnome-shell-extension-gpaste
    

    Arch Linux

    sudo pacman -S gpaste
    

    One package: it ships the daemon, the graphical tool and the extension together.

    Debian and Ubuntu

    sudo apt install gpaste-2 gnome-shell-extension-gpaste
    

    The digit tracks the library API version, so it becomes gpaste-3 once this release lands. Ubuntu's copy lives in universe and lags a long way behind — several major versions, even on the current LTS — while Debian unstable keeps up.

    openSUSE

    sudo zypper install gpaste
    

    Elsewhere

    GPaste is packaged in plenty of other distributions — Alpine, nixpkgs, Void and Gentoo among them. Repology tracks which version each one ships.

    Wherever it came from, enable the extension in the Extensions app once it is installed.

    From source

    On Fedora and other rpm-based distributions:

    # Build dependencies
    sudo dnf install meson ninja-build gcc gettext-devel \
                     glib2-devel gtk4-devel libadwaita-devel gcr-devel \
                     libXfixes-devel dbus-devel gnome-control-center \
                     gobject-introspection-devel vala mutter-devel
    
    # Optional, but on by default when found
    sudo dnf install libsodium-devel sqlite-devel libsecret-devel \
                     libpwquality-devel
    

    On Debian, Ubuntu and other deb-based distributions:

    # Build dependencies
    sudo apt install meson ninja-build build-essential pkg-config gettext \
                     libglib2.0-dev libgtk-4-dev libadwaita-1-dev libgcr-4-dev \
                     libxfixes-dev libdbus-1-dev systemd-dev gnome-control-center-dev \
                     gobject-introspection libgirepository1.0-dev valac
    # and the libmutter-N-dev of the mutter GNOME Shell runs on
    
    # Optional, but on by default when found
    sudo apt install libsodium-dev libsqlite3-dev libsecret-1-dev libpwquality-dev
    

    mutter is wanted for the GNOME Shell extension and the clipboard backend it hosts, gobject-introspection for the typelibs the extension loads and for the bindings, and vala for the Vala ones: -Dgnome-shell=false -Dintrospection=false -Dvapi=false builds without all three, and without the extension and the bindings. dbus, systemd and gnome-control-center are wanted for their pkg-config files alone, which say where the D-Bus service and interface files, the systemd user unit and the control-center keybinding files go. Fedora ships systemd's in the base package, which is why only the apt line names it, and Debian ships gnome-control-center's in its -dev package. A packager who would rather not pull any of them in can name the four directories outright — -Ddbus-services-dir, -Ddbus-interfaces-dir, -Dsystemd-user-unit-dir and -Dcontrol-center-keybindings-dir — and dbus and gnome-control-center are still needed at runtime either way.

    Then, wherever you are:

    git clone https://github.com/Keruspe/GPaste.git
    cd GPaste
    meson setup build --prefix=/usr
    ninja -C build
    sudo ninja -C build install
    sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
    

    --prefix=/usr puts GPaste where the system looks for it: under meson's default /usr/local, distributions like Fedora find neither its libraries nor its typelibs, and the schemas compiled above would be another directory's.

    GPaste currently needs GLib 2.90, GTK 4.24, libadwaita 1.10, gcr 4 and Meson 1.9. That libadwaita is newer than anything Debian ships outside experimental, so a deb-based build of the 51 series needs one built by hand.

    Build options

    Pass these to meson setup (or meson configure build) as -Doption=value. The feature ones default to auto: enabled when the dependency is present, skipped otherwise.

    OptionDefaultWhat it controls
    encryptionautolibsodium-based history encryption
    sqliteautothe SQLite storage backends (needs SQLite ≥ 3.35)
    libsecretautoremember the encryption passphrase in the keyring (needs encryption)
    pwqualityautorate a passphrase or a password as it is typed
    gnome-shelltruethe GNOME Shell extension and the mutter clipboard backend (requires introspection)
    introspectiontrueGIR data
    vapitrueVala bindings (requires introspection)
    systemdtruethe systemd user unit
    bash-completion, zsh-completion, fish-completiontrueshell completions

    For a minimal build:

    meson setup build -Dgnome-shell=false -Dintrospection=false -Dvapi=false
    

    Usage

    Default shortcuts

    ShortcutAction
    Ctrl+Alt+HShow the history
    Ctrl+Alt+GLaunch the graphical tool
    Ctrl+Alt+VPop the first item off the history
    Ctrl+Alt+SMark the active item as a password, if it is a text one
    Ctrl+Alt+OSync the clipboard to the primary selection
    Ctrl+Alt+PSync the primary selection to the clipboard
    Ctrl+Alt+UUpload the active item to a pastebin, if it is a text one

    All of them are configurable in the preferences.

    Uploading runs whatever the upload-command preference names, defaulting to curl -sS --data-binary @- https://paste.c-net.org/. Any command that takes the item on its standard input and answers the url on its standard output will do — wgetpaste, pastebinit and nc termbin.com 9999 among them.

    Inside the graphical tool, which has a few of its own:

    ShortcutAction
    Ctrl+FSearch the history
    Ctrl+NAdd a new item
    Ctrl+Shift+NAdd a new password
    Ctrl+0…9Paste the item at that index
    DeleteDelete the history focused in the sidebar
    Ctrl+,Show the preferences
    Ctrl+?Show the keyboard shortcuts
    Ctrl+W or EscClose the window
    Menu or Shift+F10Open the selected item's menu

    Command line

    gpaste-client                       # print the history
    gpaste-client --oneline --use-index # ... one line per item, numbered
    gpaste-client search <pattern>      # print matching items
    gpaste-client select <uuid>         # put an item back in the clipboard
    gpaste-client add <text>            # copy some text
    echo hello | gpaste-client          # copy from a pipe
    gpaste-client file <path>           # copy a file's contents
    gpaste-client delete <uuid>         # forget one item
    gpaste-client empty                 # forget everything
    
    gpaste-client ui                    # open the graphical tool
    gpaste-client preferences           # open the settings
    gpaste-client migrate               # switch storage backend
    gpaste-client change-passphrase     # re-key an encrypted history
    gpaste-client doctor                # check the stored histories, putting right what can be
    

    gpaste-client help lists every subcommand; see also man gpaste-client.

    Items are addressed by UUID by default. Pass --use-index to use their position in the history instead, starting at zero: --use-index merge 0 1 2 merges the first three items. Indexes must be unsigned decimal numbers. Text, search patterns, paths and history names keep their usual meaning.

    After upgrading

    Restart the daemon so the new version takes over:

    gpaste-client daemon-reexec
    gpaste-client daemon-version   # confirm which one is running
    

    Development

    Three libraries are installed, each with its own pkg-config file, headers and GIR, and a VAPI for gpaste-3 and gpaste-gtk4:

    Librarypkg-configGIRContents
    libgpaste-3gpaste-3GPaste-3Core objects, settings, and the D-Bus client for the daemon
    libgpaste-daemongpaste-daemonGPasteDaemon-1The clipboard item hierarchy, the history and the storage backends
    libgpaste-gtk4gpaste-gtk4GPasteGtk-4GTK 4 / libadwaita widgets and helpers

    Each has a single umbrella header — <gpaste.h>, <gpaste-daemon.h> and <gpaste-gtk4.h> — which is the only one you may include directly.

    Run the test suite from the build directory:

    ninja -C build test
    

    Each C test binary runs on its own in-memory settings and private D-Bus, so it needs dbus-daemon; a supervisor reaps that bus even if a test crashes. The UI tests open their windows on a private Xvfb and are skipped without it. The GNOME Shell extension's JavaScript tests (tests/gnome-shell/) run its modules under Node.js with actor and bus doubles: the menu, its rows and their actions, the history switcher, the tracking switch, the storage prompt, the in-shell daemon's runner and the extension's own enable and disable. They are omitted when Node.js is unavailable and touch no settings, bus or display. None of the tests touches the desktop session.

    AGENTS.md documents the coding style and repository conventions in more detail, and each part of the tree has an AGENTS.md of its own beside its code.

    Contributing

    Bug reports and patches are welcome on GitHub.

    Translations go through Weblate, which credits every translator on the project page.

    GPaste is what a hundred or so people have made it: thanks to everyone who has contributed.

    Supporting GPaste

    GPaste is developed in my spare time. If it is useful to you, you can support its development through GitHub Sponsors, or through PayPal if you are not on GitHub.

    Releases

    The latest release for GNOME 51 is GPaste 51.3 (tarball).

    Release announcements and everything else about GPaste are on my blog. See NEWS for the full changelog.