open-x11 Script?

B

bullitt168

Mitglied
Thread Starter
Dabei seit
08.07.2004
Beiträge
25
Reaktionspunkte
0
Hallo! Auf der schönen Apple-Seite X11 Applications on Mac OS X wird die Benutzung von X-Programmen auf OS X schön beschrieben. Am anfang des 2. Viertel der Seite heißt es
xterm vs. Terminal and open-x11


xterm presents a much simpler shell window than Terminal. But it provides a significant advantage: when you start an xterm session, it sets up the X11 environment for you. You can then easily run X11 applications from the command-line. By contrast, in Terminal you need to run the /usr/bin/open-x11 script to set up the X11 environment and launch X11 applications, as shown here:

Mertz:~ asd$ /usr/bin/open-x11 /sw/bin/xgalaga

Leider finde ich bei mir nirgends das besagte open-x11 Script, dabei ist X11 installiert, im Xterm läuft alles.

Könnte mir jemand evtl. das Script zusenden? Ggf. nötige Anpassungen werde ich schon hinbekommen.

Entweder als Anhang hier im Forum oder sonst an

bastian (at) beckspc.de



Herzlichen dank schonmal,

Bullitt.
 
Code:
foobook% cat $(which open-x11)
#!/bin/bash

# usage: open-x11 PROGRAM-1 PROGRAM-2 ... PROGRAM-N


# this will often work (always, if X11 is already running)

x11_app=X11

# but try to find the real location just in case..

if [ -d /Applications/Utilities/X11.app ]; then
  x11_app=/Applications/Utilities/X11.app
elif [ -d /Applications/X11.app ]; then
  x11_app=/Applications/X11.app
fi


# fix $PATH to include X directories

for d in /usr/X11R6/bin /usr/bin/X11 /usr/local/bin/X11; do
  if [ -d $d ]; then
    case $PATH in
      '')
        PATH=$d
        ;;
      $d|$d:*|*:$d|*:$d:*)
        : do nothing
        ;;
      *)
        PATH=$PATH:$d
        ;;
    esac
  fi
done


# try to launch each app

while [ $# -ge 1 ]; do
  app="$1"; shift

  if [ ! -f "$app" ]; then
    # preserve previous behaviour of searching likely locations
    real_app=`type -p "$app"`
    if [ -z "$real_app" ]; then
      echo "$1: unknown application: $app"; exit 1
    fi
    app="$real_app"
  fi

  /usr/bin/open -a "$x11_app" "$app"
done
 
Zuletzt bearbeitet:
Zurück
Oben Unten