36 lines
		
	
	
		
			704 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			704 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| xinput_touchpad_id=$(xinput | grep -i touchpad | sed 's/^.*id=\([0-9]*\).*/\1/')
 | |
| 
 | |
| case $1 in
 | |
| 
 | |
| 	enable)
 | |
| 		xinput enable $xinput_touchpad_id
 | |
| 		;;
 | |
| 	disable)
 | |
| 		xinput disable $xinput_touchpad_id
 | |
| 		;;
 | |
| 	id)
 | |
| 		echo $xinput_touchpad_id
 | |
| 		;;
 | |
| 	--help | -h)
 | |
| 		echo 'Usage: touchpad OPTION'
 | |
| 		echo 'Used to manipulate touchpad.'
 | |
| 
 | |
| 		echo ''
 | |
| 		echo '	--help: display this help and exit'
 | |
| 		echo '	enable: enables touchpad'
 | |
| 		echo '	disable: disables touchpad'
 | |
| 		echo '	id: returns the xinput id of the touchpad'
 | |
| 		;;
 | |
| 	"")
 | |
| 		echo 'No argument provided.'
 | |
| 		echo 'Try "touchpad --help" for more information.'
 | |
| 		;;	
 | |
| 	*)
 | |
| 		echo 'Invalid argument.'
 | |
| 		echo 'Try "touchpad --help" for more information'
 | |
| 		;;
 | |
| esac
 | |
| 
 |