I wanted to install dwm according to this tutorial. I've skipped the part about Xorg, bc I knew it have been already installed at the time. I started with step about installing dwm. The desktop stopped booting after editing xinitrc, as described in the tutorial above I've commented special lines and added exec dwm line in xinitrc. I didn't manage to login because it freezes when I type my password, but I can log in "terminal mode", I mean via pressing Ctrl+Alt+F2. I've edited the xinitrc back using nano, i.e. uncommented lines and removed exec dwm line. My PC still freezes at logging stage.

My xinitrc is looking like this right now:



# 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"


if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ]; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 unset f

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login

Nothing is immediately obvious to me in this file. But here's a generic debugging tip which should lead you to the problem.

Just below the #!/bin/sh shebang line, add the following lines:

exec >~/"xinitrc-$DISPLAY.log" 2>&1
set -x

set -x turns on the shell's trace mode, so every command will be printed just before it's executed. The exec line redirects the log to a file in your home directory (adjust as desired).

Either you'll see the file grow very fast if there's an infinite loop somewhere, or it'll stop logging at the problematic command.

  • I don't see any logs in home directory. Also, will they be there if I'm using xinitrc from "/etc/X11/xinit/" not from "~/"? – pushandpop Jun 2 '15 at 10:55
  • @pushandpop No matter, you should see logs, as long as you're starting X with startx or xinit (if you use a display manager, xinitrc isn't executed, unless Arch has set up the X session start scripts to execute it from Xsession). – Gilles 'SO- stop being evil' Jun 2 '15 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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