Hi Todd,
Thanks for the hint with awk.

I also finally figured out why sed was not working: besides confusion with the 
specific types of regular expression to use, the erratic touchpad made me miss 
an escape (\) character just before the + sign. Thus, one should have had:
    ... |sed -ne 's/.*id=\([0-9]\+\).*/\1/p'`"

Regards,

William.




>________________________________
>From: Todd And Margo Chester <[email protected]>
>To: "[email protected]" <[email protected]>
>Sent: Wednesday, September 21, 2011 7:31 PM
>Subject: Re: momentarily disabling synaptic touchpad
>
>
>On 09/20/2011 01:47 PM, William Shu wrote: 
>Thanks Todd,
>>The script works when I manually give the value for $DeviceID. There are some 
>>trailing characters beyond the device ID that make the system to complain. 
>>The external mouse can't seem to handle click/select and copy (I think the 
>>mouse has probs, and I'm still to get another model and use.)
>>
>>
>>
>>my awk is too rusty to figure how to output only the number after id=. Trying 
>>to use sed as in, e.g.,
>>
>>
>>$   echo -n "dkdksl id=13 dkdsl" |  sed -ne 's/.*id=\([0-9]+\).*/\1/p'
>>
>>
>>does not extract the id (13, here). (I hope I'm not slowly messing up the 
>>system!)]
>Hi William,
>
>SED is a nightmare at times.  Do two AWKs.  I drop the "echo -n"
>in the example.
>
>$ echo "dkdksl id=13 dkdsl" | awk -F "id=" '{print $2}' | awk
    '{print $1}'
>
>13
>
>
>-T
>
>
>
>>
>>While I would like to see your version work, the solution proposed by 
>>Vladimir would meet my needs better when it works!
>>
>>
>>William.
>>
>>
>>
>>
>>________________________________
>>From: Todd And Margo Chester <[email protected]>
>>To: "[email protected]" <[email protected]>
>>Sent: Tuesday, September 20, 2011 2:55 AM
>>Subject: Re: momentarily disabling synaptic touchpad
>>
>>
>>On 09/19/2011 04:28 PM, William Shu wrote: 
>>Hi,
>>>I have SL 6.0 installed on a Seagate FreeAgent GoFlex USB drive, which I use 
>>>on various laptops (and desktops). The touchpad is so sensitive on some 
>>>machines and I would like to disable it. At the same time, the attached 
>>>mouse seems to be selectively responsive, notably its left button. Looking 
>>>through the docs etc, a synaptics input driver has been installed, but the 
>>>corresponding xorg.conf file is not in place for me to modify. (From a 
>>>separate thread on nVidia, creating this file is NOT automatic in SL 6.)
>>> 
>>>
>>Hi William,
>>
>>This is probably not exactly what you wanted.  But,
              anyway...
>>
>>I have a sweet little old lady (70+) on FC15 that the
              slide pad drives
>>her crazy.  She is constantly putting her had down on it
              when she types.
>>She prefers to use her USB attached mouse.  So I wrote the
              following
>>script for her.  I don't remember where I put it though. 
              Maybe her
>>rc.local.
>>
>>HTH,
>>-T
>>
>>#!/bin/bash
>>#Disable the [annoying] Slide Pad mouse
>>
>>#DeviceStr="`xinput list | grep -i touchpad | awk '{print
              $6}'`"
>>#DeviceID="`echo $DeviceStr | sed -e 's/id=//'`"
>>
>>DeviceID="`xinput list | grep -i touchpad | awk -F "id="
              '{print $2}'`"
>>if [ -z "$DeviceID" ]; then
>>   echo "DeviceID failed to resolve.  There is something
              wrong."
>>   echo "Cowardly exiting.  Bummer, dude ..."
>>   echo ""
>>   exit 1
>>fi
>>
>>xinput set-prop $DeviceID "Device Enabled" 0
>>echo "touchpad mouse on device id $DeviceID has been
              disabled"
>>echo ""
>>
>>
>>
>>
>
>
>

Reply via email to