From ee4ff53921c6dbafbf0b335d57c99b7a34949124 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 13 Sep 2023 07:26:38 -0400 Subject: [PATCH] Old setup for pentablet --- .gitattributes | 1 + home/jacob.nix | 6 ++++++ machines/buck/configuration.nix | 20 +++++++++++++++++++- machines/buck/hardware-configuration.nix | 6 ++++++ machines/buck/xp_pen_pentablet.nix | 7 ++++--- 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3a19b95 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.deb filter=lfs diff=lfs merge=lfs -text diff --git a/home/jacob.nix b/home/jacob.nix index d550022..0b8d8f6 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -40,6 +40,7 @@ inconsolata jq keyutils # for keyctl, used by some bitwarden scripts like qute-bitwarden + krita libreoffice logseq mupdf @@ -61,6 +62,7 @@ tree unzip xclip + xournal xpra zathura zoom-us @@ -357,5 +359,9 @@ config = ./xmonad.hs; }; }; + initExtra = '' + xinput --map-to-output 'HANVON UGEE Artist 16(2nd Gen) Mouse' DP-1 + xinput --map-to-output 'HANVON UGEE Artist 16(2nd Gen)' DP-1 + ''; }; } diff --git a/machines/buck/configuration.nix b/machines/buck/configuration.nix index 3e23513..3d99100 100644 --- a/machines/buck/configuration.nix +++ b/machines/buck/configuration.nix @@ -8,7 +8,11 @@ inputs, sops, ... -}: { +}: +let + xp_pen_pentablet = pkgs.callPackage ./xp_pen_pentablet.nix {}; +in +{ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -87,8 +91,11 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ + networkmanager + networkmanagerapplet vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget + xp_pen_pentablet ]; # Some programs need SUID wrappers, can be configured further or are @@ -166,12 +173,22 @@ udev.extraRules = '' ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness" + KERNEL=="hidraw", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev" + + # For XP-PEN tablet + # From the official driver + KERNEL=="uinput",MODE:="0666",OPTIONS+="static_node=uinput" + SUBSYSTEMS=="usb",ATTRS{idVendor}=="28bd",MODE:="0666" +j + #KERNEL=="event[0-9]*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="28bd", ATTRS{idProduct}=="094c", MODE="0664", GROUP="plugdev" + #KERNEL=="mouse[0-9]*", SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="28bd", ATTRS{idProduct}=="094c", MODE="0664", GROUP="plugdev" ''; # Enable the X11 windowing system. services.xserver.enable = true; xserver = { enable = true; dpi = 112; # t470 has a 14" 16:9 monitor at native res 1366x768 + digimend.enable = true; displayManager = { defaultSession = "none+i3"; autoLogin = { @@ -190,6 +207,7 @@ disableWhileTyping = true; }; }; + #wacom.enable = true; windowManager.i3 = { enable = true; extraPackages = with pkgs; [ diff --git a/machines/buck/hardware-configuration.nix b/machines/buck/hardware-configuration.nix index c4f8941..49c01b0 100644 --- a/machines/buck/hardware-configuration.nix +++ b/machines/buck/hardware-configuration.nix @@ -46,4 +46,10 @@ powerManagement.cpuFreqGovernor = "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # for XP-Pen tablet + #hardware.opentabletdriver = { + #enable = true; + #package = patchedOTD; + #}; } diff --git a/machines/buck/xp_pen_pentablet.nix b/machines/buck/xp_pen_pentablet.nix index 897c7d1..2ee5b7d 100644 --- a/machines/buck/xp_pen_pentablet.nix +++ b/machines/buck/xp_pen_pentablet.nix @@ -25,7 +25,7 @@ , lib , fetchurl , glib -, dbus_libs +, dbus , dpkg , autoPatchelfHook , writeShellScript @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { pname = "xp_pen_driver"; - version = "3.2.0.210804-1"; + version = "3.3.9.230222-1"; src = fetchurl { #url = "https://github.com/peterwilli/XP-Pen-Pentablet-Driver-for-Nixos/releases/download/3.2.0.210804-1/XP-PEN-pentablet-3.2.0.210804-1.x86_64.deb"; @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { zlib libGL libusb - dbus_libs + dbus fontconfig glib freetype @@ -81,6 +81,7 @@ stdenv.mkDerivation rec { chmod 755 "$out" chmod a+x $out/usr/lib/pentablet/pentablet.sh + chmod a+x $out/usr/lib/pentablet/pentablet runHook postInstall mkdir -p $out/bin makeWrapper $out/usr/lib/pentablet/pentablet.sh $out/bin/pentablet