You are not logged in.

#1 2007-06-01 05:35:28

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Best way to start KDE automatically and have the .xinitrc script run?

I've noticed that when I use the daemon and inittab methods of loading KDM automatically, my .xinitrc script isn't being executed at logon.

I'm trying to automate the hotkeys on my  notebook, but the ~/.Xmodmap file will only load if I run xmodmap manually.  For some reason the .xinitrc isn't being called.


thayer williams ~ cinderwick.ca

Offline

#2 2007-06-01 05:49:47

dawei
Member
From: China
Registered: 2007-05-02
Posts: 29

Re: Best way to start KDE automatically and have the .xinitrc script run?

Did you give .xprofile a try?

Offline

#3 2007-06-01 07:36:24

mitsoko
Banned
From: In the Coal Chamber
Registered: 2007-05-08
Posts: 143

Re: Best way to start KDE automatically and have the .xinitrc script run?

are you sure it doesn't run from /etc/rc.local
also kde has autostart support .. it should be in the control(config?) center somewhere ; either way ( i assume it's the same format as gnome/xfce[~/.config/autostart]) you can add a desktop enty to ~/.kde/Autostart

example of desktop file

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Icon[en_GB]=/usr/share/pixmaps/apple-red.png
Name[en_GB]=App
Exec=/usr/bin/app
Name=App
Icon=/usr/share/pixmaps/apple-red.png

Offline

#4 2007-06-01 09:27:08

n8schicht
Member
From: Südbaden
Registered: 2006-12-27
Posts: 138
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

I put this in ~/.kde/Autostart

#! /bin/sh
xmodmap $HOME/.Xmodmap

Never had a problem with it, works like a charm...

Offline

#5 2007-06-01 14:42:02

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

Thanks for the tips regarding KDE's autostart.  I may end up using those, however I would rather use the standard configs that are meant for these kind of things.

Is it not being executed simply because I'm not launching KDE from a console with startx?


thayer williams ~ cinderwick.ca

Offline

#6 2007-06-01 15:13:43

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

The Autostart suggestion worked, however it has the obvious limitation that it will only work if I'm running KDE.  But at least I have something until I find a better solution.

I haven't tried the /etc/rc.local suggestion yet, however I don't see that as working either, since it is executed after the boot process but before anyone logs in, correct?  This would mean X wouldn't be loaded yet and a specific user's path wouldn't be defined.  rc.local does work however for the setkeycodes scripts I have running.


thayer williams ~ cinderwick.ca

Offline

#7 2007-06-01 15:32:36

damjan
Member
Registered: 2006-05-30
Posts: 452

Re: Best way to start KDE automatically and have the .xinitrc script run?

As dawei already said $HOME/.xprofile it's DE neutral and will be sourced before any DE is started by the login manager.

This is my .xprofile:

export LANG=mk_MK.UTF-8
export PATH=$PATH:$HOME/bin
export GTK_IM_MODULE=xim

eval `ssh-agent`
ssh-add
setxkbmap gb,mk -option grp:switch -option grp:menu_toggle \
        -option compose:rwin -option grp_led:scroll

xmodmap -e "pointer = 1 2 3 6 7 4 5"
gensig -a /usr/share/gensig/taglines

and my .xinitrc is:

#!/bin/sh
source $HOME/.xprofile
exec startkde

Offline

#8 2007-06-01 19:19:06

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

damjan & dawei:  The problem is that .xinitrc isn't being executed when I log in, so it does me little good to have a shell script loaded from .xprofile if .xprofile isn't being loaded in the first place.

The KDE Autostart does work if I call the xmodmap script from there, but I'd rather figure out why .xinitrc isn't being called.

Last edited by thayer.w (2007-06-01 19:20:06)


thayer williams ~ cinderwick.ca

Offline

#9 2007-06-02 02:27:18

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Best way to start KDE automatically and have the .xinitrc script run?

added
/usr/bin/xmodmap ~/.Xmodmap
xbindkeys

to ~/.bashrc

simply works (I have @kdm added to DAEMONS=(..) of rc.conf if this will help)

no problems

Last edited by broch (2007-06-02 02:28:37)

Offline

#10 2007-06-02 04:42:31

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

Thanks, broch... I thought .bashrc was only executed when the terminal was opened, but I'll give that a shot too!


thayer williams ~ cinderwick.ca

Offline

#11 2007-06-02 21:46:55

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Best way to start KDE automatically and have the .xinitrc script run?

Okay, this is driving me nuts!  I stand corrected on a couple of things:

.bashrc and .xprofile DO get executed when I log into KDE.

However, for whatever my xmodmap settings are not working when placed into these scripts.  If I copy/paste the line from the scripts into a console, the key mappings word as intended:

xmodmap ~/.Xmodmap

I've also tried using an absolute path for xmodmap and an absolute path for the .Xmodmap file... neither run automatically.  Is it possible that something else is loading x mappings after my own script is executed, thus overwriting my settings?  I do not have keyboard layouts enabled in kcontrol.


thayer williams ~ cinderwick.ca

Offline

#12 2007-06-08 21:40:23

aris002
Member
From: London, UK
Registered: 2004-03-21
Posts: 75

Re: Best way to start KDE automatically and have the .xinitrc script run?

thayer.w wrote:

...
Is it possible that something else is loading x mappings after my own script is executed, thus overwriting my settings?  ....

I think you can test it with something like that:

1. make those 2 lines in your .profile  (or in whatever your *rc file)

xmodmap ~/.Xmodmap 2>XmodErrors.log      #check if executed
xmodmap -pke >~/XmodKeys1.log            #to check the keys

2. Execute after login:

xmodmap -pke >~/XmodKeys2.log

3. Compare XmodKeys1.log and XmodKeys2.log

If they are different then look for the culprit... smile
Then..., also have a look at files in the /etc/X11/xinit folder. e.g xintrc contains:

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

Btw, my vote goes against kdm daemon. I use inittab, compiled autologin, dissabled root, auto su, sometimes kdm and gdm in parallel with various DM also parallel. Surprisingly the speed improves smile

Offline

#13 2007-06-20 11:44:39

olegnitz
Member
Registered: 2007-06-20
Posts: 18

Re: Best way to start KDE automatically and have the .xinitrc script run?

Hi!

I've got the similar problem: kdm doesn't execute even /etc/profile script, so than LANG and PATH variables remain unset.
My solution is: edit the /opt/kde/share/config/kdm/Xstartup file, add there something like

. /etc/profile

in my case, or

. ~/.xinitrc

in yours.
HTH.

Offline

Board footer

Powered by FluxBB