LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-26-2004, 08:36 AM   #1
hellblade
Member
 
Registered: Jan 2004
Location: Greece
Distribution: Debian Sid
Posts: 58

Rep: Reputation: 15
Autorun after X starts.


How can I autostart a program after X starts? To be more specific I want to have some things executed as if I had done it manually using a console.

I am using KDM and almost always KDE but if it is possible I want things to run on all window managers.

The following are the ones I want to run:
Code:
imwheel -p -b "67"
xmodmap -e "pointer = 1 2 3 6 7 4 5"
I think there is some file (script) inside my home, which is executed everytime I login but I don't know which and how to insert things there.

PS1. Please tell me the exact way with as much as possible info because I'm newbie in linux.

PS2. I know the KDE way of drag 'n droping shortcuts in ~/.kde/Autostart/ folder but it's not what I am looking for.
 
Old 01-26-2004, 09:21 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Put those programs in a file called .xinitrc in your home directory. If that file doesn't already exist create it.
 
Old 01-26-2004, 09:30 AM   #3
hellblade
Member
 
Registered: Jan 2004
Location: Greece
Distribution: Debian Sid
Posts: 58

Original Poster
Rep: Reputation: 15
This file doesn't exist. Can you post the exact code it should have using the two commands I wrote in my first message?
 
Old 01-26-2004, 09:38 AM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Sure thing, I like to do full paths in files like this, but since I don't know the path to those files on your system I am going to /path-to-file/ to mean the path to the file. For instance, if imwheel is in /usr/bin you would change /path-to-file to /usr/bin:

.xinitrc:
Code:
/path-to-file/imwheel -p -b "67"
/path-to-file/xmodmap -e "pointer = 1 2 3 6 7 4 5"
We could get really fance and check to make sure the files exist before trying to run them, but I think this will do for now.
 
Old 01-26-2004, 09:56 AM   #5
hellblade
Member
 
Registered: Jan 2004
Location: Greece
Distribution: Debian Sid
Posts: 58

Original Poster
Rep: Reputation: 15
I create this file with this code:
Code:
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"
/usr/bin/imwheel -p -b "67"
but it doesn't work.
The programs are there because I can run them using the Konsole.
Shouldn't this file begin with something like #!/bin/bash?
 
Old 01-26-2004, 10:05 AM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
hmm, ya, suppose it should begin with #!/bin/bash
 
Old 01-26-2004, 12:36 PM   #7
hellblade
Member
 
Registered: Jan 2004
Location: Greece
Distribution: Debian Sid
Posts: 58

Original Poster
Rep: Reputation: 15
OK. Problem solved.
After trying lots of different files found one that works for me.
I created a file called .Xsession wich includes:
Code:
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"
/usr/bin/imwheel -p -b "67"
/usr/bin/x-session-manager
Thanks anyway!
 
  


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
Autorun when KDE starts?? coolblue Fedora 4 09-16-2005 06:53 PM
Autorun CD sureshkellemane Linux - Newbie 5 03-17-2005 08:04 PM
autorun apokryphos Linux - General 5 10-11-2004 10:43 AM
CD with Autorun Insomnia Linux - General 2 05-26-2004 07:19 AM
cd autorun Daem0hn Linux - General 0 07-22-2003 06:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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