Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to run a program everytime X logs in
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
sigfriedmcwild
n00b
n00b


Joined: 06 Sep 2003
Posts: 18

PostPosted: Fri Aug 19, 2005 12:33 pm    Post subject: How to run a program everytime X logs in Reply with quote

I need to run a program every time I log in into an X session.
I tried putting it into a ~/.xsessionrc or a ~/.xinitrc file but it doesn't run.

I'm using kdm as my display manager.
Back to top
View user's profile Send private message
evster
Guru
Guru


Joined: 12 Jul 2005
Posts: 367
Location: Waterloo, Ontario, Canada

PostPosted: Fri Aug 19, 2005 1:12 pm    Post subject: Reply with quote

What window manager are you using? Most wm's have their own way of starting things when they start up, so if you only use one wm this may be the way to go.
Back to top
View user's profile Send private message
Ariem
Apprentice
Apprentice


Joined: 13 Jun 2005
Posts: 296
Location: reykjavik

PostPosted: Fri Aug 19, 2005 1:17 pm    Post subject: Reply with quote

I'm not quite sure on this one, but if you place what you want to start in
Code:
/etc/X11/Sessions/<your_session>
you might get it.

As evster said, depending on which WM you use, you can make it by other ways.

HTH
Back to top
View user's profile Send private message
Corax
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 222
Location: Berlin, Germany

PostPosted: Fri Aug 19, 2005 1:33 pm    Post subject: Reply with quote

On most configurations, an entry in ~/.xinitrc will do it as well.

According to the standards from freedesktop.org, there should be a folder ~/Desktop/Autostart, that handles such things... You only need a window manager, that supports it.
_________________
There's no such priest //
that can pray me to heaven.
-- Nightwish, "Bare grace misery"
Back to top
View user's profile Send private message
sigfriedmcwild
n00b
n00b


Joined: 06 Sep 2003
Posts: 18

PostPosted: Fri Aug 19, 2005 2:30 pm    Post subject: Reply with quote

thx for the help, but none of the options above produces any results.
I normally use kde but I need some things (mouse configuration done xmodmap) to be carried out no matter who logs in in which window manager
Back to top
View user's profile Send private message
Corax
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 222
Location: Berlin, Germany

PostPosted: Fri Aug 19, 2005 3:14 pm    Post subject: Reply with quote

Are you aware of the fact, that ~/.xinitrc is a shell script and should be opened by a shebang (#! /bin/sh)? And that it needs executable rights?
_________________
There's no such priest //
that can pray me to heaven.
-- Nightwish, "Bare grace misery"
Back to top
View user's profile Send private message
sigfriedmcwild
n00b
n00b


Joined: 06 Sep 2003
Posts: 18

PostPosted: Fri Aug 19, 2005 3:21 pm    Post subject: Reply with quote

yes
In fact at the moment I'm running ~/.xinitrc manually everytime I log in

My .xinitrc script
Code:

#!/bin/bash

xmodmap /etc/X11/Xmodmap # I've created this file with the settings I need
imwheel -k -b "67"
Back to top
View user's profile Send private message
Jeremy_Z
l33t
l33t


Joined: 05 Apr 2004
Posts: 671
Location: Shanghai

PostPosted: Fri Aug 19, 2005 3:23 pm    Post subject: Reply with quote

sigfriedmcwild wrote:
thx for the help, but none of the options above produces any results.
I normally use kde but I need some things (mouse configuration done xmodmap) to be carried out no matter who logs in in which window manager


Try /etc/xprofile

I have it to do :
Code:
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim


And this get executed when X starts (like XDM/GDM/KDM/startx and not the WM) so it is fairly generic.
_________________
"Because two groups of consumers drive the absolute high end of home computing: the gamers and the porn surfers." /.
My gentoo projects, Kelogviewer and a QT4 gui for etc-proposals
Back to top
View user's profile Send private message
evster
Guru
Guru


Joined: 12 Jul 2005
Posts: 367
Location: Waterloo, Ontario, Canada

PostPosted: Fri Aug 19, 2005 4:01 pm    Post subject: Reply with quote

I notice a lot of people are having trouble when trying to run commands in ~/.xinitrc maybe someone could look into why this seems to be not working. I have always used fluxbox and so I just launch apps from ~/.fluxbox/startup but I will try the other files out to see if I can launch things from there.
Back to top
View user's profile Send private message
dwblas
Guru
Guru


Joined: 14 Jul 2003
Posts: 525
Location: Southern California (No jokes please)

PostPosted: Fri Aug 19, 2005 4:18 pm    Post subject: Reply with quote

I've been using ~/.xinitrc for years with no problems. If imwheel is an executable, you have to run it in the background, i.e. put an & at the end, otherwise the script will never start the windowmanager. I suspect that .xinitrc is not the script that you want to use because there isn't any command in it to start the window manager. KDE has something like startkde as the script for startup, so that is probably where you want to put your additions.
Back to top
View user's profile Send private message
seventhguardian
Apprentice
Apprentice


Joined: 10 May 2004
Posts: 261
Location: Portugal

PostPosted: Fri Sep 02, 2005 12:41 pm    Post subject: Reply with quote

And the answer is:

Code:
~/.xprofile


This way it's a user file (and not a system default). It's great for starting aim clients (like gaim) on every xsession.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum