Copying and pasting text w/ mouse

Charles Howse chowse at charter.net
Fri Aug 15 19:39:36 PDT 2003


> Here's a thought. What happens when you switch away then switch back 
> kill moused then restart moused? I'm thinking that maybe a cron job 
> could be created to check mouse states and kill then restart moused.

Very interesting...

#!/usr/local/bin/bash
# Kill and restart moused

ps -wax | grep moused > /dev/null 2>&1
if [ $? -eq 0 ] ; then
    m=`ps -wax | grep moused | cut -d" " -f3`
    kill $m
    if [ $? -eq 0 ] ; then 
	echo "Killed mouse daemon"
    else
    	echo "Unable to kill mouse daemon"
	exit
    fi
fi
moused -p /dev/psm0 -t auto
if [ $? -eq 0 ] ; then
    echo "Restarted mouse daemon successfully"
else
    echo "Unable to restart mouse daemon"
fi


This works in principle, but I have to do it 4 or 5 times after
switching back from windows.
Any time I move the mouse, things go haywire, until I finally reset it
enough times.
I'm satisfied for the time being, thanks for the suggestion, and thanks
to everyone who replied!




More information about the freebsd-questions mailing list