cdown / clipmenu

Clipboard management using dmenu
MIT License
1.11k stars 90 forks source link

Clipmenu not work after delete clipboard with 'clipdel' #133

Closed CSaratakij closed 4 years ago

CSaratakij commented 4 years ago

Setup

Step to Reproduce

  1. Start clipmenud with systemd
    systemctl --user start clipmenud.service
  2. Copy some random text and try to list clipboard with clipmenu. It will work just fine.
  3. Clear clipboard with command
    clipdel -d '.*'
  4. Copy some random text again.
  5. Clipmenu just stop working, cannot list any text.

Workaround

I have to restart clipmenud service after clear clipboard with clipdel to make clipmenu work again.

systemctl --user restart clipmenud.service

More Explain

Since I use $XDG_RUNTIME_DIR as a temp dir, seems like clipmenud create a temp directory in "/run/user/1000" with necessary temp file in the directory name "clipmenu.6.csaratakij" This is my absolute path to temp dir : "/run/user/1000/clipmenu.6.csaratakij" . But once I clear clipboard with clipdel, It remove "clipmenu.6.csaratakij" directory and any attempt to create temp files inside this directory will not works since this directory is no longer exists. That's why clipmenu keep complaining the 'line_cache" file does not exists I guess? . Once I restart clipmenud with systemd, It will create "clipmenu.6.csaratakij" directory and everything will work again. .

Possible Solution

Just remove all contents inside temp dir or create temp dir if not exists before trying to create any temp file when using clipdel?

CSaratakij commented 4 years ago

Actually, mybad. I will use clipdel -d "\w" instead. It will not nuke my temp dir.

cdown commented 4 years ago

This is actually a bug, we should be recreating it. Thanks for the report.