Skip to content

Instantly share code, notes, and snippets.

@asm89
Created June 4, 2013 07:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asm89/5704166 to your computer and use it in GitHub Desktop.
Save asm89/5704166 to your computer and use it in GitHub Desktop.
.xinitrc detecting and enabling right amount of monitors and awesome configuration
# switch to dvorak, set key repeat etc
/home/alexander/.fixkb
# Add local fonts
xset fp+ /usr/share/fonts/local &
## Gnome keyring
source /etc/X11/xinit/xinitrc.d/30-dbus
eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets)
# You probably need to do this too:
export SSH_AUTH_SOCK
export GPG_AGENT_INFO
export GNOME_KEYRING_CONTROL
export GNOME_KEYRING_PID
# Check the amount of monitors
monitor_count=$(xrandr | grep connected | grep -v disconnected | wc -l)
if [ $monitor_count -eq 3 ];
then
# it equals three, we're at work!
xrandr --output LVDS --mode 1600x900
xrandr --output DisplayPort-2 --primary --mode 1920x1200 --left-of LVDS
xrandr --output DisplayPort-1 --mode 1920x1200 --left-of DisplayPort-2
awesome --config /home/alexander/.config/awesome/rc.3.lua
elif [ $monitor_count -eq 2 ];
then
# assume at home
xrandr --output LVDS --mode 1600x900
xrandr --output DisplayPort-2 --primary --mode 1920x1200 --left-of LVDS
awesome --config /home/alexander/.config/awesome/rc.2.lua
else
awesome
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment