You are Here:
Linux Lite 7.0 Final Released - See Release Announcement Section



Item - Request - Touchpad disable script inclusion.

Author (Read 3315 times)

0 Members and 1 Guest are viewing this topic.

Re: Item - Request - Touchpad disable script inclusion.
« Reply #5 on: May 28, 2015, 11:08:20 AM »
 

sysdrum

  • Saying the wrong things at the right time.
  • Occasional Poster
  • **
  • 83
    Posts
  • Reputation: 12
  • That's personal.
    • View Profile

  • CPU: Intel Core i5-6400

  • MEMORY: 16Gb

  • VIDEO CARD: Nvidia 1050 Ti
I built the script to work between Ubuntu/Linux Lite/arch/Fedora. So I wanted to limit the requirements so that I could use it as flexible as possible. I also wanted to keep the size super small. I strip the comments out and so that it is super small. For it to work it just uses just a if else.


Code: [Select]
#!/bin/bash## Language: bash# Last Change:04/08/15## This shell script enables/disables the touchpad on synaptics driver# Requires libnotify, xfce4-notifyd#if [ $(synclient -l | grep TouchpadOff | awk '{print $3}') == 1 ]; thensynclient TouchpadOff=0;notify-send "Touchpad enabled";elsesynclient TouchpadOff=1;notify-send "Touchpad disabled";#fi## A shortcut to this script can be assigned to enable Fn key functionality
 

Re: Item - Request - Touchpad disable script inclusion.
« Reply #4 on: May 28, 2015, 10:40:12 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
It's very similar to this script
https://help.ubuntu.com/community/SynapticsTouchpad/ShortcutKey#Bash_Script
I like your idea on notify-send
Code: [Select]
#!/bin/bash
# toggle synaptic touchpad on/off

# get current state
SYNSTATE=$(synclient -l | grep TouchpadOff | awk '{ print $3 }')

# change to other state
if [ $SYNSTATE = 0 ]; then
         synclient touchpadoff=1
         notify-send "Touchpad disabled";
elif [ $SYNSTATE = 1 ]; then
         synclient touchpadoff=0
         notify-send "Touchpad enabled";
else
         notify-send "Couldn't get touchpad status from synclient"
         exit 1
fi
exit 0

xinput version here
Code: [Select]
#!/bin/bash
# tp_toggle
#
# Toggle the touchpad on/off.


# Get the id number of the touchpad.
tp_id=`xinput list | grep -i touchpad | awk '{ print $6 }' | sed 's/id=//'`


# Find out whether the touchpad is enabled or not.
tp_enabled=`xinput list-props $tp_id | grep Device\ Enabled | awk '{ print $4 }'`


if [ $tp_enabled = 0 ]
then
  # The touchpad is currently disabled, so turn it on.
  xinput set-prop $tp_id "Device Enabled" 1
         notify-send "Touchpad enabled";
elif [ $tp_enabled = 1 ]
then
  # The touchpad is currently enabled, so turn it off.
  xinput set-prop $tp_id "Device Enabled" 0
         notify-send "Touchpad disabled";
else
  notify-send  "tp_toggle: Could not get touchpad status from xinput."
  exit 1
fi
 

Re: Item - Request - Touchpad disable script inclusion.
« Reply #3 on: May 28, 2015, 01:30:34 AM »
 

sysdrum

  • Saying the wrong things at the right time.
  • Occasional Poster
  • **
  • 83
    Posts
  • Reputation: 12
  • That's personal.
    • View Profile

  • CPU: Intel Core i5-6400

  • MEMORY: 16Gb

  • VIDEO CARD: Nvidia 1050 Ti
The script does not require any outside system configuration other than being added to the script folder and a hot added to xfce4.
Which could be made update option.
https://github.com/sysdrum/rockerwell-pdr/
 

Re: Item - Request - Touchpad disable script inclusion.
« Reply #2 on: May 27, 2015, 11:29:41 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
 

Item - Request - Touchpad disable script inclusion.
« Reply #1 on: May 27, 2015, 10:28:12 AM »
 

sysdrum

  • Saying the wrong things at the right time.
  • Occasional Poster
  • **
  • 83
    Posts
  • Reputation: 12
  • That's personal.
    • View Profile

  • CPU: Intel Core i5-6400

  • MEMORY: 16Gb

  • VIDEO CARD: Nvidia 1050 Ti

I have a simple synaptic touchpad script that disables and re-enables the touchpad given a key press for those who would like to have more control when typing on some laptops. I would like to have it included in the scripts folder and maybe a note about it. I know that under the mouse and touchpad settings you can enable and disable plus set a delay when typing but sometimes that is not usable. For those using a usb mouse a quick key option would be nice so that they can turn it on and off without having to use the menu.
It is a simple yet nice feature that other distros don't have.
It is on my github.
I can post it here for review.


« Last Edit: May 27, 2015, 10:32:37 AM by sysdrum »
 

 

-->
X Close Ad

Linux Lite 7.0 Final Released - See Release Announcement Section