2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linux においてマウスホイールを早くする

Last updated at Posted at 2019-05-01

Linux においてマウスホイールの1ラッチが一行に相当するため、 Windows になれているとスクロールが遅く感じます。imwheel を使って1ラッチ、二行に変更する手順を紹介します。

Debian GNU/Linux 9 の場合の手順です。Debian GUN/Linux 10 の場合は、Xorg が Wayland になったため、imwheel で設定しても効果がないようです。

  1. imwheel をインストールする

$ sudo apt-get install imwheel
  1. .imwheel を作成する

ホームディレクトリに次の内容の .imwheel を作成します。

"google-chrome"
None,      Up,   Button4, 3
None,      Down, Button5, 3
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down,   Shift_L|Button5

"Mail"
None,      Up,   Button4, 3
None,      Down, Button5, 3
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down,   Shift_L|Button5

この内容だと、google chromeとThunderbirdの画面を選択して、マウスホイールを回したときのスクロールが二倍になります。なお、.imwheelに記述するアプリケーションの名前は xprop WM_CLASS | grep -o '"[^"]*"' | head -n 1 コマンドで調べられます。

Control_LやShift_Lから始まる行を記載すると、CtrlキーやShiftキーを押した状態でマウスホイールを動貸した場合の動作が、今までどおりとなります。記載しないと、CtrlキーやShiftキーを押さない場合の動作と同じになります。

/usr/bin/imwheel -k -b "4 5" を実行すると、設定が反映されます。4 と 5 がマウスホイールを表しており、マウスホイールの信号のみ操作することを意味しています。

  1. ログイン時に設定されるようにする

/etc/X11/imwheel/startup.conf を編集し、次の設定を行います。

  • IMWHEEL_START=1 と設定する
  • IMWHEEL_BOTTUN="4 5" と設定する

以下は、/etc/X11/imwheel/startup.conf の例:

IMWHEEL_START=1
# IMWHEEL_PARAMS='-b "4 5"'
IMWHEEL_BOTTUN="4 5"

/etc/X11/Xsession.d/60imwheel_start-imwheel を編集し、imwheelの起動コマンドを /usr/bin/imwheel -k -b "${IMWHEEL_BOTTUN}" "${IMWHEEL_PARAMS}" とします。

以下は、/etc/X11/Xsession.d/60imwheel_start-imwheel の例:

# Starts the imwheel process.
. /etc/X11/imwheel/startup.conf
if [ "$IMWHEEL_START" = "1" ]; then
#	/usr/bin/imwheel -k "${IMWHEEL_PARAMS}"
	/usr/bin/imwheel -k -b "${IMWHEEL_BOTTUN}" "${IMWHEEL_PARAMS}"
fi
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?