3 # simple clipmenu wrapper
5 : "${CM_DIR="${XDG_RUNTIME_DIR-"${TMPDIR-/tmp}"}"}"
9 if ! imenu -c "enable clipboard management?"; then
12 iconf -i clipmanager 1
13 instantinstall clipmenu
15 pgrep -f clipmenud || clipmenud &
16 notify-send "enabling clipboard management, loading..."
18 echo "this menu will show recent clipboard entries" >"$cache_file"
19 echo "click on an entry to restore its contents" >>"$cache_file"
24 cache_dir=$CM_DIR/clipmenu.$major_version.$USER
25 cache_file=$cache_dir/line_cache
27 if [ "$1" = "delete" ]; then
28 if imenu -c "clear clipboard cache?"; then
30 echo "cache $cache_file"
31 echo "cleared" >"$cache_file"
36 [ -e "$cache_file" ] || enableclipmenu
37 CM_LAUNCHER=instantmenu clipmenu -p " " -q 'clipboard manager' -h -1 -lc "instantclipmenu delete"