LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-29-2013, 04:36 PM   #1
andreas-r
Member
 
Registered: Jan 2013
Location: Denmark
Distribution: Ubuntu 12.10 & Slackware 14, 64bit
Posts: 46

Rep: Reputation: 0
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!
 
Old 01-29-2013, 04:47 PM   #2
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 249

Rep: Reputation: Disabled
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
 
Old 01-29-2013, 04:53 PM   #3
Mike_M
Member
 
Registered: Mar 2011
Location: California
Distribution: Slackware
Posts: 116

Rep: Reputation: 53
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.
 
Old 01-29-2013, 05:27 PM   #4
andreas-r
Member
 
Registered: Jan 2013
Location: Denmark
Distribution: Ubuntu 12.10 & Slackware 14, 64bit
Posts: 46

Original Poster
Rep: Reputation: 0
Thanks! Adding the lines to ~/.xinitrc worked beautifully.
 
Old 06-26-2013, 08:52 PM   #5
yunivor
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 06-28-2013, 12:32 PM   #6
DutchGeek
Member
 
Registered: Sep 2006
Distribution: SuSE, Slackware
Posts: 55

Rep: Reputation: 10
@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
 
  


Reply

Tags
mouse, script, startup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Put each daily cron task in a separate script or put them all in one script? veeruk101 Linux - Newbie 4 10-19-2011 07:10 AM
Can I put a image while kernel start???? webquinty Linux - Kernel 3 03-16-2009 12:17 PM
how I can fix my mouse theme Lasker Linux - Newbie 3 05-02-2005 08:39 PM
Put the fix for the most requested fixes for laptops on the front page and... t3gah LQ Suggestions & Feedback 1 03-21-2005 08:37 AM
Which rc.d file should I put 'adsl-start'? scatterbrain Linux - Newbie 1 03-27-2004 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration