Created
February 8, 2013 00:29
-
-
Save Deradon/4735537 to your computer and use it in GitHub Desktop.
HP-Notebook - Disable/Enable touchpad on command-line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Simple script to disable TouchPad on HP-Notebook | |
# | |
# Usage: touchpad-disable | |
# | |
# Installation: save file to ~/bin/touchpad-disable (may chmod +X it) | |
# | |
def run(cmd, options = {:show => true}) | |
puts "> #{cmd}" | |
`#{cmd}`.tap { |r| puts(r) if options[:show] && !r.empty? } | |
end | |
line = run "xinput list | grep TouchPad" | |
id = line[/.*\tid=(\d+)\t.*/, 1] | |
run "xinput set-prop #{id} 'Device Enabled' 0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Simple script to enable TouchPad on HP-Notebook | |
# | |
# Usage: touchpad-enable | |
# | |
# Installation: save file to ~/bin/touchpad-enable (may chmod +X it) | |
# | |
def run(cmd, options = {:show => true}) | |
puts "> #{cmd}" | |
`#{cmd}`.tap { |r| puts(r) if options[:show] && !r.empty? } | |
end | |
line = run "xinput list | grep TouchPad" | |
id = line[/.*\tid=(\d+)\t.*/, 1] | |
run "xinput set-prop #{id} 'Device Enabled' 1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment