Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 start a few applications right after my wm (dwm) loads, where can I put my script so this happens? I'm on Ubuntu 12.04 LTS and using dwm.

share|improve this question

You can put customizations in a file called ~/.xinitrc. This is meant for when you start Xorg with the startx command. If you are running a display manager instead, you will need an ~/.xsession script instead.

According to the Ubuntu wiki page CustomXSession, you can just symlink those two files.

As an example, here is my ~/.xinitrc;



export XCURSOR_THEME=redglass

# Set language stuff
export LANG=en_US.UTF-8

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
if [ -f $userresources ]; then
    xrdb -merge $userresources

# set mouse accelleration parameters
xset m 3/1 4
# set keyboard repeat rate
xset r rate 200 60

# Allow local access to the X server.
xhost +local:

# Load my customizations.
if [ -f $usermodmap ]; then
    xmodmap $usermodmap
setxkbmap -option compose:rwin
pulseaudio --start
xstdcmap -best
Esetroot ~/.backgrounds/endurance_crater1920.png

# start the window manager. This _must_ be the last command
# and it _must_ be run with exec!
exec i3

You can add commands to this file before you run the window manager. You can put the commands in the background by appending ' &' to them.

share|improve this answer

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.