LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2012, 03:43 AM   #1
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: openSUSE
Posts: 1,465
Blog Entries: 6

Rep: Reputation: 200Reputation: 200Reputation: 200
How do i have a script automatically launched on startup


Hello, i've been trying to figure this out for about three hours now and just can't. I am running Debian Wheezy on my thinkpad. I am trying to configure the middle button to scroll with the trackpoint. I've been to the think wiki and have grabbed this script.
Code:
#!/bin/sh
xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
                xinput set-int-prop $id "Evdev Wheel Emulation Button" 8 2
                xinput set-int-prop $id "Evdev Wheel Emulation Timeout" 8 200
                xinput set-int-prop $id "Evdev Wheel Emulation Axes" 8 6 7 4 5
                xinput set-int-prop $id "Evdev Middle Button Emulation" 8 0
                ;;
        esac
done

# disable middle button 
xmodmap -e "pointer = 1 9 3 4 5 6 7 8 2"
If i put this in my .bashrc file it works but only when i launch the terminal. I would like it to run automatically. I'm under the impression that this is done with /etc/rc.local, but i've not much clue about rc.local. made the rc.local file executable but don't know what to put in there to have this bloody script launch. I think wheezy uses systemd? Here is the contents of my rc.local file at the moment.
Code:
#!/bin/sh -e
#
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
Please help me get my script to launch automatically.

Last edited by Knightron; 07-08-2012 at 03:45 AM.
 
Old 07-08-2012, 03:59 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
You can't use rc.local due using command "xinput" which need access to X server. You must add it to X session starting script. For example in "/etc/X11/Xsession.d" But it may depends on used desktop environment - KDE and as I think Gnome has appropriate configuration options for autostarting programs. So specify which one you use.
 
1 members found this post helpful.
Old 07-08-2012, 04:15 AM   #3
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
You should put those evdev options in a dedicated file inside /etc/X11/xorg.conf.d or inside a /etc/X11/xorg.conf file.
For the xmodmap command you may want to look at the ButtonMapping option for the evdev X input driver.
See man evdev for the syntax and other details.
 
1 members found this post helpful.
Old 07-08-2012, 07:16 PM   #4
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: openSUSE
Posts: 1,465

Original Poster
Blog Entries: 6

Rep: Reputation: 200Reputation: 200Reputation: 200
Gday guys, thanks for your helpful suggestions. I took your advice and then cheated. I've found Opensuse to have the best hardware detection i've seen: it was like it had a profile for my laptop or something. Everything worked perfectly in Opensuse; so i did some experimenting with what you guys said in mind, and mounted my Opensuse partition and then copied the xord.d file over to my Debian partition and rebooted. My Debian partition now works as flawlessly as my Opensuse partition. Thanks guys.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] How to run 'script' automatically on Konsole/Yakuake startup/new tab? klearview Linux - Software 7 11-29-2011 07:10 PM
start own script during the startup automatically cccc SUSE / openSUSE 11 03-13-2006 03:40 PM
KsCD/Kaffeine are launched automatically when inserting CDs/DVDs dreamtheater Linux - Software 1 01-03-2006 07:23 AM
Script to automatically config eth0 at startup jhachey Linux - Networking 2 11-03-2003 02:06 AM
How can the linux OS run script automatically at startup? tommylkc Linux - Newbie 1 06-26-2002 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:40 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