clipmenu

cli clipboard manager

clipmenud


#!/bin/bash

cache_dir=/tmp/clipmenu/
mkdir -p "$cache_dir"

while sleep 1; do
    for selection in clipboard primary; do
        data=$(xsel --"$selection"; printf x)
        data=${data%x}

        [[ $data ]] || continue

        md5=$(md5sum <<< "$data")
        md5=${md5%% *}

        printf '%s' "$data" > "$cache_dir/$md5"
    done
done

Download

raw zip tar