노트북 터치패드(touchpad) On/Off toggle 스크립트

근래 작업용 노트북이 필요하여 다시 셋팅하다 보니, 타이핑 칠때 마다 터치패드가 나를 불편하게 만드네요.

간단한 toggle 명령 하나 만들어봄.

 

# cat /usr/bin/tponoff

#!/bin/bash

TP_ID=`xinput | grep TouchPad | awk ‘{print $6}’ | sed -e ‘s/id=//g’`
echo “TouchPad ID : $TP_ID”

#xinput list-props $TP_ID | grep “Device Enabled”

TP_ST=`xinput list-props $TP_ID | grep “Device Enabled” | cut -d : -f 2 | sed -e ‘s/<tab표식>//g’`

if [ “$TP_ST” = “0” ] ; then
echo “TouchPad status change from Off to On”
xinput enable $TP_ID
else
echo “TouchPad status change from On to Off”
xinput disable $TP_ID
fi

TP_ST1=`xinput list-props $TP_ID | grep “Device Enabled” | cut -d : -f 2 | sed -e ‘s/<tab표식>//g’`
echo “TouchPad Status : $TP_ST1”

 

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

3 Responses

  1. gate io 말해보세요:

    Cool. I spent a long time looking for relevant content and found that your article gave me new ideas, which is very helpful for my research. I think my thesis can be completed more smoothly. Thank you.

  1. 2022년 6월 18일

    1appreciable

  2. 2023년 1월 26일

    1crispin

페이스북/트위트/구글 계정으로 댓글 가능합니다.