Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to launch a program when X (not unity/gnome/etc) starts.

In particular, I want to launch xset r 105 when lightdm starts. Is there a way to do it? I tried writing this into ~/.xsessionrc:

xset r 105

but it didn't nothing.

share|improve this question
up vote 3 down vote accepted

You want to change one of these settings in /etc/lightdm/lightdm.conf:

# session-wrapper = Wrapper script to run session with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)

I think that display-setup-script is what you want to modify. Just set it to your script. Turn that xset command into an executable shell script and stick it into /usr/bin. Then the config file will be:

share|improve this answer
excellent, exactly what I was searching for. Many thanks! – akappa Nov 10 '12 at 21:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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