• Stars
    star
    1,060
  • Rank 42,038 (Top 0.9 %)
  • Language
    C
  • License
    MIT License
  • Created over 10 years ago
  • Updated 24 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Clipboard management using dmenu

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.

More Repositories

1

srt

A simple library and set of tools for parsing, modifying, and composing SRT files.
Python
430
star
2

yturl

YouTube videos on the command line
Python
223
star
3

psi-notify

Alert when your machine is becoming oversaturated, *before* it slows to a crawl
C
218
star
4

clipnotify

Notify on new X clipboard events
C
216
star
5

sshrc

Bring your .bashrc, .vimrc, etc. with you when you ssh
Shell
198
star
6

tzupdate

Set the system timezone based on IP geolocation.
Rust
183
star
7

zcfan

A zero-configuration fan daemon for ThinkPads.
C
74
star
8

ansible-desktop

Ansible playbook for my personal machines.
Shell
70
star
9

dwm

Dynamic window manager for X (with extensive customisation)
C
53
star
10

passmenu

dmenu interface to the pass password manager
43
star
11

mack

An opinionated, fast music organiser.
Rust
36
star
12

dotfiles

My configuration files
Shell
28
star
13

gh-mirror

Mirror all GitHub repositories for a user, maintaining metadata.
Python
26
star
14

mpdmenu

dmenu frontend to MPD.
Shell
25
star
15

openvz-to-lxc

Script to migrate OpenVZ containers to LXC.
Shell
23
star
16

ansible-aur

An Ansible module for the pacaur and yaourt package managers.
Python
22
star
17

nota

Simple note taking using your $EDITOR and git
Shell
22
star
18

aur

Arch User Repository API interface.
Python
21
star
19

mac-cel

Remove mouse acceleration on Mac OSX
C
21
star
20

btmenu

Control bluetooth devices with dmenu
Shell
18
star
21

cellout

Battery status in the console (Linux only).
Awk
16
star
22

xinput-toggle

A simple xinput toggler for X11 systems
Shell
15
star
23

travis-automerge

A script to automerge successful builds to a branch
Shell
15
star
24

rebuild-debian-iso

Rebuild a Debian ISO with preseed/custom files.
Shell
10
star
25

osmo

Digital signage for minimalists.
JavaScript
8
star
26

geoip-http

GeoIP lookup server over HTTP.
Rust
7
star
27

exifrename

Rename image files based on EXIF data.
Rust
7
star
28

chrisdown.name

The files behind chrisdown.name.
CSS
6
star
29

mkdirmutex

A deadlock-resistant mkdir based mutex
Shell
6
star
30

pinyin

A small library to manipulate Hanyu Pinyin.
Python
5
star
31

gmute

Gmail mute support for mutt and other email clients
Python
5
star
32

battery-notify

A simple battery notifier for Linux.
Rust
4
star
33

stopthread

A small program to stop individual threads from executing, instead of the whole thread group.
C
4
star
34

icopng

Directly embed PNGs into ICO files without reencoding.
Rust
3
star
35

rtorrent-cookbook

Chef cookbook to set up an rtorrent service inside tmux.
Ruby
3
star
36

habitual

Send notifications for things on a fixed, repeated schedule
Python
3
star
37

pkgbuilds

AUR packages
Shell
3
star
38

kernel-misc

Tools and other things from kernel development
Shell
3
star
39

bats

Simple battery status tool
Shell
2
star
40

rym-export

Python
2
star
41

arch-install

A base install script for Arch Linux (base only, the rest is done by Ansible).
Shell
2
star
42

multidate

Print multiple timezones' dates/times with offsets from the local time.
Rust
2
star
43

filestruct

Derive macro to read from a directory into a Rust struct.
Rust
2
star
44

cargo-which-nightly

Find the latest Rust nightly with combinations of features present.
Rust
2
star
45

komootgpx

Extract a GPX from any Komoot route
Rust
2
star
46

linux

upstream, with my dev branches
C
1
star
47

torrentdiff

Compare files encapsulated by torrents in a directory to the actual files on disk
Python
1
star
48

todobg

Todo list on X root window
Shell
1
star
49

seedbox-cookbook

Chef cookbook to create a minimal seedbox
Ruby
1
star
50

ahk_scripts

AutoHotkey scripts to make Windows life more tolerable
AutoHotkey
1
star
51

whensthebus

Get live UK bus times on stdout
Python
1
star
52

funcfmt

A simple templating crate that allows passing in custom data to functions through function traits.
Rust
1
star
53

checkupdates-cron

A tiny wrapper around the Arch checkupdates script for use in a cronjob.
Shell
1
star
54

jingui

A simple password manager designed to adhere to the Unix philosophy.
Python
1
star
55

prompter

Simple and/or dumb work prompter
Shell
1
star
56

imurl

Downloads the images from imgur albums.
Python
1
star
57

toggledesktop

Isolate windowed games without showing the desktop
AutoHotkey
1
star
58

rawtojpg

Fast JPEG extractor from RAW files
Rust
1
star