2023-11-02 16:17:33 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, libX11
|
|
|
|
, libXi
|
|
|
|
, libXtst
|
|
|
|
, libevdev
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "mouse-actions";
|
2024-08-10 23:13:27 +01:00
|
|
|
version = "0.4.5";
|
2023-11-02 16:17:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jersou";
|
|
|
|
repo = "mouse-actions";
|
|
|
|
rev = "v${version}";
|
2024-08-10 23:13:27 +01:00
|
|
|
hash = "sha256-44F4CdsDHuN2FuijnpfmoFy4a/eAbYOoBYijl9mOctg=";
|
2023-11-02 16:17:33 +00:00
|
|
|
};
|
|
|
|
|
2024-08-10 23:13:27 +01:00
|
|
|
cargoHash = "sha256-N7BaEvQyKtM8hkDJJTlFKzfq01KMiGZ0fuXHcKctfLc=";
|
2023-11-02 16:17:33 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
libXi
|
|
|
|
libXtst
|
|
|
|
libevdev
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/etc/udev/rules.d/
|
|
|
|
echo 'KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' >> $out/etc/udev/rules.d/80-mouse-actions.rules
|
|
|
|
echo 'KERNEL=="/dev/input/event*", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' >> $out/etc/udev/rules.d/80-mouse-actions.rules
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Execute commands from mouse events such as clicks/wheel on the side/corners of the screen, or drawing shapes";
|
|
|
|
homepage = "https://github.com/jersou/mouse-actions";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ rgri ];
|
|
|
|
mainProgram = "mouse-actions";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|