Sorry, source-link vergessen:

http://hoyhabloyo.wordpress.com/2012/01/18/xfce-display-switching-dual-single-monitor/

Grüße, Tobias

Am 04.11.2014 13:32, schrieb Tobias Kuechel:
Liebe Liste,

hier noch ein schnipsel, das ich nicht im Wiki unterbringen will, weil es ja schon zig Lösungen gibt. Trotzdem nicht vorenthalten, wer möchte:

Das Skript vga-switch.sh stelle ich nach /usr/local/bin und editiere in meinem Fenstermanager (bei mir xfce) den Knopf "XF86Display" auf "/usr/local/bin/vga-switch.sh"

Viele Grüße,
Tobias


Also für xubuntu/xfce:

/home/linuxadmin/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

<property name="XF86Display" type="string" value="/usr/local/bin/vga-switch.sh"/>


und das skript dazu:

#For identifying our monitors use xrandr tool and view output
LVDS=LVDS1      # could be another one like: LVDS, LVDS-1, etc
VGA=VGA1        # could be another one like: VGA, VGA-1, etc
EXTRA="--right-of $LVDS" # addtional info while dual display

# Lets check both LVDS and VGA state from the string "$display connected ("
xrandr | grep -q "$LVDS connected (" && LVDS_IS_ON=0 || LVDS_IS_ON=1
xrandr | grep -q "$VGA connected (" && VGA_IS_ON=0 || VGA_IS_ON=1

RES_EXT=$(xrandr | grep $VGA | sed "s/$VGA\ connected\ //;s/+.*//")
RES_INT=$(xrandr | grep $LVDS | sed "s/$LVDS\ connected\ //;s/+.*//")

echo $RES_EXT
echo $RES_INT

# Output switch cycle
if [ $LVDS_IS_ON -eq 1 ] && [ $VGA_IS_ON -eq 1 ] && [ "$RES_EXT" != "$RES_INT" ]; then
    #Go to state 0 -> just LVDS
    xrandr --output $LVDS --auto
    xrandr --output $VGA --off
    #beep
    echo State 0
elif [ $LVDS_IS_ON -eq 1 ] && [ $VGA_IS_ON -eq 0 ]; then
    #Go to state 1 -> clone both
    xrandr --output $LVDS --mode 1024x768
    xrandr --output $VGA --mode 1024x768
    #beep && beep
    echo State 1
elif [ $LVDS_IS_ON -eq 1 ] && [ $VGA_IS_ON -eq 1 ] && [ "$RES_EXT" = "$RES_INT" ]; then
    #Go to state 2 -> both outputs
    xrandr --output $LVDS --auto
    xrandr --output $VGA --auto $EXTRA
    #beep && beep && beep
    echo State 2
else
    #This should never be reached but just in case..
    xrandr --output $LVDS --auto
    #beep && beep && beep && beep
    echo State none
fi

_______________________________________________
linuxmuster-user mailing list
[email protected]
https://mail.lehrerpost.de/mailman/listinfo/linuxmuster-user

_______________________________________________
linuxmuster-user mailing list
[email protected]
https://mail.lehrerpost.de/mailman/listinfo/linuxmuster-user

Antwort per Email an