Blog do Julio

Hacks, tutoriais e dicas

Descobrir E Mudar Resolução

| Comments

Descobrir a resolução atual:

$ xdpyinfo  | grep 'dimensions:'

ou $ xrandr | grep ‘*’

Mudar a resolução:

Sem nenhuma configuração, meu awesome atribuia resoluções ruins para o monitor do meu notebook (LVDS1) e da TV ligada ao HDMI: julio@julio-acer ~> xrandr -q Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 293mm x 164mm 1366x768 60.0 + 1024x768 60.0 800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 160mm x 90mm 1920x1080 60.0 + 60.0
1280x1024 60.0
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0 59.9
720x400 70.1
DP1 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) TV1 unknown connection (normal left inverted right x axis y axis) 848x480 30.0 + 640x480 30.0 + 1024x768 30.0
800x600 30.0

Para consertar utilizei o seguinte comando: julio@julio-acer ~> xrandr - -output HDMI1 –auto julio@julio-acer ~> xrandr - -output LVDS1 - -auto

Como não preciso usar o monitor do notebook eu posso desligá-lo usando: $ xrandr - -output LVDS1 - -off

Scripts

xrandir

Salve o seguinte script em ~/Scripts/monitores e adicione ao .xinitrc: #!/bin/bash

EXTERNAL_OUTPUT="HDMI1"
INTERNAL_OUTPUT="LVDS1"
# EXTERNAL_LOCATION may be one of: left, right, above, or below
EXTERNAL_LOCATION="right"

case "$EXTERNAL_LOCATION" in
       left|LEFT)
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
               ;;
       right|RIGHT)
               EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
               ;;
       top|TOP|above|ABOVE)
               EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
               ;;
       bottom|BOTTOM|below|BELOW)
               EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
               ;;
       *)
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
               ;;
esac

xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
    xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION
else
    xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
fi

#END

Xorg

Outro modo é editar o /etc/X11/xorg.conf. Só que por algum motivo a segunda tela fica com resolução errada:

Section "Device"
    Identifier  "Card0"
    Driver      "intel"
    BusID       "PCI:0:2:0"
    Screen       0
EndSection


Section "Device"
    Identifier  "Card1"
    Driver      "intel"
    BusID       "PCI:0:2:0"
    Screen       1
EndSection


Section "Monitor"
    Identifier   "Televisao"
    Option       "Enable"    "true"
EndSection


Section "Monitor"
    Identifier   "Notebook"
    Option       "Enable"    "true"
EndSection


Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Televisao"
    DefaultDepth 24

    SubSection "Display"
        Depth     24
        Modes    "1920x1080" 
    EndSubSection
EndSection


Section "Screen"
    Identifier "Screen1"
    Device     "Card1"
    Monitor    "Notebook"
    DefaultDepth 24

    SubSection "Display"
        Depth     24
        Modes    "1366x768" 
    EndSubSection
EndSection


Section "ServerLayout"
    Identifier     "By Julio"
    Screen      0  "Screen0"
    Screen      1  "Screen1"
    Option    "Xinerama" "true"
EndSection

Mais informações:

Comments