Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cursor Clip - GTK4 Clipboard Manager with dynamic positioning. Features a Windows 11–style clipboard history, adapted to native GNOME design.

License

Notifications You must be signed in to change notification settings

Tomakin/cursor-clip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cursor Clip - GTK4 Clipboard Manager with Dynamic Positioning

A modern Wayland clipboard manager built with Rust, GTK4, Libadwaita, and Wayland Layer Shell that makes clipboard handling more reliable. Features a Windows 11–style clipboard history interface with native GNOME design, which is always positioned at the current mouse pointer location.

Features

Overlay Preview

📋 Windows 11-Style Clipboard History

  • Clean list interface: Similar to Windows 11 clipboard history
  • Content type indicators: Icons for text, URLs, code, files, etc.
  • Rich previews: Formatted content display with truncation
  • Timestamps: When each item was copied
  • Quick selection: Click any item to copy it back to the clipboard

🖱️ Advanced Wayland Integration

  • Layer Shell Protocol: Proper overlay positioning above all windows
  • Precise Cursor Tracking: Real-time mouse position detection
  • Multi-output Support: Works across multiple monitors

🎨 Native GNOME Design

  • Libadwaita styling: Follows GNOME Human Interface Guidelines
  • Native widgets: HeaderBar, ListBox, ScrolledWindow

📂 Automatic Clipboard Monitoring (Wayland)

  • Stores the last 100 copied items and removes duplicates.
  • Automatic classification of content types:
    • 📝 Text
    • 🔗 URLs
    • 💻 Code
    • 🔒 Passwords
    • 📁 File paths
    • 🖼️ Images

🎥 Video Showcase

Showcase-Cursor-Clip.mp4

Compositor Support

  • The backend supports both zwlr_data_control_manager_v1 (wlroots) and ext_data_control_manager_v1 (standard) protocols for clipboard access, automatically selecting the available protocol.

  • The frontend uses zwlr_layer_shell_v1 to retrieve pointer coordinates and show the overlay.

  • Supported compositors:

    • KDE Plasma 6 (Wayland session) - uses ext_data_control_manager_v1
    • Hyprland - uses zwlr_data_control_manager_v1
    • Sway - uses zwlr_data_control_manager_v1
    • niri - uses zwlr_data_control_manager_v1
    • Labwc - uses zwlr_data_control_manager_v1
    • Other wlroots-based compositors - uses zwlr_data_control_manager_v1
  • Although the application uses GNOME styling and follows the GNOME HIG, GNOME Shell is unfortunately NOT SUPPORTED. It does not implement the required Wayland protocols (zwlr_layer_shell_v1 and clipboard access protocols) needed for Cursor Clip's key features. Future support is not impossible but will require major code and workflow changes and a separate GNOME Extension.

System Requirements

  • Wayland compositor, GTK4, gtk4-layer-shell, libadwaita, Rust

Installation on Arch Linux based distributions via AUR

You can install Cursor Clip from the AUR using an AUR helper like yay:

yay -S cursor-clip-git

Manual Building

Install Dependencies

Arch Linux:

sudo pacman -S gtk4 libadwaita gtk4-layer-shell

Ubuntu/Debian:

sudo apt update
sudo apt install build-essential pkg-config libgtk-4-dev libadwaita-1-dev gtk4-layer-shell

Fedora:

sudo dnf install gtk4-devel libadwaita-devel gtk4-layer-shell

Download and Compile

# Clone the repository
git clone https://github.com/Sirulex/cursor-clip
cd cursor-clip

# Build in release mode
cargo build --release

Usage

  1. Start Background Daemon: cursor-clip --daemon
  2. Launch Overlay: Run cursor-clip without any arguments (ideally bind it to a hotkey, e.g., Super+V)
  3. Trigger: Your mouse position is automatically captured
  4. View History: The clipboard history window will appear at your cursor position, showing:
    • Recent clipboard items with content previews
    • Content type icons (text, URL, code, password, file)
    • Timestamps showing when items were copied
    • Quick actions: Clear All and Close
  5. Interact:
    • Click any item to copy it back to the clipboard
    • Scroll through your clipboard history
    • Clear All to remove all history items
    • Keyboard navigation: Use arrow keys or J/K to navigate, Enter to select, Esc to close

Key Components

┌─────────────────────────────────────────────────┐
│                 Cursor Clip                     │
├─────────────────────────────────────────────────┤
│  GTK4 + Libadwaita UI Layer                     │
│  ├── Modern styling with CSS                    │
│  ├── Responsive layouts                         │
│  └── Accessibility features                     │
├─────────────────────────────────────────────────┤
│  Wayland Layer Shell Integration                │
│  ├── zwlr_layer_shell_v1 protocol               │
│  ├── Positioning and anchoring                  │
│  └── Overlay layer management                   │
├─────────────────────────────────────────────────┤
│  Clipboard Management                           │
│  ├── Data Control Manager for privileged access │
│  ├── IPC communication via UNIX domain sockets  │
│  └── IndexMap for clipboard history storage     │
└─────────────────────────────────────────────────┘

Dependencies

Core Libraries

  • GTK4 (0.10): Modern UI toolkit
  • Libadwaita (0.8): GNOME's design system
  • gtk4-layer-shell (0.6): Wayland layer shell integration
  • wayland-client (0.31): Wayland protocol bindings
  • wayland-protocols (0.32): Extended Wayland protocols
  • wayland-protocols-wlr (0.3.9): wlroots-specific Wayland protocols
  • Tokio runtime (1.47): Asynchronous runtime
  • serde (1.0): Serialization framework
  • indexmap (2.11): Ordered map for clipboard history
  • env_logger (0.11): Logging framework

Built with ❤️ using Rust, GTK4, Libadwaita, and Wayland Layer Shell

Support

If you find this project useful and would like to support its development, consider sponsoring me on GitHub or Ko-fi. Your support helps me dedicate more time to improving and maintaining Cursor Clip.

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for the full text.

About

Cursor Clip - GTK4 Clipboard Manager with dynamic positioning. Features a Windows 11–style clipboard history, adapted to native GNOME design.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%