1

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?

2 Answers2

6

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).

Massimo
  • 68,714
  • 56
  • 196
  • 319
1

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

Your question is very similar to this one here.

jmort253
  • 449
  • 6
  • 12