{"id":198,"date":"2021-12-07T10:27:00","date_gmt":"2021-12-07T09:27:00","guid":{"rendered":"http:\/\/www.ncodenicer.com\/?p=198"},"modified":"2026-05-13T20:56:04","modified_gmt":"2026-05-13T18:56:04","slug":"simple-script-to-toggle-touchpag-on-off","status":"publish","type":"post","link":"https:\/\/www.codenicer.com\/?p=198","title":{"rendered":"Simple script to toggle touchpag on\/off"},"content":{"rendered":"\n<p>Here is simple script to toggle touchpad on laptop on or off<\/p>\n\n\n\n<p>First you have to discover which device id is actually touchpad &#8211; you can do that using <code>xinput list<\/code>. There touchpad will be shown as one more mouse. Then you can update script below with touchpad&#8217;s ID on your system (replace <code>&lt;ID><\/code> with actual number). You can bind this little script to some key to be able to easily toggle touchpad on or off.<\/p>\n\n\n\n<p><code>#!\/bin\/sh<br>TOUCHPAD=&lt;ID><br>enabled=`xinput list-props $TOUCHPAD | grep Device\\ Enabled | tail -c 2`<br>#echo \"Enabled: $enabled\"<br>if [ \"$enabled\" = \"1\" ]<br>then<br>    xinput disable $TOUCHPAD<br>else<br>    xinput enable $TOUCHPAD<br>fi<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is simple script to toggle touchpad on laptop on or off First you have to discover which device id is actually touchpad &#8211; you can do that using xinput list. There touchpad will be shown as one more mouse. Then you can update script below with touchpad&#8217;s ID on your system (replace &lt;ID> with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[44,128,102],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-mouse","tag-touchpad","tag-xorg"],"_links":{"self":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":1,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}