Name of xfce display switcher

Peggy Kutyla peggy.kutyla at laposte.net
Wed Nov 7 09:05:19 CET 2012



Le 06/11/2012 17:20, Boris Hollas a écrit :
> Hello,
> 
> what's the name of the program that pops up when I press fn+f7 on my
> laptop with multiple displays connected? It is not
> xfce4-display-settings, which has a different user interface.
> 
> Also, can I toggle outputs with a single key (eg fn+f7) as with Gnome 2?

Or you could try to bind a shortcut with a script like this :

#!/bin/bash

LAPTOPSCREEN=LVDS-1
EXTSCREEN=VGA-1
ICON=video-display

laptop()
{
	xrandr --output $LAPTOPSCREEN --auto --output $EXTSCREEN --off
	notify-send -i $ICON " " "Écran Portable seul"
}

extended()
{
	xrandr --output $LAPTOPSCREEN --auto --output $EXTSCREEN --auto
--right-of $LAPTOPSCREEN
	notify-send -i $ICON " " "Écran externe en Xinerama"
}

external()
{
	xrandr --output $LAPTOPSCREEN --off --output $EXTSCREEN --auto
	notify-send -i $ICON " " "Écran externe seul"
}

box()
{
	zenity --title Display --text "Choisissez votre configuration." \
			--height=205 \
			--list --radiolist --hide-header \
			--column 1 --column 2 TRUE Portable FALSE Externe FALSE Etendu
}

EXT_DISP=`xrandr | grep $EXTSCREEN | cut -d " " -f 2`
if [ $EXT_DISP = disconnected ]
then
	notify-send -i $ICON " " "Veuillez branchez le\nmoniteur externe"
	exit 0
fi

CHOIX=`box`
case $? in
1) # An error occured or the box was closed | Cancel/No pressed
	exit 0
;;
0) # All OK
	case $CHOIX in
	Portable)
		laptop
	;;
	Externe)
		external
	;;
	Etendu)
		extended
	;;
	esac
	exit 0
;;
esac


More information about the Xfce mailing list