LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-27-2004, 03:02 PM   #1
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Rep: Reputation: 15
Run a script at startup


Hi,

I need to run

#! /bin/sh
xmodmap -e "pointer = 1 2 3 6 7 4 5"

At start up. At the mo I have to type it in manually. Where can I add it?

I am running SuSE 9.1

Thanks
 
Old 08-27-2004, 03:09 PM   #2
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
I'm not as familiar with SuSE as I am with a few other distributions. I think there should be a file named, "/etc/rc.d/boot.local." Correct me if I'm wrong here anyone. (I'm kinda getting used to BSD here.) You should be able to append this at the end of the file, inside of that file.

Good luck.
 
Old 08-27-2004, 03:13 PM   #3
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
You probably don't want to run that script at startup, because it interacts with your X session.

Instead, put that xmodmap line to your
~/.xsession
file.
 
Old 08-27-2004, 03:25 PM   #4
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Original Poster
Rep: Reputation: 15
Thank you for you reply, but I can't find .xsession and yes I do have show hidden files enabled. It should be in my /home/username/ folder right?
 
Old 08-27-2004, 03:32 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Well, yes and no. It doesn't necessary exist by default, so just creating a file of that name and putting that line (and restarting X) should do it.
 
Old 08-27-2004, 03:35 PM   #6
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
Sorry for the misleading answer. I see what you're getting at now. ToniT nailed it on the head though.
 
Old 08-27-2004, 03:44 PM   #7
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Original Poster
Rep: Reputation: 15
Thats ok,

anyway in my /home/iaross/ folder I created a new .xsession file, as I didn't have one, and entered
Code:
xmodmap -e "pointer = 1 2 3 6 7 4 5"
However, when I logged out and logged in, the screen would flash up the init 3 window (the one you see on startup when you press Esc or F2) then went blank, flashed up the NVIDIA logo, then returned to the login screen. I had to log in as root and delete the .xsession file to be able to log in as me.

What did I do wrong?

Thanks for the speedy replies by the way....
 
Old 08-27-2004, 03:53 PM   #8
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Probably nothing.

My mistake (well, actually that is distribution spesific thingy, but anyways).
It seems that when .xsession -file exists it[The X session initializer] assumes that you want to control the initialization of X session by yourself and so it doesn't start a window manager automaticly, but just runs that xmodmap line there and exits.

So, to circumvent the issue, try putting also a line "startkde" after the xmodmap line.
 
Old 08-27-2004, 04:03 PM   #9
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Original Poster
Rep: Reputation: 15
Worked a treat. Thank you for your time. Give yourself a pat on the back!

I've now got the side buttons and wheel operating properly on my mouse.
 
  


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
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
Run Script at Startup?? usaf_sp SUSE / openSUSE 5 11-11-2005 01:43 PM
get a script to run on startup kram Debian 3 04-23-2005 02:23 PM
run script at startup in suse 8.2 cephlon Linux - General 6 05-22-2004 01:35 AM
How to run script on startup Angelis Linux - General 1 11-16-2003 05:45 AM


All times are GMT -5. The time now is 09:51 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration