.xinitrc and related

~/.xinitrc

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

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

# detecting monitors - see ~/bin/dual-screen
/home/<my_username>/bin/dual-screen &>> $HOME/.xlog

# starting systray applets
wicd-client -t &>> $HOME/.xlog &
blueman-applet &>> $HOME/.xlog &
volumeicon &>> $HOME/.xlog &
numlockx &

#some x settings: keyboard speed, black bg, mouse pointerxset r rate 250 60 &
xset b off &
xsetroot -cursor_name top_left_arrow &

## updating the wmfs statusbar - see .config/wmfs/wmfs-status
## actually I do not use wmfs so it is commented out
#(while true; do wmfs -s "`.config/wmfs/wmfs-status`" ; sleep 5s ; done) &

# send notifications at low battery
(while true; do sleep 300s; /dev/shm/scripts/battwarning; done) &>> $HOME/.xlog &


# start screen autolock, needs xautolock, xlockmore, physlock and libnotyfy
# sleep 5 is for not starting everything at once
(sleep 5 ; xautolock -time 5 -locker "xlock -mode blank -startCmd 'physlock -l' -endCmd 'physlock -L' -background black -foreground white -mousemotion +usefirst -delay 500 -echokeys -echokey '.' -info 'Enter password to unlock.' +description" -notify 30 -notifier 'notify-send "System will lock in 30s"') &

#starting the window manager
exec ck-launch-session awesome &>> /$HOME/.xlog
#exec ck-launch-session wmfs




~/bin/dual-screen
 
#!/bin/bash

#Usage: "dual-screen" sets your laptop screen (LVDS1) as primary screen and the other display (HDMI1 or VGA1) on its right, "dual-screen l" is the same but left sided.


case $1 in
"l")
  position="--left-of";;
*)
  position="--right-of";;
esac
if [ `xrandr | grep -c ' connected '` -eq 2 ]; then # dual-monitor
    echo -n "Dual screen: "
    if [ `xrandr | grep VGA1 | grep -c ' connected '` -eq 1 ]; then
        echo "VGA1 +  LVDS1"
        xrandr --output VGA1 --auto --output LVDS1 --auto --primary $position VGA1
    fi
    if [ `xrandr | grep HDMI1 | grep -c ' connected '` -eq 1 ]; then
        echo "HDMI1 + LVDS1"
        xrandr --output HDMI1 --auto --output LVDS1 --auto --primary $position HDMI1
    fi
else
    echo "Single screen: LVDS1"
xrandr --output LVDS1 --auto --primary --output VGA1 --off --output HDMI1 --off
fi


No comments:

Post a Comment