F8x86_64 on the Acer Ferrari 3400LMi
Appendix B – dualhead.sh
#!/bin/bash
#
#Available at http://ferrari.databa.se/3400/f8/dualhead.sh
#A script to manipulate connected graphical outputs,
#including TVout. It includes the most common operations
#and may also be configured to run on an XF86Display event.
#Typically FnF5 or similar on a laptop.
#
#Prerequisites:
#This script will work with one graphics card only.
#Furthermore it will only work with two CRTCs,
#i.e. two outputs may be simultaneous active.
#
#Comments:
#In order to optimize performance and minimize flicker
#xrandr is at most called twice. Once to read the current
#state and once for setting the new state. Thus, some code
#may look strange at the first glance.
#
#By SvenGöran Bergh, 20080101
### Edit user settings here: ######################################
#
DEFAULTACTION="toggle" # May be changed with argument 1
DEFAULTSIDE="left" # May be changed with argument 2
#
###################################################################
###Edit hardware specific settings here: #########################
#
INTERNAL="LVDS" | # Specify the name | of | the | internal display |
TVOUTPUT="Svideo" | # Specify the name | of | the | TVoutput |
TVMODE="pal" | # Specify TV mode, | PAL or | NTSC | |
| # |
|
|
|
###################################################################
# Get X user
#XUSER=$(w awk '$3 ~ /^:[09]$/ {print $1; nextfile}')
#Get X display (current or first running) DISPLAY=${DISPLAY:= \
$( w awk '$3 ~ /^:[09]$/ {print $3; nextfile}' )}
#Quit if no Xserver is running
[ "${DISPLAY}" ] exit 1
46