Xephyr/Gtk-Xephyr

Auf dieser Seite ist nur das Skript, hier geht es zur Beschreibung.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# gtk-xephyr-de
# based on gtk-xephyr by Dr Small and Bodhi.Zazen from ubuntuforums.org

#Defaults
XDISPLAY=1
CMD=openbox

function abbruchtest {
        if (( $1 == 1 ))
        then
                echo "Abbruch"
                exit 2
        fi
}

DIALOG="zenity --title=Gtk-Xephyr"

resolution=$($DIALOG --list --radiolist  \
        --text="Bitte eine Bildschirm-Auflösung wählen." \
        --column="" --column="Auflösung" --column "Verhältnis"\
        FALSE   "1280x1024" "5:4" \
        FALSE   "1280x800" "16:10" \
        FALSE   "1280x720" "16:9" \
        FALSE   "1152x864" "4:3" \
        TRUE    "1024x768" "4:3" \
        FALSE   "  800x600" "4:3" \
        FALSE   "  640x480" "4:3" \
        FALSE   "  480x320" "3:2" \
        FALSE   "  320x240" "4:3"\
        FALSE   "  320x200" "16:10" \
)

abbruchtest $?

display=$($DIALOG --scale \
        --text "Wahl der Bildschirmnummer \n(DISPLAY 1 ist Vorgabe)"\
        --min-value=1 --max-value=100 --value=$XDISPLAY --step 1)

abbruchtest $?

CMD=$($DIALOG --entry --text "Befehl an Xephyr:" --entry-text $CMD)

abbruchtest $?

Xephyr -ac -screen $resolution -br -reset -terminate 2> /dev/null :$display &
DISPLAY=:$display
$CMD &