Skip to content

Commit

Permalink
chore(wacom): upgrade config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Nov 12, 2023
1 parent ab0cacf commit c9c2446
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions modules/hardware/wacom.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
{ config, pkgs, lib, home-manager, ... }:
with lib;
with builtins;
let
cfg = config.modules.hardware.wacom;

wacomScript = toFile "wacom-multi-monitor.sh" ''
#!/usr/share/env bash
if [ -z `which xsetwacom` ]; then
echo "Wacom driver isn't installed!"
exit -1;
fi
tablet=`xsetwacom list devices | awk '{print $9}'`
wacomScript = pkgs.writeScript "wacom-multi-monitor.sh" ''
tablet=`${pkgs.xf86_input_wacom}/bin/xsetwacom list devices | ${pkgs.gawk}/bin/awk '{print $9}'`
for i in $tablet; do
xsetwacom --set "$i" MapToOutput HEAD-0
${pkgs.xf86_input_wacom}/bin/xsetwacom --set "$i" MapToOutput HEAD-0
done
'';
in {
in
{
options = {
modules.hardware.wacom = {
enable = mkEnableOption "Enable support for wacom graphic tablet";
};
};

# TODO Add udev rules to auto assinge tablet to primary monitor
config = mkIf cfg.enable {
services.xserver.wacom.enable = cfg.enable;

Expand Down

0 comments on commit c9c2446

Please sign in to comment.