diff --git a/i3/i3.nix b/i3/i3.nix index 23616f1..5e47572 100644 --- a/i3/i3.nix +++ b/i3/i3.nix @@ -1,6 +1,6 @@ {writeTextDir, writeScript, lib, rofi, xss-lock, nitrogen, compton-git, i3status, i3-gaps -, i3lock-fancy, xset, alsaUtils, light, screenshot_public, xorg, +, i3lock-fancy, xset, alsaUtils, light, screenshot_public, xorg, libinput-gestures, with_lock ? true, compton_name ? "default"}: let @@ -173,6 +173,7 @@ exec --no-startup-id ${compton-git}/bin/compton --config /home/yorick/dotfiles/x exec --no-startup-id ${xorg.xf86inputsynaptics}/bin/syndaemon -i 0.5 -k -t exec --no-startup-id ${xss-lock}/bin/xss-lock -l -- ${locker} +exec --no-startup-id ${libinput-gestures}/bin/libinput-gestures '') + '' diff --git a/nix/.nixpkgs/config.nix b/nix/.nixpkgs/config.nix index 5a5b38f..a8839fd 100644 --- a/nix/.nixpkgs/config.nix +++ b/nix/.nixpkgs/config.nix @@ -63,6 +63,8 @@ ''; }; + libinput-gestures = pkgs.callPackage ./libinput-gestures.nix {}; + weiightminder = pkgs.callPackage (fetchgit { url = https://gist.github.com/yorickvP/229d21a7da13c9c514dbd26147822641; rev = "9749ef4d83c0078bc0248215ee882d7124827cf3"; diff --git a/nix/.nixpkgs/libinput-gestures.nix b/nix/.nixpkgs/libinput-gestures.nix new file mode 100644 index 0000000..5ba625b --- /dev/null +++ b/nix/.nixpkgs/libinput-gestures.nix @@ -0,0 +1,45 @@ +{ pkgs ? (import {}) +, stdenv ? pkgs.stdenv +, xdotool ? pkgs.xdotool +, makeWrapper ? pkgs.makeWrapper +, wmctrl ? pkgs.wmctrl +, fetchFromGitHub ? pkgs.fetchFromGitHub +, bash ? pkgs.bash +, python3 ? pkgs.python3 +, libinput ? pkgs.libinput +, procps ? pkgs.procps +}: + +stdenv.mkDerivation rec { + version = "2.16"; + name = "libinput-gestures-${version}"; + src = fetchFromGitHub { + owner = "bulletmark"; + repo = "libinput-gestures"; + rev = version; + sha256 = "0ix1ygbrwjvabxpq8g4xcfdjrcc6jq79vxpbv6msaxmjxp6dv17w"; + }; + + patches = [./paths.diff]; + + buildInputs = with pkgs; [ makeWrapper ]; + + installFlags = "DESTDIR=$(out)"; + preInstall = '' + substituteAllInPlace libinput-gestures.desktop + ''; + postInstall = '' + wrapProgram $out/bin/libinput-gestures \ + --prefix PATH : "${python3}/bin:${xdotool}/bin:${wmctrl}/bin:${libinput}/bin" + substituteInPlace $out/bin/libinput-gestures-setup \ + --replace "DIR=\"/" "DIR=\"$out/" + wrapProgram $out/bin/libinput-gestures-setup \ + --prefix PATH : "${procps}/bin:${libinput}/bin" + ''; + + meta = with stdenv.lib; { + description = "libinput gesture recognition"; + license = licenses.gpl3; + maintainers = with maintainers; [ yorickvp ]; + }; +}