Skip to content

Aposykenn/Clipboard-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electron Clipboard Manager

A lightweight, real-time clipboard history manager built with Electron. This application monitors your system clipboard and maintains a history of copied texts, images, and file paths.

🚀 Features

  • Real-time Monitoring: Checks the clipboard every second for new content.
  • Format Support:
  • Text: Stores and displays plain text.
    • Images: Detects copied images, displays a preview, and allows re-copying as binary image data (not just Base64 strings).
    • Files: Correctly handles file paths (Windows FileNameW support), decoding UTF-16 LE characters to prevent mojibake (broken characters).
    • Click-to-Copy: Click on any item in the history to restore it to the system clipboard.
  • Safe Execution: Uses ContextIsolation and IPC bridges for security.

🛠️ Installation

  1. Clone the repository (or download the source code):
   git clone https://github.com/yourusername/clipboard-manager.git
   cd clipboard-manager
  1. Install dependencies: You need Node.js installed. Then run:
   npm install

(Note: You need electron in your package.json)

  1. Start the application:
   npm start

📂 Project Structure

  • main.js: The entry point. Handles the app window, clipboard reading (decoding file buffers, reading images), and writing back to the clipboard via IPC.
  • preload.js: The bridge between the secure main process and the frontend renderer. Exposes a safe API (electronAPI).
  • renderer.js: Handles the UI logic, displaying items, and sending click events back to the main process.
  • index.html: The layout of the application.

🐛 Technical Details & Troubleshooting

File Path Encoding (Windows)

Windows stores file paths in the clipboard using the FileNameW format (UTF-16 LE). Standard string conversion results in "mojibake" (squares/symbols). This app correctly decodes the buffer using ucs2 and strips null bytes to get the clean file path.

Image Copying

When clicking a history item to re-copy an image, the app uses Electron's nativeImage to write actual image data to the clipboard, ensuring it can be pasted into applications like Photoshop, Discord, or Slack (instead of just pasting a text URL).

📝 Usage

  1. Run the app.
  2. Copy anything (Text, an Image from the web/disk, or a File in File Explorer).
  3. The item will appear in the app window.
  4. Click any previous item to copy it back to your clipboard.

📄 License

MIT

About

A lightweight Electron-based clipboard manager that monitors your system clipboard and maintains a real-time history of copied texts, images, and file paths with one-click restore functionality.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors