clipmenu icon indicating copy to clipboard operation
clipmenu copied to clipboard

Add new clipcli to seperate clipboard management from dmenu

Open simonhughxyz opened this issue 4 years ago • 1 comments

So this is my improved solution to a a problem I solved in #161

I have added a new script called clipcli which handles the clipboard management. It has 2 commands

  • clipcli list: prints a list of clips.
  • clipcli get: retrieves a clip based on its input.

So you can build your own scripts using clipcli list | fzf | clipcli get

I think this is a better solution because I believe that the clipboard management should be independent of whatever menu of fuzzy finder you use.

I have converted clipmenu to use the new script but kept the cli of clipmenu the same for backwards compatibility, but I think it may be a good idea to depreciate it and introduce separate scripts for dmenu, fzf, rofi etc

This would allow people to build their own scripts more easily, as a possible suggestion you could have a new dir in this repo or another repo with user scrips people can publish.

This was made in a bit of a rush, so I might have missed some things.

simonhughxyz avatar Mar 26 '21 18:03 simonhughxyz

My appologies - did not look commits before writing what I did before. Finally - what's really missing, but could be there.

I thought, clipcli takes commands from stdin coninuously, but it's not. Imho, persistant daemon would be useful, moreover it's shell script, whose runing creates significant overhead.

Also - the most effective way could be if actual job was done by clipmenud, providing named pipe to control itself (enable/disable commands could also use this interface). In this case there would be no possible race from different cli accessing cache - clipmenud would do everything.

++ In later case all ui, including clipmenu, could talk to clipmenud cirectly, with clipcli being just one of them.

nick87720z avatar Feb 03 '22 08:02 nick87720z