January 24, 2019

706 letters 2 mins read

古いMacBook Air (late 2010)をLinuxマシンにして復活させる(タッチパッドの修正)

古いMacBook Air (late 2010)をLinuxマシンにして復活させる(タッチパッドの修正)

MacBook Air late 2010 (MacBookAir3,1)がさすがに重いので軽量なLinuxマシンにして復活を試みる。 ディストリビューションはUbuntu Studio 18.10を選択。 インストール自体は普通に完了するが、いくつか修正すべきポイントがあるので触れておく。

タッチパッドが使いにくい

タッチパッドがそのままでは使いにくい。 設定を見てもほとんど設定できる項目がなく、マルチタッチもできないのでこれを修正する。

mtrackのインストール

mtrackというモジュールを使う。 MacOSのタッチパッドほどではないけど、まあマシにはなる。

以下のようにインストール。

$ git clone https://github.com/p2rkw/xf86-input-mtrack.git
$ cd xf86-input-mtrack
$ ./configure --with-xorg-module-dir=/usr/lib/xorg/modules
$ make
$ sudo make install

次に、以下に設定ファイルを置く。

$ sudo vi /usr/share/X11/xorg.conf.d/50-mtrack.conf 

当方で設定している内容は以下の通り。

Section "InputClass"
        MatchIsTouchpad "on"
        Identifier      "Touchpads"
        MatchDevicePath "/dev/input/event*"
        Driver          "mtrack"
        # Tweak cursor movement speed with this
        Option          "Sensitivity" "0.10"
        # Pressure at which a finger is detected as a touch
        Option          "FingerHigh" "10"
        # Pressure at which a finger is detected as a release
        Option          "FingerLow" "10"
        # I often use thumb to press down the physical button, so let's not ignore it
        Option          "IgnoreThumb" "true"
        Option          "ThumbRatio" "70"
        Option          "ThumbSize" "25"
        # Ignore palm, with palm takes up to 30% of your touchpad
        Option          "IgnorePalm" "true"
        Option          "PalmSize" "30"
        # Trigger mouse button when tap: 1 finger - left click, 2 finger - right click, 3 - middle click
        Option          "TapButton1" "0"
        Option          "TapButton2" "0"
        Option          "TapButton3" "0"
        Option          "TapButton4" "0"
        Option          "ClickTime" "25"
        Option          "EdgeBottomSize" "25"
        # Disable tap-to-drag, we're using three finger drag instead
        Option          "TapDragEnable" "false"
        # While touching the touchpad with fingers, press the touchpad physical click button
        Option          "ClickFinger0" "1"
        Option          "ClickFinger1" "1"
        Option          "ClickFinger2" "3"
        Option          "ClickFinger3" "2"
        Option          "ButtonMoveEmulate" "false"
        Option          "ButtonIntegrated" "true"
        # The momentum after scroll fingers released
        Option          "ScrollCoastDuration" "300"
        Option          "ScrollCoastEnableSpeed" ".1"
        # Natural scrolling with two fingers
        Option          "ScrollSmooth" "true"
        Option          "ScrollUpButton" "5"
        Option          "ScrollDownButton" "4"
        Option          "ScrollLeftButton" "7"
        Option          "ScrollRightButton" "6"
        # Tweak scroll sensitivity with ScrollDistance, don't touch ScrollSensitivity
        Option          "ScrollDistance" "150"
        Option          "ScrollClickTime" "10"
        # Three finger drag
        Option          "SwipeDistance" "1"
        Option          "SwipeLeftButton" "1"
        Option          "SwipeRightButton" "1"
        Option          "SwipeUpButton" "1"
        Option          "SwipeDownButton" "1"
        Option          "SwipeClickTime" "0"
        Option          "SwipeSensitivity" "1000"
        # Four finger swipe, 8 & 9 are for browsers navigating back and forth respectively
        Option          "Swipe4LeftButton" "9"
        Option          "Swipe4RightButton" "8"
        # Mouse button >= 10 are not used by Xorg, so we'll map them with xbindkeys and xdotool later
        Option          "Swipe4UpButton" "11"
        Option          "Swipe4DownButton" "10"
        # Mouse buttons triggered by 2-finger pinching gesture
        Option          "ScaleDistance" "300"
        Option          "ScaleUpButton" "12"
        Option          "ScaleDownButton" "13"
        # Mouse buttons trigger by 2-finger rotating gesture, disabled to enhance the pinch gesture
        Option          "RotateLeftButton" "0"
        Option          "RotateRightButton" "0"
EndSection

一度ログアウトすると設定が反映される。 細かいカーソルの速度は設定マネージャー→マウスとタッチパッドから調整する。