I use my Pi (with raspbian) in two locations, at the desk I have a DVI-D monitor hooked to the HDMI output and in the livingroom there is a big old thick television using PAL composite.. I would like to automatically remove the borders that the TV needs when using the monitor and vice versa. As it is now I have to edit config.txt and reboot (i.e boot twice) every time I move the Pi from one room to the other.

How do I accomplish this?

2 Answers 2


You could automate the action suggested above with a script.

if /opt/vc/bin/tvservice -s | grep 'NTSC\|PAL'; then
  echo $(hostname) is running Composite
  echo $(hostname) is running hdmi

Replace the echo lines with the desired adjustments


Try adjusting the left and right margins using the fbset command:

fbset -left xxx -right yyyy

Where xxx is the left margin in pixels and yyy is the right margin in pixels.

fbset -left 0 -right 0

Should set the left and right margins to zero

I have used this command to change the screen resolution on my Pi using a Motorola Lapdock as my HDMI display.

  • Thanks, but this does nothing on my LCD(dvi-D) monitor when issued with sudo from an xterm..
    – Ronny
    Sep 8, 2013 at 20:46
  • What does fbset and tvservice -s show? Sep 9, 2013 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.