Coder Social home page Coder Social logo

xclipmenu's Introduction

clipmenu is a simple clipboard manager using dmenu (or rofi with CM_LAUNCHER=rofi) and xsel.

Demo

Demo

Usage

clipmenud

Start clipmenud, then run clipmenu to select something to put on the clipboard. For systemd users, a user service called clipmenud is packaged as part of the project.

For those using a systemd unit and not using a desktop environment which does it automatically, you must import $DISPLAY so that clipmenud knows which X server to use. For example, in your ~/.xinitrc do this prior to launching clipmenud:

systemctl --user import-environment DISPLAY

clipmenu

You may wish to bind a shortcut in your window manager to launch clipmenu.

All args passed to clipmenu are transparently dispatched to dmenu. That is, if you usually call dmenu with args to set colours and other properties, you can invoke clipmenu in exactly the same way to get the same effect, like so:

clipmenu -i -fn Terminus:size=8 -nb '#002b36' -nf '#839496' -sb '#073642' -sf '#93a1a1'

For a full list of environment variables that clipmenud can take, please see clipmenud --help.

Features

The behavior of clipmenud can be customized through environment variables. Despite being only <300 lines, clipmenu has many useful features, including:

  • Customising the maximum number of clips stored (default 1000)
  • Disabling clip collection temporarily with clipctl disable, reenabling with clipctl enable
  • Not storing clipboard changes from certain applications, like password managers
  • Taking direct ownership of the clipboard
  • ...and much more.

Check clipmenud --help to view all possible environment variables and what they do. If you manage clipmenud with systemd, you can override the defaults by using systemctl --user edit clipmenud to generate an override file.

Supported launchers

Any dmenu-compliant application will work, but here are CM_LAUNCHER configurations that are known to work:

Installation

Several distributions, including Arch and Nix, provide clipmenu as an official package called clipmenu.

Manual installation

If your distribution doesn't provide a package, you can manually install using make install (or better yet, create a package for your distribution!). You will need xsel and clipnotify installed, and also dmenu unless you plan to use a different launcher.

How does it work?

clipmenud is less than 300 lines, and clipmenu is less than 100, so hopefully it should be fairly self-explanatory. However, at the most basic level:

clipmenud

  1. clipmenud uses clipnotify to wait for new clipboard events.
  2. If clipmenud detects changes to the clipboard contents, it writes them out to the cache directory and an index using a hash as the filename.

clipmenu

  1. clipmenu reads the index to find all available clips.
  2. dmenu is executed to allow the user to select a clip.
  3. After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.

xclipmenu's People

Contributors

cdown avatar ugly-custard avatar mehw avatar ferki avatar kankaristo avatar gravemind avatar markstos avatar sohalt avatar 9ary avatar rx14 avatar mic92 avatar navneetankur avatar bobrippling avatar foxxx0 avatar jb55 avatar drake-on-mandrake avatar kesha-on-disc avatar

Stargazers

Yash Raj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.