Switch Off the Touchpad(SONY VPCSD1S4C)

Steps:

1.Install xinput

$ sudo yum install xorg-x11-apps
2.Look up the list to see what is your touchpad input
$ xinput list
which shows a list to us containing input devices like
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver                   	id=9	[slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation        	id=13	[slave  pointer  (2)]
⎜   ↳ ImPS/2 Generic Wheel Mouse              	id=14	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Sony Vaio Keys                          	id=6	[slave  keyboard (3)]
    ↳ Lid Switch                              	id=7	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=8	[slave  keyboard (3)]
    ↳ Logitech USB Receiver                   	id=10	[slave  keyboard (3)]
    ↳ USB2.0 Camera                           	id=11	[slave  keyboard (3)]
    ↳ Power Button                            	id=12	[slave  keyboard (3)]

What I focus on is the so-called "ImPS/2 Generic Wheel Mouse"(there may be tiny difference in your laptop). Now try to disable it:

$ xinput --set-prop "ImPS/2 Generic Wheel Mouse" "Device Enabled" 0
If the touchpad isn't working now, congratulations!(I have tried the method using gsynaptics, however it didn't work nomatter what I do to fix  "SHMConfig". :-( )

3.Then what you need to do is just write a script to switch on/off the touchpad. It's sth. like:

#!/bin/bash
printf "Switch on/off the touchpad?(1/0) "
read SWITCH
if [ "$SWITCH" = 1 ];
then
{
	/usr/bin/xinput --set-prop "ImPS/2 Generic Wheel Mouse" "Device Enabled" 1
	echo "The touchpad has been switched on."
}
else
{
	/usr/bin/xinput --set-prop "ImPS/2 Generic Wheel Mouse" "Device Enabled" 0
	echo "The touchpad has been switched off."
}
fi
If you want to disable it by default, add this line to ~/.bash_profile:
/usr/bin/xinput --set-prop "ImPS/2 Generic Wheel Mouse" "Device Enabled" 0


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值