【Linux Mint】Linux Mint 19.1 Cinnamon 修改滑鼠滾動方向為自然方向

panpf發表於2019-04-15

最近在家裡用的 PC 上裝了個 Linux Mint 19.1,經過一番試用後感覺都挺不錯的,唯獨對這個滑鼠滾動方向超級不爽。由於工作時用 mac 已經適應了自然的滑鼠滾動方向,所以就必須要把 Linux Mint 也改成自然方向。

於是立馬就開始了谷歌修改方案,先是用中文關鍵詞搜尋,結果卻都是 ubuntu 的修改方法,想著 Linux Mint 是基於 unbuntu 的,也許這些方法能用呢,可一一試過後都不行。

最終歷經波折終於用英文關鍵詞 'linux mint How reverses the direction of mouse scrolling' 找到了一篇文章 Mouse Scrol reverse\ (Natural) Cinnamon [SOLVED],這篇文章的最後一個回答解決了我的問題,程式碼如下: mouse-natural-scroll.sh

#!/bin/bash

# Enable "natural scrolling" (reverse mouse wheel) in Linux

# to debug
# set -x

# get the mouseid by filtering output of xinput --list
# matches id of first device with word "mouse"
mouseid=$(xinput --list | sed -E '/mouse/I!d;s/.*?mouse.*?id=([0-9]+).*/\1/i;q')

#echo $mouseid

# set natural scrolling property to given mouseid
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1
複製程式碼

複製以上內容建立一個 shell 檔案,執行即可。

另外還需要將此指令碼新增到你的開機啟動中,否則重啟後就需要重新手動執行。

相關文章