-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265056 from rgri/init-mouse-actions
mouse-actions: init at 0.4.4
- Loading branch information
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15824,6 +15824,11 @@ | |
githubId = 811827; | ||
name = "Gabriel Lievano"; | ||
}; | ||
rgri = { | ||
name = "shortcut"; | ||
github = "rgri"; | ||
githubId = 45253749; | ||
}; | ||
rgrinberg = { | ||
name = "Rudi Grinberg"; | ||
email = "[email protected]"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
let | ||
cfg = config.programs.mouse-actions; | ||
in | ||
{ | ||
options.programs.mouse-actions = { | ||
enable = lib.mkEnableOption '' | ||
mouse-actions udev rules. This is a prerequisite for using mouse-actions without being root. | ||
''; | ||
}; | ||
config = lib.mkIf cfg.enable { | ||
services.udev.packages = [ pkgs.mouse-actions ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, rustPlatform | ||
, pkg-config | ||
, libX11 | ||
, libXi | ||
, libXtst | ||
, libevdev | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "mouse-actions"; | ||
version = "0.4.4"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "jersou"; | ||
repo = "mouse-actions"; | ||
rev = "v${version}"; | ||
hash = "sha256-02E4HrKIoBV3qZPVH6Tjz9Bv/mh5C8amO1Ilmd+YO5g="; | ||
}; | ||
|
||
cargoHash = "sha256-5SUVZlrXIPtlu9KBzucZDCp5t5t8Z4/Nfht2Pw5agVI="; | ||
|
||
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; | ||
}; | ||
} |