LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Where to put start-up script to fix mouse? (http://www.linuxquestions.org/questions/slackware-14/where-to-put-start-up-script-to-fix-mouse-4175447751/)

andreas-r 01-29-2013 04:36 PM

Where to put start-up script to fix mouse?
 
I'm running Slackware 14 64bit as guest in VirtualBox with additions installed. I'm experiencing some weird mouse behavior similar to what is described here:

https://bbs.archlinux.org/viewtopic.php?id=145960&p=1

Well, in the above thread (treating the issue in Arch) someone mentions this workaround:

Code:

xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 0.5 0 0 0 0.5 0 0 0 1.0
xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 1.0 0 0 0 1.0 0 0 0 1.0

Running these two commands in the terminal actually fixes the issue.

Now my question: how do a make the commands run at start-up?

I've tried adding them to /etc/rc.d/rc.local after some stuff that virtual box additions wrote in, like this:

Code:

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

# Start vboxadd
# If you do not wish this to be executed here then comment it out,
# and the installer will skip it next time.
if [ -x /etc/rc.d/rc.vboxadd ]; then
    /etc/rc.d/rc.vboxadd start
fi

# Start vboxadd-service
# If you do not wish this to be executed here then comment it out,
# and the installer will skip it next time.
if [ -x /etc/rc.d/rc.vboxadd-service ]; then
    /etc/rc.d/rc.vboxadd-service start
fi

# Start vboxadd-x11
# If you do not wish this to be executed here then comment it out,
# and the installer will skip it next time.
if [ -x /etc/rc.d/rc.vboxadd-x11 ]; then
    /etc/rc.d/rc.vboxadd-x11 start
fi

xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 0.5 0 0 0 0.5 0 0 0 1.0
xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 1.0 0 0 0 1.0 0 0 0 1.0

But that doesn't work - the commands don't take effect like when run in the terminal. I would think that in important to run the commands after the VirtualBox stuff as this is what is being configured by the commands.

Any ideas on how to get the commands properly executed at start-up?

Thanks!

tuxbg 01-29-2013 04:47 PM

It's the same but try this.Create a file and put this

Code:

#!/bin/bash
xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 0.5 0 0 0 0.5 0 0 0 1.0
xinput set-prop "VirtualBox mouse integration" "Coordinate Transformation Matrix" 1.0 0 0 0 1.0 0 0 0 1.0

Create a cron job like that

crontab -e

and add this

@reboot path to script

Mike_M 01-29-2013 04:53 PM

xinput needs to be run from within X, and probably as the user running X. Therefore, adding the lines to /etc/rc.d/rc.local as you did will not do anything except probably throw an error on boot.

If you are starting Slackware in runlevel 3 (the default), you use "startx" to launch X. Add the "xinput" lines to your ~/.xinitrc file prior to the lines that start your DE. That should do the trick. Ask if you need more specific information.

andreas-r 01-29-2013 05:27 PM

Thanks! Adding the lines to ~/.xinitrc worked beautifully.

yunivor 06-26-2013 08:52 PM

Hi guys!

I have just installed LinuxMint on my VirtualBox and have the same problem, the code worked like a charm but I coult not make the commands run at startup.(I've never user the terminal before, even on windows) So I need more specific information on how to solve this problem.

DutchGeek 06-28-2013 12:32 PM

@yunivor:
pick your favourite text editor, then open .xinitrc which should be in your user's home directory (the dot means its hidden). Then just paste the lines there.
Cheers


All times are GMT -5. The time now is 04:31 PM.