LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2016, 10:21 AM   #1
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Rep: Reputation: Disabled
Run Script When Any Key Pressed, Run 2nd Script After Any Pause


Hello, All,

Background: Acer C720 Chromebook, running GalliumOS 2.0 (Xubuntu 16.04). Touchpad issue: very jumpy, but no "disable when typing" option, and syndaemon installation will break system

Currently, I have the command:

xinput -disable "Cypress APA Trackpad (cyapa)"

bound to keystroke and:

xinput -enable "Cypress APA Trackpad (cyapa)"

bound to another. And I use one command or the other when typing.

It occurs to me that the xinput -disable "Cypress APA Trackpad (cyapa)" command (disabling touchpad) could be run at the press of any key and the xinput -enable "Cypress APA Trackpad (cyapa)" (enabling touchpad) could be run at any pause (say after 1.5 seconds).

Is it possible to script this procedure or is press-any-key and enable-after-any-pause too vague?

Any help would be much appreciated,
Jake
 
Old 08-25-2016, 04:43 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Is it possible to script this procedure or is press-any-key and enable-after-any-pause too vague?
Yes. Simply write your command into a script, make it executable, put it into wherever you want /home/YOU/bin or /usr/bin/ then assign a key to toggle the script execution, you can do it from Menu -> Settings -> Xfce Settings Manager -> Keyboard -- choose Application Shortcuts and define it accordingly.

Hope that helps.

Good luck and enjoy.

m.m.
 
1 members found this post helpful.
Old 08-25-2016, 06:47 AM   #3
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Many thanks for your post, and perhaps it isn't possible to have a script constantly running in the background that senses through keypress or pause to disable or enable the touchpad.

In my original post, I said that I had bound a disable touchpad command to one keystroke and an enable touchpad to another keystroke. Is your idea the same? I'm not sure how to write a toggling script and I was hoping for something more automated.

Jake

Last edited by jakfish; 08-25-2016 at 06:51 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My BASH script work perfect when i run it manualy, but not when it run in the crontab roqarg Linux - Newbie 30 05-06-2010 01:37 PM
How to make shell script wait for a particular key pressed in order to proceed? Caed Lucin Linux - General 5 01-31-2010 06:08 PM
In KDE, how to run a sh script from the key bindings ? Xeratul Linux - General 3 12-17-2006 12:13 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration