fix wandering Dell touchpad in Kubuntu
Derek Broughton
news at pointerstop.ca
Wed Jul 9 12:24:22 UTC 2008
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????
--
derek
More information about the kubuntu-users
mailing list