起動時に一部のタッチパッドを無効にする

起動時に一部のタッチパッドを無効にする

長年、私はMintが始まったときに東芝Z30タッチパッドの「スティック」部分を手動で無効にしてきました。このモデルには、マウスが自分で動くハードウェアの問題があります。

起動時に(すべてのユーザーに対して)このコマンドを自動的に実行しようとしましたが、動作しません。

実行権限を持つスクリプトを生成しました。

ls -la /etc/init.d/disable-stick.sh
-rwxr-xr-x 1 root root 84 Feb 28 07:21 /etc/init.d/disable-stick.sh

その内容は次のとおりです。

$ cat /etc/init.d/disable-stick.sh

xinput disable 'AlpsPS/2 ALPS DualPoint Stick'
echo "Just ran disable stick script"

ここでは、次のように呼び出されます。

$ ls -la /etc/rc.local

-rwxr-xr-x 1 root root 345 Feb 28 07:16 /etc/rc.local

その中には以下が含まれます。

$ cat /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/etc/init.d/disable-stick.sh || exit 1
exit 0

私はこれがうまくいくはずだと思い、たくさんの情報源を見ました。ほとんど動作します。起動ログで確認できます。

$ tail -n 100 /var/log/boot.log

[  OK  ] Started MySQL Community Server.
[FAILED] Failed to start Load/Save RF Kill Switch Status.
See 'systemctl status systemd-rfkill.service' for details.
[  OK  ] Started Network Manager Wait Online.
[  OK  ] Reached target Network is Online.
         Starting Docker Application Container Engine...
         Starting /etc/rc.local Compatibility...
         Starting TeamViewer remote control daemon...
         Starting LSB: disk temperature monitoring daemon...
         Starting LSB: Start NTP daemon...
         Starting LSB: VirtualBox Linux kernel module...
         Starting LSB: Starts and daemonize Glances server...
[  OK  ] Started LSB: disk temperature monitoring daemon.
[  OK  ] Started LSB: Starts and daemonize Glances server.
[   40.068428] rc.local[1373]: Unable to connect to X server
[   40.068683] rc.local[1373]: Just ran disable stick script
[  OK  ] Started /etc/rc.local Compatibility.
         Starting Hold until boot process finishes up...
         Starting Terminate Plymouth Boot Screen...
[  OK  ] Started LSB: Start NTP daemon.

「Xサーバーに接続できません。」 - 正確ではありません。どのように動作させることができるか知っていますか?

修正する:

この小さなスクリプトは/etc/init.d/disable-stick.sh間違いなく動作します。ログイン後、端末でテストしましたが、マウスの動きが停止しました。起動時に正しい場所で実行されているかどうかはわかりません。

ベストアンサー1

問題を解決しましたが、ユーザーとしてログインするまでソリューションが起動せず、ログインするまでマウスはまだ機能しませんが、幸いなことにログイン時にコマンドが実行されます。自動車警報が鳴る時と同様の安堵感だ。常に端末にコマンドを入力する必要がないことも安心です。

Linux mintのGUIを使用して、ランチャーに次のプロジェクトを追加しました。 Linux Mint Launcherにプロジェクトを追加する

(Befehl)コマンドを使用して表示できない行は次のとおりです。

xinput disable 'AlpsPS/2 ALPS DualPoint Stick'

追加するとリストに表示されます。

Linux Mint Launcherメニューに新しいエントリが含まれています

これにより、自動起動フォルダにファイルが追加されます。

$ ls ~/.config/autostart/
blueman.desktop        hplip-systray.desktop            mintupload.desktop
Brightness.desktop     mint-ctrl-alt-backspace.desktop  mintwelcome.desktop
disable stick.desktop  mintupdate.desktop               shutter.desktop

生成されたファイルの内容は次disable\ stick.desktopのとおりです。

[Desktop Entry]
Type=Application
Exec=xinput disable 'AlpsPS/2 ALPS DualPoint Stick'
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[de_DE]=disable stick
Comment[de_DE]=switches off the trackpad at start
X-GNOME-Autostart-Delay=0

これで、プログラムでこれを達成するために必要なものが何であるかを確認できます。現在、私はこの解決策に満足していますが、ログイン画面自体の前に実行されているのか、ログインしている他のユーザーに対して実行されているのかを知りたいです(そうではありません)。

おすすめ記事