Display cloning on Linux — xrandr1.2 and xorg-driver-ati

Following a few notes on the new way on Debian GNU/Linux to clone a notebook screen to an external video device. First please note there are already documents available on the background of it. Not necessarily Debian related: two links for that:


For the latest news on the software please see the xorg-driver-ati archives on


The hints here are meant for Debian Linux, and for the new ati radeon driver. The following from playing the software on an Apple PowerBook5,8. Display managing was done with KDE/KDM. Here’s xorg.conf I have installed. Please note, that these drivers are work in progress. Their behavior sometimes seems to be completely unpredictable. So the following few hints on how to use them do not necessarily take into account the intentions of the programmers of this software. That is the following procedures were found to work. No guarantees they’re right, whatsoever.

Help – if things go wrong

If you’re running into problems with the software please make sure – before changing anything like suggested below – that you have a second Linux driven computer handy to ssh into the machine with the changed radeon drivers. Make sure you can shutdown your computer safely via an ssh connection.
First a few basics on X on a friendly Apple page :


The page above might help understand the following few emergency commands:

*** 1:
If you need to run xrandr on a remote computer via ssh – for example to switch on or off its display – you need to login to this computer with the 'Y' flag, something like

ssh -Y xxx.xxx.xxx.xxx

where the xxx … part above is the IP of the remote client

*** 2:
If you now run on the remote client ‘xrandr -q’ it might yield the values for the computer where you were coming from. This indicates you won’t be able to change display settings for this remote client. So run this, on the remote machine:


If your shell is answering with something like


you probably will need to change that. Run

export DISPLAY=:0

Again running ‘echo $DISPLAY’ this time should give something like


So, e.g. if the notebook display on the remote client was shut down accidentally, with the now changed $DISPLAY environment it should be possible to switch it on again with something like:

xrandr –output LVDS –auto

Brice Goglin
Xavier Bestel

Getting the software

This seems to be a definite preliminary:

  • xrandr1.2 (can be checked with a ‘xrandr -v’) and a
  • xserver-xorg-video-ati 6.7.19x and newer

xrandr1.2, e.g., comes on Debian unstable with newer x11-xserver-utils packages.

And a relatively fresh Debian from the unstable branch might be needed, too.

There’s also an option to compile the necessary ati drivers by yourself. Not quite necessarily the Debian way:

apt-get build-dep xserver-xorg-video-ati
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-ati
cd xf86-video-ati/
MAKEFLAGS="CC=gcc-4.3" make

You might even try to just compile what you need, with the last line above changed to something like

MAKEFLAGS="CC=gcc-4.3" make -C src {ati,radeon}_drv.la

gcc-4.3 is the compiler I would use.
After the succeeded compile, for a PowerBook5,8 it should be enough to just manually copy those resulting drivers:

  • ati_drv.so
  • radeon_drv.so



Be careful: If you are in a running X session don’t copy these new drivers with the usual 'cp': If you do you might get thrown out of your X very ugly, with the keyboard being unavailable for further use. I recommend to either log out of X completely, and then copy the mentioned drivers to


Even better perhaps the solution I was told, something like

cp –remove-destination <your driver> /usr/lib/xorg/modules/driver

Cloning your screen

Two scenarios for the notes following:

  • Connecting the notebook to an external VGA
  • Connecting the notebook to a TV set

Cloning the notebook screen both to VGA and TV works.

Connecting the notebook to an external TV monitor

At least with xorg packages on Debian unstable/powerpc software is getting installed, that enables screen cloning to an external PAL TV monitor, in color mode. This is accomplished here via the S-Video connector on the computer.

Please note the Debian/unstable/ppc packages being used for screen cloning to a TV set as reported here, have been fresh as of around June 10 2008.

A color video as being played here with mplayer on the laptop, seen on the telly, if the LCD is switched off:

(The girl is Kellemarie, from a video that was available via http://www.goodmagazine.com/section/Transparency/Internet_Porn – and no, it’s no porn video … :)

Cloning was done like along the line of that:

xrandr –output S-video –set load_detection 1

xrandr –output S-video –set tv_standard pal

xrandr –addmode S-video 800×600

xrandr –output S-video –off

xrandr –output S-video –mode 800×600

Seems one can omit step 4.

An S-video to composite adapter was used (see http://www0.info.apple.com/images/kbase/33001/33001_23.gif for more), which was connected via an adapter to a SCART cable. The latter connected to a rather cheap 800×600 PAL color TV set. I’m no sure whether this device is really an 800×600 one. But at least it works with these values given to xrandr.

Sound for the movie was played on the notebook, due to the fact the audio out connector on the Apple PowerBook is not installed near the S-video out port on the same side of the machine, but on the opposite one. Which leaves the audio adapter cable, that is connected to the SCART cable to the TV set, too short to reach the audio out port.

Note: to get the complete LCD screen to the external screen (VGA or TV-set): I switch off my LCD:

xrandr –output LVDS –off

and after that the screen on the VGA/TV is complete. On the TV-set, that is, nearly complete: its corners are rounded, contrary to the LCD, where they’re angular.

Connecting the notebook to an external VGA

Two scenarios are being discussed here:

  • Setting the LCD screen to the largest possible common mode with the VGA
  • Setting the VGA to its largest mode

The first option implies the possibility of having both screens switched on, with the drawback of a somewhat reduced picture quality at least for the now lower moded LCD screen, where fonts now look fuzzy, and the whole screen is considerably smaller. That is, the LCD picture is looking a bit ugly now. Please have a look at the output of "xrandr -q" below for the highest possible common mode for both screens, which in that case is "1280 x 800"
These are the commands executed on the notebook:

xrandr –output LVDS –mode 1280×800
xrandr –output DVI-0 –auto


$ xrandr -q
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 2720 x 1024
LVDS connected 1280×800+0+0 (normal left inverted right x axis
y axis) 321mm x 214mm
1440×960 59.9 +
1280×800 60.0*
1280×768 60.0
1024×768 60.0
800×600 60.3
640×480 59.9
DVI-0 connected 1280×1024+0+0 (normal left inverted right x axis
y axis) 300mm x 225mm
1280×1024 60.0*
1280×960 59.9
1280×800 60.0
1280×768 60.0
1024×768 85.0 84.9 75.1 70.1 60.0
800×600 84.9 85.1 75.0 60.3
640×480 85.0 84.6 75.0 60.0 59.9
720×400 70.1
S-video connected (normal left inverted right x axis y axis)
800×600 59.9 + 60.3

Please note that the VGA is in its highest possible mode, i.e. '1280×1024', while the notebook screen is not.

If you don’t like the reduced mode on your notebook screen, simply switch it off while the VGA attached to it is on. This latter approach might also be useful if parts of the LCD display are missing on the VGA.

Please note there’s much more you might want to try with this new driver. Please ask a search engine on that, something like this, perhaps …
'man {xrandr,radeon}' might be useful, too.

Michel Dänzer
Brice Goglin
Xavier Bestel
Everyone out there who made this new software possible



Muttprint is a tool to print an email message in mutt: The documentation – at least here on Debian/unstable, and as of today – in some important sections seems to be a bit useless. That’s why you’re here, right … :) … ?

For example this setting in ~/.muttrc that is recommended in
is useless here:

# Dump all headers
macro index p "<display-toggle-weed> <print-message> <display-toggle-weed> <exit>"
macro pager p "<display-toggle-weed> <print-message> <display-toggle-weed>"

Well: wrong, I was lying: the documentation mentioned above says, just a few words later, to set

# No confirmation before printing
set print="yes"

If you have this last line in your ~/.muttrc chances are good that things go well for mutt printings … Problem with this setting: printing seems to start immediately, without confirmation, after typing 'p' in mutt. Here’s a nice workaround for that:

Simply direct the print-out to your favorite gv viewer. I use 'kghostview' for it. So the necessary setting for that would be something like this in ~/.muttprintrc:

PRINT_COMMAND="kghostview – "

Leaving away the hyphen in the line above might yield an empty page …

Please see my complete ~/.muttprintrc near the end of this post.

Note that in ~/.muttprintrc some options set to the "PRINTED_HEADERS=" line seem to get ignored in the actual print-out. Don’t ask me why, because I don’t get that …

Here’s what might be necessary for your ~/.muttrc, too :

set print_command="muttprint"
set print_split

So with the settings mentioned here, to print an email it should be enough to open it, then maybe toggling the display of headers or not by typing 'h', and then 'p' for the actual preview …

Result: Reading the available documentation for muttprint on Debian, added to the few hints from here should give you nice prints from within mutt. … :)

Following the mentioned config settings in one place. Relevant lines in ~/.muttrc:

#### muttprint:
set print_command="muttprint"
set print_split

# Dump all headers
macro index p "<display-toggle-weed> <print-message> <display-toggle-weed> <exit>"
macro pager p "<display-toggle-weed> <print-message> <display-toggle-weed>"

# No confirmation before printing
set print="yes"

And here comes ~/.muttprintrc:

# MUTTPRINT configuration file
# ~/.muttprintrc or /etc/Muttprintrc
# ~/.muttprintrc

# Here you can configure your printer
# To print in a file, use the following entry:
# PRINTER="TO_FILE:/home/berwal/test.ps"

# Here you can set the print command
# $PRINTER is substituted by the PRINTER
# variable
PRINT_COMMAND="kghostview -"

# Here you can set the path to the penguin image

# Turn printing of X-Face picture on/off (on needs the packages compface
# and imagemagick)

# Here you can turn the duplex print on or off. (needs psutils)
# Possible values are "off" or "on"
# For Postscript duplex printer set it to "printer"

# Here you can turn on or off the paper save mode
# (printing 2 pages on 1 page) - needs psutils
# Set it to 'optional' if you only want papersave mode
# if more than one page is printed.

# Here you can set the printing speed in seconds
# per page

# Choose a font:
# - Latex (EC-Fonts)
# - Latex-bright (CM-bright)
# - Times
# - Utopia
# - Palatino
# - Charter
# - Bookman

# Choose a style for the first page
# - plain       no rules
# - border      rule after the headers
# - fbox        simple box around the mailheaders
# - shadowbox   shadowbox around the header
# - ovalbox     box with rounded corners around the header (thin lines)
# - Ovalbox     same as "ovalbox" but thicker lines
# - doublebox   box with double lines around the header
# - grey        grey background behind the headers
# - greybox     same as "grey" but with a additional black box

# Should there be a rule after the header (not first page)

# Should there be a rule over the footer

# Choose a paper format, if not specified look in /etc/papersize
# - A4
# - letter

# prints signatures, and strange: Letting it as follows keeps the sig:
# how does a signature look like?
SIG_REGEXP="^-- $"

# prints no quoting

# Choose of the printed headers, separation with "_"
# /Header/ : italic printing
# *Header* : bold printing
# If the header does not exist, it is not printed.

# Writes error messages of LaTeX and dvips to /tmp/muttprint.log

# Font size: 10pt, 11pt or 12pt

# Longest line

# margins

# Date (format of printed date)
# original, local (needs Date::Parse from libtimedate-perl)

# Date format string (only if DATE=local)
# See strftime(3) for details

# pass special options to the verbatim environment, see texdoc fancyvrvb

# how should the address be printed out?
ADDRESSFORMAT="%r <%a>,\n"

# own LaTeX code to be inserted
# playing with these fonts:
# 'LATEXCODE=' seems to have an impact to the mail headers
# 'LATEXCODE1=' seems being good for the mail body
# .. now the 
# LATEXCODE1="\renewcommand{\ttdefault}{pcr}"
# seems to change the body font to 'courier'
# while
# LATEXCODE1="\renewcommand{\ttdefault}{phv}"
# seems to result in 'helvetica' for the mail body ..
# Alternatively you can try to replace 'phv' (in the 'LATEXCODE1' line) 
# with 'ptm', 'pop', 'pag' (bigger ..), 'pgm', 'pbk' ... no guarantees
# it will work ...
# See e.g.
# /usr/share/texmf-texlive/tex/latex/sugconf/sugconf.cls
# or simply grep the 'tex' files area above 
# for 'renewcommand', if you're curious ... :)


kmix – stopping the OSD popups

Took me some time to find how to stop the on-screen pop-up’s when changing the volume on KDE:

Finding KMilo and stopping/disabling it did the trick:
KDE Control center –> KDE Components –> Service Manager

And gtkpbbuttons OSD’s do the same as the ones from KMilo – except that the former look better … :)

Disabling Power Management for a hard disk with hdparm

Leaving the power management enabled for your hard disk might shorten its life considerably. To give you an idea about it read this entry in a thread on the topic:

To see whether power management is enabled for your disk, you can enter something like this:
hdparm -I /dev/hda | grep -i “power management”

On Debian Linux one might want write an entry like this to /etc/hdparm.conf, if /dev/hda is the disk you want to switch off the Power Management for:

### START excerpt /etc/hdparm.conf ###

apm = 255

/dev/hda {

### END excerpt /etc/hdparm.conf ###

Additionally I have this in /etc/default/hdparm:

### START excerpt /etc/default/hdparm ###


### END excerpt /etc/default/hdparm ###

A script like the one below might be necessary in /etc/power/scripts.d/, if you have pbbuttonsd running, to make sure the hdparm values are re-set after resuming the machine from some sleep mode:


### START /etc/power/scripts.d/hdresume ###

# name : hdresume

# Exit silently if package is no longer installed
[ -x /etc/init.d/hdparm ] || exit 0

/etc/init.d/hdparm reload

### END /etc/power/scripts.d/hdresume ###

Link to the script from /etc/power/resume.d/:

# cd /etc/power/resume.d/
# ln -s /etc/power/scripts.d/hdresume .

Note the dot at the end of the last line …
Oh, and the laptop-mode-tools package is not installed here.

CUPS and cupsd.conf on Linux

Accessing a CUPS driven printer without password

I had to do a few print-outs with my old printer, and realized the old cupsd.conf didn’t do any more what I wanted it to do, namely running my printer on my home network, via, and without having to type in usernames and passwords there every time I wanted to change some printer settings.

After lots of googling I found a solution: I forgot where I found the template, and how much I changed it to make it work the way it should. You’ll find it below.

Please note that this configuration file is for a secure home network. That is I’m the only one using that printer. So if in doubt whether it’s a good idea or not to use this cupsd.conf – then for the sake of your network security: don’t use it.

Note the cups Debian packages installed with this file :

$ dpkg -l | grep -i cups
ii  cups                                  1.3.10-1                       Common UNIX Printing System(tm) - server
ii  cups-bsd                              1.3.10-1                       Common UNIX Printing System(tm) - BSD comman
ii  cups-client                           1.3.10-1                       Common UNIX Printing System(tm) - client pro
ii  cups-common                           1.3.10-1                       Common UNIX Printing System(tm) - common fil
ii  cups-driver-gutenprint                5.2.3-2+b1                     printer drivers for CUPS
ii  gutenprint-doc                        5.2.3-2                        users' guide for Gutenprint and CUPS
ii  libcups2                              1.3.10-1                       Common UNIX Printing System(tm) - libs
ii  libcupsimage2                         1.3.10-1                       Common UNIX Printing System(tm) - image libs

So here goes /etc/cups/cupsd.conf:

# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel debug

# Administrator user group...
#SystemGroup lpadmin

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  Order deny,allow

# Restrict access to the admin pages...
<Location /admin>
  Encryption Required
  Order deny,allow

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType None
#  Require user @SYSTEM
  Order deny,allow

# Set the default printer/job policies...
<Policy default>
  # Job-related operations must be done by the owner or an administrator...
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
#    Require user @OWNER @SYSTEM
    Order deny,allow

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType None
#    Require user @SYSTEM
    Order deny,allow

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType None
#    Require user @SYSTEM
    Order deny,allow

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
#    Require user @OWNER @SYSTEM
    Order deny,allow

  <Limit All>
    Order deny,allow

# End of "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $".

An important part to stop access without authentication do seem to play the ‘Require user’ instances, that are commented out above.

I wouldn’t be astonished if the code above could be written much easier, more efficient, and yes, more beautiful than here – if all we want is unrestricted access to some printer: I did not have the time so far to find that solution. Please leave a comment here if you have one.

Thanks in anticipation.