Skip to Content

Dot xinitrc

Posted on

File ~/.xinitrc is read by xinit and by its front-end startx. I create the file in my home directory and set it up to look for a few optional config files, disable screen blanking, clear out the trash, launch applications, and finally start the desktop.

Let’s go!

Set config parameters for X client applications …

if [ -f ~/.Xresources ]; then
    xrdb -merge ~/.Xresources

Bind commands to certain keys or key combos …

if [ -f ~/.xbindkeysrc ]; then

Modify key mappings …

if [ -f ~/.xmodmap ]; then
    xmodmap ~/.xmodmap

Disable DPMS and turn off screen blanking …

xset s off -dpms

Summon the janitor …

if [ -d ~/.local/share/Trash ]; then
    rm -rf ~/.local/share/Trash/*

Launch applications:

  • dldsply - enable|disable extended desktop using XRandR
  • trackpointconf - configure my ThinkPad USB Keyboard TrackPoint
  • nm-applet - graphical client for Network Manager
  • volnoti - lightweight volume notification daemon
  • urxvt - terminal
~/bin/dldsply -r &
~/bin/trackpointconf &
if [ -x /usr/bin/nm-applet ]; then
    nm-applet &
volnoti -t 2 &
urxvt &

Start the window manager

exec i3

Source: .xinitrc

Happy hacking!