2011-06-03 17:44:54 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# ~/.xinitrc
|
|
|
|
#
|
|
|
|
# Executed by startx (run your window manager from here)
|
|
|
|
|
2011-06-06 04:46:24 +00:00
|
|
|
# GENERIC #
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Usage: .xinitrc [window-manager] [session-type]
|
|
|
|
# where: window-manager is one of '(xmonad openbox stumpwm awesome pekwm)
|
|
|
|
# session-type is either "" or "remote"
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Set the default curson used by all WM's
|
|
|
|
xsetroot -cursor_name left_ptr
|
2012-01-12 09:19:15 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Initialize a local desktop session (run generic helper applications)
|
|
|
|
function init_local_session() {
|
|
|
|
# Setup monitors
|
|
|
|
xrandr --output DVI-I-1 --auto --output DVI-I-2 --auto --left-of DVI-I-1
|
|
|
|
|
|
|
|
# Start xscreensaver
|
|
|
|
xscreensaver -no-splash &
|
|
|
|
|
|
|
|
# Set a desktop background
|
|
|
|
nitrogen --restore &
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Have mouse pointer hide after 5 seconds
|
|
|
|
unclutter &
|
|
|
|
|
|
|
|
# Setup system tray *DISABLED* :: whats the point of a systray if no apps use it?
|
|
|
|
#trayer --monitor 1 --edge top --align right --expand true --width 4 --height 2 --transparent true --tint 0x000000 &
|
|
|
|
|
|
|
|
# Use xbindkeys to bind media keys etc..
|
|
|
|
xbindkeys &
|
|
|
|
|
|
|
|
# Start pulseaudio
|
|
|
|
#start-pulseaudio-x11 &
|
|
|
|
|
|
|
|
# Start-up applications
|
|
|
|
#parcellite &
|
|
|
|
emacs --daemon &
|
|
|
|
urxvtd --quiet &
|
|
|
|
xcompmgr &
|
|
|
|
|
|
|
|
# Create variable GENERAL_SCREEN which is the pid of a screen called "general"
|
|
|
|
export GENERAL_SCREEN=`screen -ls | grep general | cut -f1 -d'.' | sed 's/\W//g'`
|
|
|
|
|
|
|
|
# Check to see if a general screen is already running
|
|
|
|
if [ "x$GENERAL_SCREEN" == "x" ]; then
|
|
|
|
screen -dmS general &
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set the default wm to xmonad
|
|
|
|
DEFAULT_WM=xmonad
|
|
|
|
}
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Initialize a remote desktop session (run generic helper applications)
|
|
|
|
function init_remote_session() {
|
|
|
|
# Set desktop background
|
|
|
|
feh --bg-scale ~/.wallback/Cocaine_Wallpaper_II_by_mdornfeld.png &
|
|
|
|
|
|
|
|
# Set the default wm to xmonad
|
|
|
|
DEFAULT_WM=stumpwm
|
|
|
|
}
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Check the second cl parameter which denotes the session-type (E.g. remote, local)
|
|
|
|
case $2 in
|
|
|
|
# Remote session
|
|
|
|
remote)
|
|
|
|
init_remote_session
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
# Local session or unspecified
|
|
|
|
*)
|
|
|
|
init_local_session
|
|
|
|
;;
|
|
|
|
esac
|
2011-06-03 17:44:54 +00:00
|
|
|
|
2012-07-12 07:25:55 +00:00
|
|
|
# Check the first cl parameter which denotes the window-manager to use
|
|
|
|
# Notice: in each case expression below "exec app" hands over execution to some app thus
|
|
|
|
# ceasing execution in this script so no "break" is required
|
2011-06-03 17:44:54 +00:00
|
|
|
case $1 in
|
|
|
|
xmonad)
|
|
|
|
exec xmonad
|
|
|
|
;;
|
|
|
|
openbox)
|
|
|
|
exec ck-launch-session openbox
|
|
|
|
;;
|
|
|
|
stumpwm)
|
|
|
|
exec stumpwm
|
|
|
|
;;
|
2012-07-12 07:25:55 +00:00
|
|
|
awesome)
|
|
|
|
exec awesome
|
|
|
|
;;
|
|
|
|
pekwm)
|
|
|
|
exec pekwm
|
|
|
|
;;
|
2011-06-03 17:44:54 +00:00
|
|
|
*)
|
2012-07-12 07:25:55 +00:00
|
|
|
exec $DEFAULT_WM
|
2011-06-03 17:44:54 +00:00
|
|
|
;;
|
|
|
|
esac
|