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.
Asked
Active
Viewed 4,089 times
1 Answers
2
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;
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
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
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
# 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
fi
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.
Roland Smith
- 1,958
- 12
- 14