fix wandering Dell touchpad in Kubuntu

Alexander Smirnov alexander.v.smirnov at gmail.com
Wed Jul 9 14:33:44 BST 2008


Derek Broughton пишет:
> Alexander Smirnov wrote:
>
>   
>> Derek Broughton пишет:
>>     
>>> Alexander Smirnov wrote:
>>>
>>>   
>>>       
>>>> #!/bin/bash
>>>>
>>>> current=`synclient -l | grep TouchpadOff | awk 'BEGIN{FS="= "}{print
>>>> $2}'`
>>>>
>>>> if [ $current -eq 0 ]; then
>>>> synclient TouchpadOff=1;
>>>> else
>>>> synclient TouchpadOff=0;
>>>>
>>>>     
>>>>         
>>> There _must_ be a way to do that in one line :-)
>>>   
>>>       
>> not one line, but shorter than previous version :-)
>>
>> #!/bin/bash
>>
>> current=`synclient -l | grep TouchpadOff | awk 'BEGIN{FS="= "}{print $2}'`
>> synclient TouchpadOff=$(((1+$current)%2));
>>
>>     
>
> There you go then:
>
> synclient TouchpadOff=$(((1+$(synclient -l | grep TouchpadOff |
> awk 'BEGIN{FS="= "}{print $2}'))%2))
>
> (all, of course, on one line)
>
> Now, why did I want to do that????
>   
I suggest you to write a C/C++ program that hides all these terrible 
constructions :-D
and you will get what you want - just one executable for switching 
Touchpad on and off ;-)

here is next iteration, which is more shorter:
synclient TouchpadOff=$(((1+$(synclient -l | awk '"TouchpadOff" == $1 
{print $3}'))%2))



More information about the kubuntu-users mailing list