cdown / clipmenu

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

Clean duplicates in clipmenu list (solved) #28

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi, I find myself copying same stuff over and over and this fills my list, so I'm wondering if it's possible to implement a removal of duplicates and keep only latest timestamped copy. I'm using "fdupes -qdN /../tmp/clipmenu.user/" and this works as long I exec it standalone, but not inside clipmenud - it keeps the oldest copy not the newest, (I'll take this up with fdupes dev to delete by timestamp). But maybe there is a nicer way doing this?

ghost commented 8 years ago

Ops forgot to close this. My solution was to build fdupes from master which includes time sort and not using distro repo. define fdupes=$(/usr/local/bin/fdupes2 -o time -idNq /media/backup/tmp/clipmenu.$USER/) then inserting it in chosen_line=$($fdupes; printf '%s\n' "${ordered_selections[@]}" ...