<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jcgregorio</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jcgregorio"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Jcgregorio"/>
	<updated>2026-04-18T23:50:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39824</id>
		<title>Script for Dynamic Display Management with fglrx</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39824"/>
		<updated>2008-11-21T19:07:49Z</updated>

		<summary type="html">&lt;p&gt;Jcgregorio: /* Set permissions and restart acpi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The proprietary [[fglrx]] driver from ATI allows dynamic display switching, e.g. to switch to an external display for a presentation. [[Xorg RandR 1.2]] allows the same, but sometimes the newer version is not available, or not compatible e.g. when the proprietary ATI driver needs to be used for some reasons. The current version of it does not support the dynamic switching capabilities of XRandR 1.2.&lt;br /&gt;
&lt;br /&gt;
In these cases, the following switching script provides the same functionality, which you can bind to a keypress such as Fn-F7. The script uses ATI's aticonfig tool for switching, XRandR for resolution adjustment, and Xosd for displaying OSD status messages. Thus, it should work on most Linux-running laptops whith ATI graphics cards (tested with [[:Category:Ubuntu 7.04|Ubuntu 7.04]] and [[:Category:Ubuntu 7.10|Ubuntu 7.10]] on a Thinkpad [[:Category:T43|T43]]). When an external display is connected, the script switches from internal to both internal and extarnal, then to external only, and finally back to internal display only. &lt;br /&gt;
&lt;br /&gt;
==The Script==&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Script to switch displays, e.g. by pressing Fn-F7 on Thinkpad Laptops.&lt;br /&gt;
# Uses aticonfig from the ATI fglrx driver for dynamic switching, and&lt;br /&gt;
# xrandr for resolution changing. OSD done with xosd.sh, which uses&lt;br /&gt;
# osd_cat from Xosd.&lt;br /&gt;
#&lt;br /&gt;
# Author: Armin Hornung  --  www.arminhornung.de&lt;br /&gt;
# Date: 2008-05-01&lt;br /&gt;
#&lt;br /&gt;
# Partly based on a display switching script from SuSE 10.1&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
# path to xosd.sh, change to &amp;quot;echo&amp;quot; if not installed&lt;br /&gt;
xosd=&amp;quot;/usr/local/bin/xosd.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# path to xrandr&lt;br /&gt;
xrandr=&amp;quot;/usr/bin/xrandr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
INTERNAL=&amp;quot;lvds&amp;quot; # internal LCD of Laptop&lt;br /&gt;
EXTERNAL=&amp;quot;crt1&amp;quot; # external monitor, CRT or TFT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Determine X user, script usually runs as root:&lt;br /&gt;
&lt;br /&gt;
getXuser() {&lt;br /&gt;
        user=`finger| grep -m1 &amp;quot;:$displaynum &amp;quot; | awk '{print $1}'`&lt;br /&gt;
&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; = x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                user=`finger| grep -m1 &amp;quot;:$displaynum&amp;quot; | awk '{print $1}'`&lt;br /&gt;
        fi&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                userhome=`getent passwd $user | cut -d: -f6`&lt;br /&gt;
                export XAUTHORITY=$userhome/.Xauthority&lt;br /&gt;
        else&lt;br /&gt;
                export XAUTHORITY=&amp;quot;&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for x in /tmp/.X11-unix/*; do&lt;br /&gt;
    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`&lt;br /&gt;
    getXuser&lt;br /&gt;
    if [ x&amp;quot;$XAUTHORITY&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
        # extract current state&lt;br /&gt;
	export DISPLAY=&amp;quot;:$displaynum&amp;quot;&lt;br /&gt;
	_enabled_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Enabled&amp;quot;`&lt;br /&gt;
	_connected_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Connected&amp;quot;`&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# determine if internal is active&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $INTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _internal_enabled=yes&lt;br /&gt;
else&lt;br /&gt;
  _internal_enabled=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is connected &lt;br /&gt;
# (LVDS always assumed to be connected)&lt;br /&gt;
echo &amp;quot;${_connected_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_connected=yes&lt;br /&gt;
else&lt;br /&gt;
  _external_connected=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is active&lt;br /&gt;
_external_enabled=no&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_enabled=yes&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#### display switching part ####&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${_internal_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;${_external_connected}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch to external only, after both enabled:&lt;br /&gt;
      $xosd &amp;quot;Enabling $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution back to standard:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    else&lt;br /&gt;
      # switch to both enabled, after external only&lt;br /&gt;
      $xosd &amp;quot;Enabling $INTERNAL &amp;amp; $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL,$EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  else&lt;br /&gt;
    $xosd &amp;quot;No external display connected&amp;quot; &amp;amp;&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch back just if external display got disconnected&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
      $xrandr -s 1400x1050 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  fi&lt;br /&gt;
else&lt;br /&gt;
  # switch back to internal only, after external enabled:&lt;br /&gt;
  $xosd &amp;quot;Enabling $INTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
  su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
  # adjust resolution back to standard:&lt;br /&gt;
  $xrandr -s 1400x1050 -r 60&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OSD==&lt;br /&gt;
Using the helper script below, Xosd can be used for displaying status messages.&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/xosd.sh:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# 2006-03-09 &amp;lt;pille@struction.de&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# displays text in arguments on X screen using osd_cat (in some nicely preconfigured style)&lt;br /&gt;
&lt;br /&gt;
OSD_CAT=`which osd_cat`&lt;br /&gt;
XOSD=&amp;quot;${OSD_CAT} --delay=2 --age=0 --lines=2 --pos=bottom --align=center --font=-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-* --colour=green --shadow=1 --offset=25 --indent=25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# get user running X display (needed when run by script)&lt;br /&gt;
XUSER=`ps -C Xsession -o user h`  &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${USER}&amp;quot; == &amp;quot;${XUSER}&amp;quot; ]; then&lt;br /&gt;
    echo $@ | ${XOSD}&lt;br /&gt;
else&lt;br /&gt;
    echo $@ |su ${XUSER} -c &amp;quot;DISPLAY=${DISPLAY:-:0.0} ${XOSD}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Place the switching script at /etc/acpi/ati-toggle.sh and create /usr/local/bin/xosd.sh. Finally, the script needs to be bound to the key Fn-F7 by creating or editing /etc/acpi/events/ibm-videobtn to:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
# /etc/acpi/events/ibm-videobtn&lt;br /&gt;
# This is called when the user presses the video button. &lt;br /&gt;
&lt;br /&gt;
event=ibm/hotkey HKEY 00000080 00001007&lt;br /&gt;
action=/etc/acpi/ati-toggle.sh&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set permissions and restart acpi ==&lt;br /&gt;
As root, or using sudo run the following commands,&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
# Make the files executable&lt;br /&gt;
sudo chmod 755 /etc/acpi/ati-toggle.sh&lt;br /&gt;
sudo chmod 755 /usr/local/bin/xosd.sh&lt;br /&gt;
&lt;br /&gt;
# Restart the ACPI service&lt;br /&gt;
sudo /etc/init.d/acpid restart&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
You should be ready to go, just press Fn-F7 to try.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[http://www.arminhornung.de/index.php?section=Linux&amp;amp;file=ATI%20dynamic%20display%20switching&amp;amp;l=en http://www.arminhornung.de] - Source, has scripts available for download&lt;br /&gt;
&lt;br /&gt;
[[Sample Fn-F7 script]] - A similar script using XRandR 1.2 for switching&lt;/div&gt;</summary>
		<author><name>Jcgregorio</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39823</id>
		<title>Script for Dynamic Display Management with fglrx</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39823"/>
		<updated>2008-11-21T19:06:26Z</updated>

		<summary type="html">&lt;p&gt;Jcgregorio: /* Set permissions and restart acpi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The proprietary [[fglrx]] driver from ATI allows dynamic display switching, e.g. to switch to an external display for a presentation. [[Xorg RandR 1.2]] allows the same, but sometimes the newer version is not available, or not compatible e.g. when the proprietary ATI driver needs to be used for some reasons. The current version of it does not support the dynamic switching capabilities of XRandR 1.2.&lt;br /&gt;
&lt;br /&gt;
In these cases, the following switching script provides the same functionality, which you can bind to a keypress such as Fn-F7. The script uses ATI's aticonfig tool for switching, XRandR for resolution adjustment, and Xosd for displaying OSD status messages. Thus, it should work on most Linux-running laptops whith ATI graphics cards (tested with [[:Category:Ubuntu 7.04|Ubuntu 7.04]] and [[:Category:Ubuntu 7.10|Ubuntu 7.10]] on a Thinkpad [[:Category:T43|T43]]). When an external display is connected, the script switches from internal to both internal and extarnal, then to external only, and finally back to internal display only. &lt;br /&gt;
&lt;br /&gt;
==The Script==&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Script to switch displays, e.g. by pressing Fn-F7 on Thinkpad Laptops.&lt;br /&gt;
# Uses aticonfig from the ATI fglrx driver for dynamic switching, and&lt;br /&gt;
# xrandr for resolution changing. OSD done with xosd.sh, which uses&lt;br /&gt;
# osd_cat from Xosd.&lt;br /&gt;
#&lt;br /&gt;
# Author: Armin Hornung  --  www.arminhornung.de&lt;br /&gt;
# Date: 2008-05-01&lt;br /&gt;
#&lt;br /&gt;
# Partly based on a display switching script from SuSE 10.1&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
# path to xosd.sh, change to &amp;quot;echo&amp;quot; if not installed&lt;br /&gt;
xosd=&amp;quot;/usr/local/bin/xosd.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# path to xrandr&lt;br /&gt;
xrandr=&amp;quot;/usr/bin/xrandr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
INTERNAL=&amp;quot;lvds&amp;quot; # internal LCD of Laptop&lt;br /&gt;
EXTERNAL=&amp;quot;crt1&amp;quot; # external monitor, CRT or TFT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Determine X user, script usually runs as root:&lt;br /&gt;
&lt;br /&gt;
getXuser() {&lt;br /&gt;
        user=`finger| grep -m1 &amp;quot;:$displaynum &amp;quot; | awk '{print $1}'`&lt;br /&gt;
&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; = x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                user=`finger| grep -m1 &amp;quot;:$displaynum&amp;quot; | awk '{print $1}'`&lt;br /&gt;
        fi&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                userhome=`getent passwd $user | cut -d: -f6`&lt;br /&gt;
                export XAUTHORITY=$userhome/.Xauthority&lt;br /&gt;
        else&lt;br /&gt;
                export XAUTHORITY=&amp;quot;&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for x in /tmp/.X11-unix/*; do&lt;br /&gt;
    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`&lt;br /&gt;
    getXuser&lt;br /&gt;
    if [ x&amp;quot;$XAUTHORITY&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
        # extract current state&lt;br /&gt;
	export DISPLAY=&amp;quot;:$displaynum&amp;quot;&lt;br /&gt;
	_enabled_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Enabled&amp;quot;`&lt;br /&gt;
	_connected_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Connected&amp;quot;`&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# determine if internal is active&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $INTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _internal_enabled=yes&lt;br /&gt;
else&lt;br /&gt;
  _internal_enabled=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is connected &lt;br /&gt;
# (LVDS always assumed to be connected)&lt;br /&gt;
echo &amp;quot;${_connected_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_connected=yes&lt;br /&gt;
else&lt;br /&gt;
  _external_connected=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is active&lt;br /&gt;
_external_enabled=no&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_enabled=yes&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#### display switching part ####&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${_internal_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;${_external_connected}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch to external only, after both enabled:&lt;br /&gt;
      $xosd &amp;quot;Enabling $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution back to standard:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    else&lt;br /&gt;
      # switch to both enabled, after external only&lt;br /&gt;
      $xosd &amp;quot;Enabling $INTERNAL &amp;amp; $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL,$EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  else&lt;br /&gt;
    $xosd &amp;quot;No external display connected&amp;quot; &amp;amp;&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch back just if external display got disconnected&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
      $xrandr -s 1400x1050 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  fi&lt;br /&gt;
else&lt;br /&gt;
  # switch back to internal only, after external enabled:&lt;br /&gt;
  $xosd &amp;quot;Enabling $INTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
  su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
  # adjust resolution back to standard:&lt;br /&gt;
  $xrandr -s 1400x1050 -r 60&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OSD==&lt;br /&gt;
Using the helper script below, Xosd can be used for displaying status messages.&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/xosd.sh:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# 2006-03-09 &amp;lt;pille@struction.de&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# displays text in arguments on X screen using osd_cat (in some nicely preconfigured style)&lt;br /&gt;
&lt;br /&gt;
OSD_CAT=`which osd_cat`&lt;br /&gt;
XOSD=&amp;quot;${OSD_CAT} --delay=2 --age=0 --lines=2 --pos=bottom --align=center --font=-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-* --colour=green --shadow=1 --offset=25 --indent=25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# get user running X display (needed when run by script)&lt;br /&gt;
XUSER=`ps -C Xsession -o user h`  &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${USER}&amp;quot; == &amp;quot;${XUSER}&amp;quot; ]; then&lt;br /&gt;
    echo $@ | ${XOSD}&lt;br /&gt;
else&lt;br /&gt;
    echo $@ |su ${XUSER} -c &amp;quot;DISPLAY=${DISPLAY:-:0.0} ${XOSD}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Place the switching script at /etc/acpi/ati-toggle.sh and create /usr/local/bin/xosd.sh. Finally, the script needs to be bound to the key Fn-F7 by creating or editing /etc/acpi/events/ibm-videobtn to:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
# /etc/acpi/events/ibm-videobtn&lt;br /&gt;
# This is called when the user presses the video button. &lt;br /&gt;
&lt;br /&gt;
event=ibm/hotkey HKEY 00000080 00001007&lt;br /&gt;
action=/etc/acpi/ati-toggle.sh&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set permissions and restart acpi ==&lt;br /&gt;
As root, or using sudo run the following commands,&lt;br /&gt;
&lt;br /&gt;
 {{cmduser|sudo chmod 755 /etc/acpi/ati-toggle.sh}}&lt;br /&gt;
 {{cmduser|sudo chmod 755 /usr/local/bin/xosd.sh}}&lt;br /&gt;
&lt;br /&gt;
 {{cmduser|sudo /etc/init.d/acpid restart}}&lt;br /&gt;
&lt;br /&gt;
You should be ready to go, just press Fn-F7 to try.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[http://www.arminhornung.de/index.php?section=Linux&amp;amp;file=ATI%20dynamic%20display%20switching&amp;amp;l=en http://www.arminhornung.de] - Source, has scripts available for download&lt;br /&gt;
&lt;br /&gt;
[[Sample Fn-F7 script]] - A similar script using XRandR 1.2 for switching&lt;/div&gt;</summary>
		<author><name>Jcgregorio</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39822</id>
		<title>Script for Dynamic Display Management with fglrx</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39822"/>
		<updated>2008-11-21T19:05:43Z</updated>

		<summary type="html">&lt;p&gt;Jcgregorio: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The proprietary [[fglrx]] driver from ATI allows dynamic display switching, e.g. to switch to an external display for a presentation. [[Xorg RandR 1.2]] allows the same, but sometimes the newer version is not available, or not compatible e.g. when the proprietary ATI driver needs to be used for some reasons. The current version of it does not support the dynamic switching capabilities of XRandR 1.2.&lt;br /&gt;
&lt;br /&gt;
In these cases, the following switching script provides the same functionality, which you can bind to a keypress such as Fn-F7. The script uses ATI's aticonfig tool for switching, XRandR for resolution adjustment, and Xosd for displaying OSD status messages. Thus, it should work on most Linux-running laptops whith ATI graphics cards (tested with [[:Category:Ubuntu 7.04|Ubuntu 7.04]] and [[:Category:Ubuntu 7.10|Ubuntu 7.10]] on a Thinkpad [[:Category:T43|T43]]). When an external display is connected, the script switches from internal to both internal and extarnal, then to external only, and finally back to internal display only. &lt;br /&gt;
&lt;br /&gt;
==The Script==&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Script to switch displays, e.g. by pressing Fn-F7 on Thinkpad Laptops.&lt;br /&gt;
# Uses aticonfig from the ATI fglrx driver for dynamic switching, and&lt;br /&gt;
# xrandr for resolution changing. OSD done with xosd.sh, which uses&lt;br /&gt;
# osd_cat from Xosd.&lt;br /&gt;
#&lt;br /&gt;
# Author: Armin Hornung  --  www.arminhornung.de&lt;br /&gt;
# Date: 2008-05-01&lt;br /&gt;
#&lt;br /&gt;
# Partly based on a display switching script from SuSE 10.1&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
# path to xosd.sh, change to &amp;quot;echo&amp;quot; if not installed&lt;br /&gt;
xosd=&amp;quot;/usr/local/bin/xosd.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# path to xrandr&lt;br /&gt;
xrandr=&amp;quot;/usr/bin/xrandr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
INTERNAL=&amp;quot;lvds&amp;quot; # internal LCD of Laptop&lt;br /&gt;
EXTERNAL=&amp;quot;crt1&amp;quot; # external monitor, CRT or TFT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Determine X user, script usually runs as root:&lt;br /&gt;
&lt;br /&gt;
getXuser() {&lt;br /&gt;
        user=`finger| grep -m1 &amp;quot;:$displaynum &amp;quot; | awk '{print $1}'`&lt;br /&gt;
&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; = x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                user=`finger| grep -m1 &amp;quot;:$displaynum&amp;quot; | awk '{print $1}'`&lt;br /&gt;
        fi&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                userhome=`getent passwd $user | cut -d: -f6`&lt;br /&gt;
                export XAUTHORITY=$userhome/.Xauthority&lt;br /&gt;
        else&lt;br /&gt;
                export XAUTHORITY=&amp;quot;&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for x in /tmp/.X11-unix/*; do&lt;br /&gt;
    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`&lt;br /&gt;
    getXuser&lt;br /&gt;
    if [ x&amp;quot;$XAUTHORITY&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
        # extract current state&lt;br /&gt;
	export DISPLAY=&amp;quot;:$displaynum&amp;quot;&lt;br /&gt;
	_enabled_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Enabled&amp;quot;`&lt;br /&gt;
	_connected_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Connected&amp;quot;`&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# determine if internal is active&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $INTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _internal_enabled=yes&lt;br /&gt;
else&lt;br /&gt;
  _internal_enabled=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is connected &lt;br /&gt;
# (LVDS always assumed to be connected)&lt;br /&gt;
echo &amp;quot;${_connected_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_connected=yes&lt;br /&gt;
else&lt;br /&gt;
  _external_connected=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is active&lt;br /&gt;
_external_enabled=no&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_enabled=yes&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#### display switching part ####&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${_internal_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;${_external_connected}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch to external only, after both enabled:&lt;br /&gt;
      $xosd &amp;quot;Enabling $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution back to standard:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    else&lt;br /&gt;
      # switch to both enabled, after external only&lt;br /&gt;
      $xosd &amp;quot;Enabling $INTERNAL &amp;amp; $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL,$EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  else&lt;br /&gt;
    $xosd &amp;quot;No external display connected&amp;quot; &amp;amp;&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch back just if external display got disconnected&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
      $xrandr -s 1400x1050 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  fi&lt;br /&gt;
else&lt;br /&gt;
  # switch back to internal only, after external enabled:&lt;br /&gt;
  $xosd &amp;quot;Enabling $INTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
  su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
  # adjust resolution back to standard:&lt;br /&gt;
  $xrandr -s 1400x1050 -r 60&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OSD==&lt;br /&gt;
Using the helper script below, Xosd can be used for displaying status messages.&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/xosd.sh:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# 2006-03-09 &amp;lt;pille@struction.de&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# displays text in arguments on X screen using osd_cat (in some nicely preconfigured style)&lt;br /&gt;
&lt;br /&gt;
OSD_CAT=`which osd_cat`&lt;br /&gt;
XOSD=&amp;quot;${OSD_CAT} --delay=2 --age=0 --lines=2 --pos=bottom --align=center --font=-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-* --colour=green --shadow=1 --offset=25 --indent=25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# get user running X display (needed when run by script)&lt;br /&gt;
XUSER=`ps -C Xsession -o user h`  &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${USER}&amp;quot; == &amp;quot;${XUSER}&amp;quot; ]; then&lt;br /&gt;
    echo $@ | ${XOSD}&lt;br /&gt;
else&lt;br /&gt;
    echo $@ |su ${XUSER} -c &amp;quot;DISPLAY=${DISPLAY:-:0.0} ${XOSD}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Place the switching script at /etc/acpi/ati-toggle.sh and create /usr/local/bin/xosd.sh. Finally, the script needs to be bound to the key Fn-F7 by creating or editing /etc/acpi/events/ibm-videobtn to:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
# /etc/acpi/events/ibm-videobtn&lt;br /&gt;
# This is called when the user presses the video button. &lt;br /&gt;
&lt;br /&gt;
event=ibm/hotkey HKEY 00000080 00001007&lt;br /&gt;
action=/etc/acpi/ati-toggle.sh&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set permissions and restart acpi ==&lt;br /&gt;
As root, or using sudo run the following commands,&lt;br /&gt;
&lt;br /&gt;
 {{cmduser|sudo chmod 755 /etc/acpi/ati-toggle.sh}}&lt;br /&gt;
 {{cmduser|sudo /etc/init.d/acpid restart}}&lt;br /&gt;
&lt;br /&gt;
You should be ready to go, just press Fn-F7 to try.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[http://www.arminhornung.de/index.php?section=Linux&amp;amp;file=ATI%20dynamic%20display%20switching&amp;amp;l=en http://www.arminhornung.de] - Source, has scripts available for download&lt;br /&gt;
&lt;br /&gt;
[[Sample Fn-F7 script]] - A similar script using XRandR 1.2 for switching&lt;/div&gt;</summary>
		<author><name>Jcgregorio</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39821</id>
		<title>Script for Dynamic Display Management with fglrx</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_Dynamic_Display_Management_with_fglrx&amp;diff=39821"/>
		<updated>2008-11-21T17:02:01Z</updated>

		<summary type="html">&lt;p&gt;Jcgregorio: /* OSD */  Switched script to actually get the user as opposed to being hard coded to some random user name.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The proprietary [[fglrx]] driver from ATI allows dynamic display switching, e.g. to switch to an external display for a presentation. [[Xorg RandR 1.2]] allows the same, but sometimes the newer version is not available, or not compatible e.g. when the proprietary ATI driver needs to be used for some reasons. The current version of it does not support the dynamic switching capabilities of XRandR 1.2.&lt;br /&gt;
&lt;br /&gt;
In these cases, the following switching script provides the same functionality, which you can bind to a keypress such as Fn-F7. The script uses ATI's aticonfig tool for switching, XRandR for resolution adjustment, and Xosd for displaying OSD status messages. Thus, it should work on most Linux-running laptops whith ATI graphics cards (tested with [[:Category:Ubuntu 7.04|Ubuntu 7.04]] and [[:Category:Ubuntu 7.10|Ubuntu 7.10]] on a Thinkpad [[:Category:T43|T43]]). When an external display is connected, the script switches from internal to both internal and extarnal, then to external only, and finally back to internal display only. &lt;br /&gt;
&lt;br /&gt;
==The Script==&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Script to switch displays, e.g. by pressing Fn-F7 on Thinkpad Laptops.&lt;br /&gt;
# Uses aticonfig from the ATI fglrx driver for dynamic switching, and&lt;br /&gt;
# xrandr for resolution changing. OSD done with xosd.sh, which uses&lt;br /&gt;
# osd_cat from Xosd.&lt;br /&gt;
#&lt;br /&gt;
# Author: Armin Hornung  --  www.arminhornung.de&lt;br /&gt;
# Date: 2008-05-01&lt;br /&gt;
#&lt;br /&gt;
# Partly based on a display switching script from SuSE 10.1&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
# path to xosd.sh, change to &amp;quot;echo&amp;quot; if not installed&lt;br /&gt;
xosd=&amp;quot;/usr/local/bin/xosd.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# path to xrandr&lt;br /&gt;
xrandr=&amp;quot;/usr/bin/xrandr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
INTERNAL=&amp;quot;lvds&amp;quot; # internal LCD of Laptop&lt;br /&gt;
EXTERNAL=&amp;quot;crt1&amp;quot; # external monitor, CRT or TFT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Determine X user, script usually runs as root:&lt;br /&gt;
&lt;br /&gt;
getXuser() {&lt;br /&gt;
        user=`finger| grep -m1 &amp;quot;:$displaynum &amp;quot; | awk '{print $1}'`&lt;br /&gt;
&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; = x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                user=`finger| grep -m1 &amp;quot;:$displaynum&amp;quot; | awk '{print $1}'`&lt;br /&gt;
        fi&lt;br /&gt;
        if [ x&amp;quot;$user&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
                userhome=`getent passwd $user | cut -d: -f6`&lt;br /&gt;
                export XAUTHORITY=$userhome/.Xauthority&lt;br /&gt;
        else&lt;br /&gt;
                export XAUTHORITY=&amp;quot;&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for x in /tmp/.X11-unix/*; do&lt;br /&gt;
    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`&lt;br /&gt;
    getXuser&lt;br /&gt;
    if [ x&amp;quot;$XAUTHORITY&amp;quot; != x&amp;quot;&amp;quot; ]; then&lt;br /&gt;
        # extract current state&lt;br /&gt;
	export DISPLAY=&amp;quot;:$displaynum&amp;quot;&lt;br /&gt;
	_enabled_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Enabled&amp;quot;`&lt;br /&gt;
	_connected_monitors=`su $user -c &amp;quot;aticonfig --query-monitor | grep Connected&amp;quot;`&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# determine if internal is active&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $INTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _internal_enabled=yes&lt;br /&gt;
else&lt;br /&gt;
  _internal_enabled=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is connected &lt;br /&gt;
# (LVDS always assumed to be connected)&lt;br /&gt;
echo &amp;quot;${_connected_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_connected=yes&lt;br /&gt;
else&lt;br /&gt;
  _external_connected=no&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# determine if external is active&lt;br /&gt;
_external_enabled=no&lt;br /&gt;
echo &amp;quot;${_enabled_monitors}&amp;quot; | grep $EXTERNAL &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;br /&gt;
if [ $? -eq 0 ]; then&lt;br /&gt;
  _external_enabled=yes&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#### display switching part ####&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${_internal_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;${_external_connected}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch to external only, after both enabled:&lt;br /&gt;
      $xosd &amp;quot;Enabling $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution back to standard:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    else&lt;br /&gt;
      # switch to both enabled, after external only&lt;br /&gt;
      $xosd &amp;quot;Enabling $INTERNAL &amp;amp; $EXTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL,$EXTERNAL&amp;quot;&lt;br /&gt;
      # adjust resolution:&lt;br /&gt;
      $xrandr -s 1280x1024 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  else&lt;br /&gt;
    $xosd &amp;quot;No external display connected&amp;quot; &amp;amp;&lt;br /&gt;
    if [ &amp;quot;${_external_enabled}&amp;quot; = &amp;quot;yes&amp;quot; ]; then&lt;br /&gt;
      # switch back just if external display got disconnected&lt;br /&gt;
      su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
      $xrandr -s 1400x1050 -r 60&lt;br /&gt;
    fi&lt;br /&gt;
  fi&lt;br /&gt;
else&lt;br /&gt;
  # switch back to internal only, after external enabled:&lt;br /&gt;
  $xosd &amp;quot;Enabling $INTERNAL&amp;quot; &amp;amp;&lt;br /&gt;
  su $user -c &amp;quot;aticonfig --enable-monitor $INTERNAL&amp;quot;&lt;br /&gt;
  # adjust resolution back to standard:&lt;br /&gt;
  $xrandr -s 1400x1050 -r 60&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OSD==&lt;br /&gt;
Using the helper script below, Xosd can be used for displaying status messages.&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/xosd.sh:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# 2006-03-09 &amp;lt;pille@struction.de&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# displays text in arguments on X screen using osd_cat (in some nicely preconfigured style)&lt;br /&gt;
&lt;br /&gt;
OSD_CAT=`which osd_cat`&lt;br /&gt;
XOSD=&amp;quot;${OSD_CAT} --delay=2 --age=0 --lines=2 --pos=bottom --align=center --font=-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-* --colour=green --shadow=1 --offset=25 --indent=25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# get user running X display (needed when run by script)&lt;br /&gt;
XUSER=`ps -C Xsession -o user h`  &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${USER}&amp;quot; == &amp;quot;${XUSER}&amp;quot; ]; then&lt;br /&gt;
    echo $@ | ${XOSD}&lt;br /&gt;
else&lt;br /&gt;
    echo $@ |su ${XUSER} -c &amp;quot;DISPLAY=${DISPLAY:-:0.0} ${XOSD}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Place the switching script at /etc/acpi/ati-toggle.sh and create /usr/local/bin/xosd.sh. Finally, the script needs to be bound to the key Fn-F7 by creating or editing /etc/acpi/events/ibm-videobtn to:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
# /etc/acpi/events/ibm-videobtn&lt;br /&gt;
# This is called when the user presses the video button. &lt;br /&gt;
&lt;br /&gt;
event=ibm/hotkey HKEY 00000080 00001007&lt;br /&gt;
action=/etc/acpi/ati-toggle.sh&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[http://www.arminhornung.de/index.php?section=Linux&amp;amp;file=ATI%20dynamic%20display%20switching&amp;amp;l=en http://www.arminhornung.de] - Source, has scripts available for download&lt;br /&gt;
&lt;br /&gt;
[[Sample Fn-F7 script]] - A similar script using XRandR 1.2 for switching&lt;/div&gt;</summary>
		<author><name>Jcgregorio</name></author>
		
	</entry>
</feed>