From 4b17b41ff09932c4c7825d25b280e820d6b56d6f Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 20 Oct 2022 16:59:25 -0700 Subject: [PATCH] Add dysfunctional xsetwacom udev rule for tablet --- hosts/desktop.nix | 21 ++++++++++++++++++++- wacom-config.sh | 12 ++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 wacom-config.sh diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 4fecc2c..bac033b 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -1,11 +1,30 @@ { config, pkgs, ... }: +let + wacom-config = pkgs.substituteAll { + name = "wacom-config"; + src = ../wacom-config.sh; + dir = "bin"; + isExecutable = true; + }; +in { services = { - # dconf is required for setting GTK themes, see home.nix dbus.packages = with pkgs; [ dconf ]; + # $ nix-shell -p usbutils + # $ lsusb + # ID : + # Gets stored in /etc/udev/rules.d/99-wacom.rules + udev.extraRules = '' + ACTION=="add", + SUBSYSTEMS=="usb", + ATTRS{idVendor}="056a", + ATTRS{idProduct}="0302", + RUN+="${wacom-config}/bin/wacom-config" + ''; xserver = { enable = true; + wacom.enable = true; libinput = { enable = true; touchpad.tapping = true; diff --git a/wacom-config.sh b/wacom-config.sh new file mode 100755 index 0000000..0f2b61c --- /dev/null +++ b/wacom-config.sh @@ -0,0 +1,12 @@ +# ----------------------------- +# Desktop monitor configuration +# ----------------------------- +# xsetwacom --list devices | grep -oP '(?<=id:\s)\w+' | while read -r id ; do +# xsetwacom set $id MapToOutput 1920x1080+1920+0 +# done + +touch /home/elnu/wacom-ran + +/run/current-system/sw/bin/xsetwacom set "Wacom Intuos PT S Pad pad" Button 1 "key ctrl [" +/run/current-system/sw/bin/xsetwacom set "Wacom Intuos PT S Pad pad" Button 3 "key ctrl ]" +/run/current-system/sw/bin/xsetwacom set "Wacom Intuos PT S Pen stylus" Button 3 "key ctrl z"