Need rule/method to toggle touchpad when USB mouse attached.

Forum Forums New users New Users and General Questions Need rule/method to toggle touchpad when USB mouse attached.

  • This topic has 3 replies, 2 voices, and was last updated Apr 14-11:25 pm by wildstar84.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20447
    Member
    wildstar84

      Anyone got a working eudev rule for toggling a touchpad when a USB mouse is inserted or removed, or some general method that at least detects it’s insertion or removal? General googling hasn’t helped much (rules provided don’t seem to do anything and just produce error: “specified group ‘kvm’ unknown”.

      Thanks!

      #20450
      Member
      delix02
        Helpful
        Up
        0
        ::

        if I remember correctly, I made sveral changes :

        1. the udev rule

        ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"
        ACTION=="remove", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"

        and in /etc/X11 a xorg.conf file
        `Section “ServerFlags”
        Option “DontZap” “Off”
        Option “AllowMouseOpenFail” “true”
        Option “blank time” “0”
        Option “standby time” “0”
        Option “suspend time” “0”
        Option “off time” “0”
        EndSection`

        synclient must be installed.
        However, you better use this hints for input of a StartPage search 🙂

        EDIT : found the HowTo I followed
        https://wiki.archlinux.de/title/Touchpad_bei_eingesteckter_Maus_deaktivieren

        • This reply was modified 4 years ago by delix02.
        • This reply was modified 4 years ago by delix02.
        • This reply was modified 4 years ago by delix02.
        #20467
        Member
        wildstar84
          Helpful
          Up
          0
          ::

          [SOLVED!] Thank you sir, that did the trick! I did, however, catch the need to change (“/home/user” to /home/<me> (and fortunately, this is a single-abUser system, so not sure how would work on a multi-user system)! Not sure what I was wrong w/the way I was doing it before, but hey, yours WORKS!

          Thanks again!

          Jim

          #20492
          Member
          wildstar84
            Helpful
            Up
            0
            ::

            Oops, spoke too soon – seems that on this box, if the mouse is plugged in on startup, it will get “mouse0” and the touchpad gets “mouse1”, otherwise, touchpad gets mouse0. Therefore, since the tp will NEVER get “unplugged”, I changed “[1-9]” above to “0-9]”, and removed the unneeded “ENV{ID_CLASS}…” parts and all is well now! Final rules:

            ACTION==”add”, SUBSYSTEM==”input”, KERNEL==”mouse[0-9]”, ENV{DISPLAY}=”:0.0″, ENV{XAUTHORITY}=”/home/janelle/.Xauthority”, RUN+=”/usr/bin/synclient TouchpadOff=1″
            ACTION==”remove”, SUBSYSTEM==”input”, KERNEL==”mouse[0-9]”, ENV{DISPLAY}=”:0.0″, ENV{XAUTHORITY}=”/home/janelle/.Xauthority”, RUN+=”/usr/bin/synclient TouchpadOff=0″

            Regards,

            Jim

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.