NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.14k stars 14.17k forks source link

Package request: mouse-actions #264904

Closed waldman closed 9 months ago

waldman commented 1 year ago

Project description

mouse-actions allows to execute some commands from mouse events such as:

Metadata

rgri commented 1 year ago

Hi, I don't know how to contribute to nixpkgs yet so I made a flake with a working default.nix. For anyone who is curious while I read up on submitting a package, here is what I'm doing:

{ lib, fetchFromGitHub, rustPlatform, pkg-config, virtualgl, xorg, libevdev }:
rustPlatform.buildRustPackage rec {
  pname = "mouse-actions";
  version = "v0.4.4";

  src = fetchFromGitHub {
    owner = "jersou";
    repo = pname;
    rev = version;
    hash = "sha256-02E4HrKIoBV3qZPVH6Tjz9Bv/mh5C8amO1Ilmd+YO5g=";
  };
  cargoHash = "sha256-GRClGC6+3J/YW5jVh7iAb2idD6/PycG854XbBIkfB/c=";
  buildInputs = [ xorg.libX11 xorg.libXi xorg.libXtst libevdev ];
  nativeBuildInputs = [ pkg-config virtualgl ];
  meta = with lib; {
    # TODO: better description
    description =
      "A way to execute some commands from mouse events, a mix between Easystroke and Comiz edge commands";
    homepage = "https://github.com/BurntSushi/ripgrep";
    # TODO: license
    license = licenses.unlicense;
    # TODO: how to add myself as a maintainer? (rgri)
    maintainers = [ ];
  };
}

Criticism is of course welcome.

jfvillablanca commented 1 year ago

Hi, I don't know how to contribute to nixpkgs yet so I made a flake with a working default.nix. For anyone who is curious while I read up on submitting a package, here is what I'm doing:

{ lib, fetchFromGitHub, rustPlatform, pkg-config, virtualgl, xorg, libevdev }:
rustPlatform.buildRustPackage rec {
  pname = "mouse-actions";
  version = "v0.4.4";

  src = fetchFromGitHub {
    owner = "jersou";
    repo = pname;
    rev = version;
    hash = "sha256-02E4HrKIoBV3qZPVH6Tjz9Bv/mh5C8amO1Ilmd+YO5g=";
  };
  cargoHash = "sha256-GRClGC6+3J/YW5jVh7iAb2idD6/PycG854XbBIkfB/c=";
  buildInputs = [ xorg.libX11 xorg.libXi xorg.libXtst libevdev ];
  nativeBuildInputs = [ pkg-config virtualgl ];
  meta = with lib; {
    # TODO: better description
    description =
      "A way to execute some commands from mouse events, a mix between Easystroke and Comiz edge commands";
    homepage = "https://github.com/BurntSushi/ripgrep";
    # TODO: license
    license = licenses.unlicense;
    # TODO: how to add myself as a maintainer? (rgri)
    maintainers = [ ];
  };
}

Criticism is of course welcome.

Use repo = "mouse-actions" since pname and repo are semantically different.

with regards to the meta info, you can use the upstream's meta info

and add yourself to the maintainer list and make a separate commit for that here are the docs then put your name on the meta.maintainers of that package. you should be able to build the package if you added your name to the maintainer list

then on your pull request, the commits would include you adding yourself to the maintainers and the nix expression for the package

check the docs for more info and feel free to ask more questions

rgri commented 1 year ago

Thanks for the advice! I've tried to follow all of it- I've opened #265056.

waldman commented 1 year ago

Guys, question... in order to request the mouse-actions-gui should I create a new request?

rgri commented 1 year ago

I don't have the answer to that, maybe someone else can comment on the precedent. Besides that, @waldman do you have a workflow/config using mouse-actions that can be used to test functionality? I had to write some udev rules to make it work (it is almost ready for merge).

waldman commented 1 year ago

I use the "Mouse Gestures" functionality A LOT for tab management on my browsers:

Problem is that I believe on this app is almost impossible to craft the settings above on the configuration file without the GUI.

I used easystroke - https://github.com/thjaeger/easystroke - for this for almost 10 years but now it's deprecated in favor of mouse-actions, so I don't have a working config... =(

teto commented 1 year ago

can anyone comment about mouse-action and waylant compatibility ? the readme says it works in degraded mode but not sure how what that means

rgri commented 9 months ago

Closing with the merge of #265056.