Skip to content

Instantly share code, notes, and snippets.

@tiagox
Created December 1, 2013 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagox/7740788 to your computer and use it in GitHub Desktop.
Save tiagox/7740788 to your computer and use it in GitHub Desktop.
Este script es utilizado para agregar la resolución de 1368x768 en sistemas GNU/Linux, para salidas de video VGA. Basado en el post: http://misnotaslinux.blogspot.com/2011/06/debian-60-y-resolucion-de-pantalla.html
#!/bin/sh
# Este script es utilizado para agregar la resolución de 1368x768 en sistemas
# GNU/Linux, para salidas de video VGA.
# http://misnotaslinux.blogspot.com/2011/06/debian-60-y-resolucion-de-pantalla.html
# String de configuración del ModeLine.
MODELINE_NAME=`gtf 1366 768 60 \
| grep Modeline \
| awk '{ print $2 }' \
| sed 's/\"//g'`
MODELINE_CONFIG=`gtf 1366 768 60 \
| grep Modeline \
| awk '{ print $3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12" "$13 }'`
# Nombre del puerto VGA local.
VGA=`xrandr | grep VGA | awk '{ print $1 }'`
# Primero borramos el modo en caso de que exista.
xrandr --rmmode $MODELINE_NAME
# Creamos la resolución.
xrandr --newmode $MODELINE_NAME $MODELINE_CONFIG
# Agregamos la resolución a la salida por VGA.
xrandr --addmode $VGA $MODELINE_NAME
@cristianrasch
Copy link

Yo lo resuelvo fácil con dos alias de bash :)

alias dual-monitor-on='xrandr --output LVDS1 --preferred --primary --output HDMI1 --preferred --right-of LVDS1'
alias dual-monitor-off='xrandr --output LVDS1 --preferred --primary --output HDMI1 --off'

(LVDS1 es el monitor de la laptop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment