Giter Club home page Giter Club logo

Comments (7)

PurpleMyst avatar PurpleMyst commented on May 27, 2024 1

I'm willing to work on this.

from hoard.

PurpleMyst avatar PurpleMyst commented on May 27, 2024 1

Sounds good! I'll work on this in the coming days. Progress might be a bit slow as I'm very busy.

from hoard.

PurpleMyst avatar PurpleMyst commented on May 27, 2024

I'd love to get some more specification: Where do you want me to copy to the clipboard? In which subcommands?

from hoard.

Hyde46 avatar Hyde46 commented on May 27, 2024

Excited that you're interested in this issue!

I think this first needs some research on how to approach this properly.
The goal would be threefold:

  • The subcommand pick sends the string for the found command to the clipboard of the used operating system instead of just printing it to the console.

For the next two, its good to know that hoard can be installed as a shell plugin, which runs hoard list when called.
When running as a shell plugin, and selecting a command ( With the enter key ) in the GUI, your shell prompt will automatically be filled with the selected command. However, I have not found a way yet to replicate this functionality when the program is not ran as a shell plugin.
Thus:

  • When running hoard list as a shell plugin, copy a command into the clipboard by a (new) shortcut like <CTRL>y. See here for exemplary key handler events.
  • When running hoard list not as a shell plugin, support the previous way to send a command to the clipboard, but also when pressing enter do the same

The logic for the last two of actually sending a string to the clipboard can be handled after the hoard list subprocess is finished here.
Feel free to refactor this into a sperate file handling clipboard stuff

A final point on the clipboard support. hoard is expected to run on linux and mac. So, the clipboard handler should be capable to handle x11, wayland and whowever mac is doing it. This crate seems to lead the right way.
Also, this means the way of installing hoard has to be reconsidered, as a system level library will be a dependency. Either that, or we programatically check if the right libraries are installed and only support this feature if they are present.

Any thoughts on this? I'm open for any suggestion if you have some!

from hoard.

PurpleMyst avatar PurpleMyst commented on May 27, 2024

I think that looks good.

So, in short:

  • Support ^y to copy a command to the clipboard in hoard list
  • Also copy a command to the clipboard automatically if enter is pressed while we're not in shell-plugin mode.
  • hoard pick still prints to the console but also copies to the clipboard.

from hoard.

Hyde46 avatar Hyde46 commented on May 27, 2024

Sounds good!
Ill then take care to update the installers making sure the necessary dependencies are met for however you will will implement the clipboards

from hoard.

Hyde46 avatar Hyde46 commented on May 27, 2024

Absolutely no worries, take the time you need for it !
Glad you're interested in contributing

from hoard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.