clipmenu
clipmenu copied to clipboard
clipdel: Delete current clip
I'd like to have a feature in clipdel
to delete the current clip (first item of clipmenu
), so I wrote a WIP patch which deletes the current clip and sets the clipboard content to the next item. It currently works with clipdel -l
.
I'm opening this issue so we can discuss what's the best way to implement this feature.
While i think the use case is valid, i think it would make more sense to create a "Delete picker" (with dmenu
) as described in #57 since that would offer almost the same functionality.
Not really, since I wouldn't be able to delete the last clip by just invoking a shortcut combo.
The issue gave me some ideas to implement this together with a clipdelmenu, though. I'll try to hack something when I get some time to spare.
Yeah i guess ideally you could pass a number as a parameter for which item to delete and if no parameter is passed it asks interactively.
For the interactive mode one could even (for rofi users) use rofi's multi-select.
Yeah i guess ideally you could pass a number as a parameter for which item to delete and if no parameter is passed it asks interactively.
I'm not sure about that, as there's no indication of which number corresponds to an entry.
For the interactive mode one could even (for rofi users) use rofi's multi-select.
Yeap, that'll totally be possible.
I'm not sure about that, as there's no indication of which number corresponds to an entry.
Well i would say in the order of the history: 1
being the last item copied, 2
the one before that etc.
Well i would say in the order of the history: 1 being the last item copied, 2 the one before that etc.
Sure, but what's the use case?
The only way to know a entry's position is by running clip{,del}menu
interactively, and even there there's no way to tell what's the associated number without counting.
I only thought of your use case: deleting the last element
I was actually thinking of implementing it like clipdel --current
.
But don't get me wrong, I'm all in for something like clipdel --entries 1 3-6
, but I'm not sure that would be useful with the way clipmenu
works.
@cdown have you thought of adding numbers in front of the entries in clipmenu
?
Something like:
------------------------------------------------------
| clipmenu: |
------------------------------------------------------
| [1] First entry |
| [2] Second entry |
| [3] A very very very very long entry... (12 lines) |
| [4] Lorem ipsum |
| [5] Dolor sit amet |
------------------------------------------------------
I guess you're right, i don't really see a reason to automate deleting any other but the last copied entry
I use something like this in the clipmenu script when I start it with a flag but I agree is not necessary.
rm_line=$(cut -d' ' -f2- "$cache_file" | grep -Fxn "$chosen_line" | cut -d':' -f1 | sed 's/$/d/' | paste -sd';')
sed -i "${rm_line}" "$cache_file"
rm -f "$file"
I guess you're right, i don't really see a reason to automate deleting any other but the last copied entry
Passwords, copied to clipboard on a timeout (for example, pass
defaults to 45s) - you might copy something else in that time; the password manager wants to delete a known value, wherever it appears in order.
Edit - sorry, nevermind, I misread and there already is a clipdel
, with exactly ^ that (and more general, with regex) behaviour.
@cdown bumping this up since I too use pass
with clipmenu
, and don't want my password lingering in the clipboard. Would you accept a PR for this?