dual monitor xinitrc configuration
just as the name says, this is a bit of my xinitrc file as used in a dual monitor evilwm setup.
a little about my setup:
Gentoo
evilwm (emerge x11-wm/evilwm)
SLiM Simple Login Manager (emerge x11-misc/slim)
conky lightweight system monitor (emerge app-admin/conky)
so when i first started using evilwm in a dual monitor setup i realized that i could not drag windows across monitors, which in all reality turned out to be awesome since it made me focus on how to properly optimize my setup for work.
so first thing i did was changed my slim.conf to start my xinitrc from /etx/X11/xinitrc/xinitrc since i am the only user of this machine and since i dont log in as root.
line from slim.conf to call xinitrc:
login_cmd exec /bin/bash -login /etc/X11/xinit/xinitrc
this could be changed to start a local xinitrc (~/.xinitrc) but whatever, thats up to the user.
now, the xinitrc file has all my basic stuff starting on each respective monitor. to find out which monitor is which just run xrandr (emerge x11-apps/xrandr or grab it from xorg)
here is output from xrandr monitor 0.0 (right):
$ xrandr
Screen 0: minimum 320 x 240, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
1680x1050 50.0*
1400x1050 51.0
1280x1024 52.0 53.0
1280x960 54.0
1152x864 55.0
1024x768 56.0 57.0 58.0
832x624 59.0
800x600 60.0 61.0 62.0 63.0
700x525 64.0 65.0
640x480 66.0 67.0 68.0 69.0
512x384 70.0 71.0
400x300 72.0
320x240 73.0 74.0
here is output from xrandr monitor 0.1 (left):
$ xrandr
Screen 1: minimum 320 x 175, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
1680x1050 50.0*
1400x1050 51.0
1280x1024 52.0 53.0
1280x960 54.0
1152x864 55.0
1024x768 56.0 57.0 58.0 59.0 60.0 61.0
960x720 62.0
928x696 63.0 64.0
896x672 65.0 66.0
832x624 67.0
800x600 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0
720x400 78.0
700x525 79.0 80.0
640x512 81.0 82.0 83.0
640x480 84.0 85.0 86.0 87.0 88.0 89.0
640x400 90.0
640x350 91.0
576x432 92.0
512x384 93.0 94.0 95.0 96.0 97.0
416x312 98.0
400x300 99.0 100.0 101.0 102.0 103.0
360x200 104.0
320x240 105.0 106.0 107.0 108.0
320x200 109.0
320x175 110.0
and here is a snippet from my xinitrc file:
/usr/bin/evilwm -snap 10 &
xsetroot -solid \#000000 -cursor_name crosshair -display :0.0
xsetroot -solid \#000000 -cursor_name crosshair -display :0.1
conky --display=:0.1 &
trayer --expand true --transparent true --alpha 255 --edge bottom --align right --expand true --SetDockType true --widthtype request --margin 130 --display=:0.0 &
setxkbmap -option terminate:ctrl_alt_bksp
xbindkeys &
DISPLAY=:0.0 /bin/bash scripts/work/random_images.sh &
DISPLAY=:0.1 /bin/bash scripts/work/random_images.sh &
ill try to explain it line by line:
/usr/bin/evilwm -snap 10 &
starts evilwm with a snap size of 10px
xsetroot -solid \#000000 -cursor_name crosshair -display :0.0
sets the background color and crosshairs per monitor (xsetroot cursors covered in a previous post)
xsetroot -solid \#000000 -cursor_name crosshair -display :0.1
conky --display=:0.1 &
starts conky on my left monitor (conkyrc as described in previous posts)
trayer --expand true --transparent true --alpha 255 --edge bottom --align right --expand true --SetDockType true --widthtype request --margin 130 --display=:0.0 &
starts my doc tray to minimize certain programs on the right monitor (emerge x11-misc/trayer)
setxkbmap -option terminate:ctrl_alt_bksp
sets my ctrl alt del to restart evilwm (xorg)
xbindkeys &
starts xbindkeys (x11-misc/xbindkeys) which launches gmrun (x11-misc/gmrun) bound to alt f2
DISPLAY=:0.0 /bin/bash scripts/work/random_images.sh &
using the DISPLAY variable to call my wallpaper scripts (from previous posts) per monitor
DISPLAY=:0.1 /bin/bash scripts/work/random_images.sh &
so with all this done, now when i log in i can just start any other misc programs that i need with my environment all set up.
Leave a Reply