Difference between revisions of "Talk:Fglrx"

From ThinkWiki
Jump to: navigation, search
(Display switching script)
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
Hi,
 
Hi,
I wrote a shell script for display switching. I use it under Ubuntu Dapper Drake. As I don't have a CRT, any feedback is welcome.
+
I wrote a shell script for display switching. I use it under Ubuntu Feisty Fawn.
  
 
Create {{path|/etc/acpi/events/ibm-videobtn}}:
 
Create {{path|/etc/acpi/events/ibm-videobtn}}:
Line 39: Line 39:
  
 
if [ x"$XAUTHORITY" != x"" ]; then
 
if [ x"$XAUTHORITY" != x"" ]; then
        CURRENT=`aticonfig --query-monitor | grep Enabled | cut -b 21-`
 
        case $CURRENT in
 
                lvds)
 
                        CURRENT="LCD only"
 
                        ;;
 
                crt1)
 
                        CURRENT="CRT only"
 
                        ;;
 
                lvds,\ crt1)
 
                        CURRENT="LCD and CRT"
 
                        ;;
 
                tv)
 
                        CURRENT="TV-Out only"
 
                        ;;
 
                lvds,\ tv)
 
                        CURRENT="LCD and TV-Out"
 
                        ;;
 
                crt1,\ tv)
 
                        CURRENT="CRT and TV-Out"
 
                        ;;
 
        esac
 
  
         CHOICE=`su $user -c "zenity --width=300 --height=350 --window-icon=/usr/share/pixmaps/ati.xpm \
+
        CURRENT=`aticonfig --query-monitor | grep Enabled | cut -b 21- | \
        --title 'Video output switcher' \
+
                        sed -e 's/lvds/LCD/g' -e 's/crt1/CRT/g' -e 's/tv/TV-Out/g' -e 's/,/ and/g'`
        --text='Choose the video output\n\nCurrent setting: $CURRENT\n' \
+
 
        --list --radiolist --column 'x' --column 'video output' \
+
         CHOICE=`su $user -c "zenity --width=300 --height=350 --window-icon=/usr/share/pixmaps/ccc_large.xpm \
        true 'LCD only' \
+
                --title 'Video output switcher' \
        false 'CRT only' \
+
                --text='Choose the video output\n\nCurrent setting: $CURRENT\n' \
        false 'LCD and CRT' \
+
                --list --radiolist --column 'x' --column 'video output' \
        false 'TV-Out only' \
+
                true 'LCD' \
        false 'LCD and TV-Out' \
+
                false 'CRT' \
        false 'CRT and TV-Out'"`
+
                false 'TV-Out' \
 +
                false 'LCD and CRT' \
 +
                false 'LCD and TV-Out' \
 +
                false 'CRT and TV-Out'"`
 +
 
 
fi
 
fi
  
 
case $CHOICE in
 
case $CHOICE in
         LCD\ only)
+
         LCD)
 
                 change_monitor lvds
 
                 change_monitor lvds
 
                 change_resolution 1400 1050
 
                 change_resolution 1400 1050
 
                 ;;
 
                 ;;
         CRT\ only)
+
         CRT)
 
                 change_monitor crt1
 
                 change_monitor crt1
 
                 change_resolution 1280 1024
 
                 change_resolution 1280 1024
 +
                ;;
 +
        TV-Out)
 +
                change_monitor tv
 +
                change_resolution 1024 768
 
                 ;;
 
                 ;;
 
         LCD\ and\ CRT)
 
         LCD\ and\ CRT)
 
                 change_monitor lvds,crt1
 
                 change_monitor lvds,crt1
 
                 change_resolution 1280 1024
 
                 change_resolution 1280 1024
                ;;
 
        TV-Out\ only)
 
                change_monitor tv
 
                change_resolution 1024 768
 
 
                 ;;
 
                 ;;
 
         LCD\ and\ TV-Out)
 
         LCD\ and\ TV-Out)
Line 102: Line 85:
  
 
--[[User:Whoopie|Whoopie]] 16:28, 25 May 2006 (CEST)
 
--[[User:Whoopie|Whoopie]] 16:28, 25 May 2006 (CEST)
 +
----
 +
 +
Finally! With 8.25.18 stopping gdm no longer oopses my kernel and I can reboot cleanly. sus2ram runs smoothly as well. All hail!
 +
 +
--[[User:igorr|igorr]] Thu May 25 18:19:30 CEST 2006

Latest revision as of 20:18, 14 August 2007

So, I'm searching up and down and there seems to be no way to enable the TV output without an ad-hoc xorg.conf. So my question is, what is fireglcontrolpanel useful for?

--Micampe 21:39, 14 Dec 2005 (CET)

Hi, I wrote a shell script for display switching. I use it under Ubuntu Feisty Fawn.

Create /etc/acpi/events/ibm-videobtn:

# /etc/acpi/events/ibm-videobtn
# This is called when the user presses the video button.

event=ibm/hotkey HKEY 00000080 00001007
action=/etc/acpi/ibm-video.sh

Create /etc/acpi/ibm-video.sh with permissions 755:

#!/bin/sh

. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs

getXconsole;

change_resolution() {
        if [ x"$XAUTHORITY" != x"" ]; then
                if [ x"`xrandr -q | grep $1[[:space:]]x[[:space:]]$2 | cut -b -1`" != x"*" ]; then
                        xrandr -d $DISPLAY -s $1x$2
                fi
        fi
}

change_monitor() {
        if [ x"$XAUTHORITY" != x"" ]; then
                su $user -c "aticonfig --enable-monitor=$1" &>/dev/null
        fi
}

if [ x"$XAUTHORITY" != x"" ]; then

        CURRENT=`aticonfig --query-monitor | grep Enabled | cut -b 21- | \
                        sed -e 's/lvds/LCD/g' -e 's/crt1/CRT/g' -e 's/tv/TV-Out/g' -e 's/,/ and/g'`

        CHOICE=`su $user -c "zenity --width=300 --height=350 --window-icon=/usr/share/pixmaps/ccc_large.xpm \
                --title 'Video output switcher' \
                --text='Choose the video output\n\nCurrent setting: $CURRENT\n' \
                --list --radiolist --column 'x' --column 'video output' \
                true 'LCD' \
                false 'CRT' \
                false 'TV-Out' \
                false 'LCD and CRT' \
                false 'LCD and TV-Out' \
                false 'CRT and TV-Out'"`

fi

case $CHOICE in
        LCD)
                change_monitor lvds
                change_resolution 1400 1050
                ;;
        CRT)
                change_monitor crt1
                change_resolution 1280 1024
                ;;
        TV-Out)
                change_monitor tv
                change_resolution 1024 768
                ;;
        LCD\ and\ CRT)
                change_monitor lvds,crt1
                change_resolution 1280 1024
                ;;
        LCD\ and\ TV-Out)
                change_monitor lvds,tv
                change_resolution 1024 768
                ;;
        CRT\ and\ TV-Out)
                change_monitor crt1,tv
                change_resolution 1024 768
                ;;
esac

--Whoopie 16:28, 25 May 2006 (CEST)


Finally! With 8.25.18 stopping gdm no longer oopses my kernel and I can reboot cleanly. sus2ram runs smoothly as well. All hail!

--igorr Thu May 25 18:19:30 CEST 2006