#!/bin/bash base_startup="/home/user/bin/urxvtd_run &\nexec xscreensaver &\n" start_dwm="~/.dwm/dwmrc" start_openbox="/usr/bin/openbox-session" xinit="/home/user/tmp/xinitrc" if [ -n "$1" -a "$1" != "" ]; then wm=$1 else echo "Please select a window manager" read wm while [ "$wm" != "dwm" -a "$wm" != "openbox" -a "$wm" != "d" -a "$wm" != "o" ]; do echo "Please select a window mananger" read wm done fi case $wm in dwm | d ) echo -e "$base_startup" > "$xinit" && echo -e "$start_dwm" >> "$xinit";; openbox | o ) echo -e "$base_startup" > "$xinit" && echo -e "$start_openbox" >> "$xinit";; esac if [ ! -x $xinit ]; then chmod +x $xinit fi exec startx