I'd like to run a script in init.d (on Fedora) in the context of the user session I'm logging in as.

I have a script called keyboard_deadkeys I wrote to set some deadkeys on my keyboard. The script is very simple:

#!/bin/bash
/usr/bin/xmodmap /home/julie/keymappings

I put it in the directory /etc/init.d so it will run at boot time. It is also in /etc/rc.d/init.d

I changed the permissions to a+rwx for good measure.

When I boot; the deadkeys aren't set in the user's session. When I then run the script manually; the keys are set.

How can I rectify this?

link|improve this question
feedback

2 Answers

up vote 6 down vote accepted

If you run the script at boot time, when no one is logged in, how could it modify anything in the user's session? :-)

You should run it from your .bash_profile startup script (or from /etc/profile, to run it for every user in the system).

link|improve this answer
feedback

http://superuser.com/questions/125165/local-user-login-script-fedora-linux

Your question is very similar to this one here.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.