From 6df154f71dcfa1dffa340123d0b74540e80a81af Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Wed, 29 May 2024 15:35:51 +0200 Subject: [PATCH] tablet driver --- modules/collections/laptop.nix | 1 + modules/graphical/hyprland.nix | 1 + modules/graphical/shared.nix | 4 ++-- modules/hardware/default.nix | 1 + modules/hardware/tablet-patches.diff | 32 ++++++++++++++++++++++++++++ modules/hardware/tablet.nix | 14 ++++++++++++ 6 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 modules/hardware/tablet-patches.diff create mode 100644 modules/hardware/tablet.nix diff --git a/modules/collections/laptop.nix b/modules/collections/laptop.nix index fb060ba..dedde83 100644 --- a/modules/collections/laptop.nix +++ b/modules/collections/laptop.nix @@ -19,6 +19,7 @@ hardware = { firmware.enable = true; ssd.enable = true; + tablet.enable = true; }; graphical = { audio.enable = true; diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index d3b6c22..8b0fd9d 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -69,6 +69,7 @@ in { networkmanagerapplet wayland wl-clipboard + xfce.tumbler # for thumbnails #qt5.qtwayland #qt6.qmake #qt6.qtwayland diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index dc0560c..7a6c829 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -39,7 +39,7 @@ in ]; }; - services.xserver.wacom.enable = true; + #services.xserver.wacom.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget @@ -59,7 +59,7 @@ in p7zip qbittorrent brightnessctl - wacomtablet + #wacomtablet wl-clipboard libsForQt5.kolourpaint libsForQt5.kcalc diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 5b3d28c..48e40f6 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -8,5 +8,6 @@ ./vfio.nix ./wooting.nix ./tpm.nix + ./tablet.nix ]; } diff --git a/modules/hardware/tablet-patches.diff b/modules/hardware/tablet-patches.diff new file mode 100644 index 0000000..b8c0ade --- /dev/null +++ b/modules/hardware/tablet-patches.diff @@ -0,0 +1,32 @@ +diff --git a/OpenTabletDriver.Plugin/Log.cs b/OpenTabletDriver.Plugin/Log.cs +index c77d83e1..28577939 100644 +--- a/OpenTabletDriver.Plugin/Log.cs ++++ b/OpenTabletDriver.Plugin/Log.cs +@@ -74,7 +74,7 @@ namespace OpenTabletDriver.Plugin + /// Text for the . + public static void Debug(string group, string text) + { +- Write(group, text, LogLevel.Debug); ++ Write(group, text, LogLevel.Info); + } + + /// +diff --git a/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs b/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs +index c5251855..8daa3d01 100644 +--- a/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs ++++ b/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs +@@ -1,5 +1,6 @@ + using System.Numerics; + using System.Runtime.CompilerServices; ++using OpenTabletDriver.Plugin.Logging; + + namespace OpenTabletDriver.Plugin.Tablet + { +@@ -27,6 +28,7 @@ namespace OpenTabletDriver.Plugin.Tablet + penByte.IsBitSet(1), + penByte.IsBitSet(2) + }; ++ Log.Write("Device", $"{Tilt}"); + } + + public byte[] Raw { set; get; } diff --git a/modules/hardware/tablet.nix b/modules/hardware/tablet.nix new file mode 100644 index 0000000..fcb6500 --- /dev/null +++ b/modules/hardware/tablet.nix @@ -0,0 +1,14 @@ +{ pkgs, config, lib, ... }: +with lib; +let cfg = config.custom.hardware.tablet; +in { + options.custom.hardware.tablet = { + enable = mkEnableOption "Enables tablet"; + }; + + config = mkIf cfg.enable { + hardware.opentabletdriver.enable = true; + #hardware.opentabletdriver.package = pkgs.opentabletdriver.overrideAttrs + # (old: { patches = old.patches ++ [ ./tablet-patches.diff ]; }); + }; +}