| 1 |
#!/bin/sh |
| 2 |
# ---------------------------------------------------------------------- |
| 3 |
# PROGRAM: PWgui |
| 4 |
# PURPOSE: tries to be a GUI for the PWscf |
| 5 |
# ---------------------------------------------------------------------- |
| 6 |
# Anton Kokalj |
| 7 |
# Jozef Stefan Institute, Ljubljana, Slovenia |
| 8 |
# INFM DEMOCRITOS National Simulation Center, Trieste, Italy |
| 9 |
# Email: [email protected] |
| 10 |
# ====================================================================== |
| 11 |
# Copyright (c) 2003--2004 Anton Kokalj |
| 12 |
# ====================================================================== |
| 13 |
# |
| 14 |
# |
| 15 |
# This file is distributed under the terms of the GNU General Public |
| 16 |
# License. See the file `COPYING' in the root directory of the present |
| 17 |
# distribution, or http://www.gnu.org/copyleft/gpl.txt . |
| 18 |
# |
| 19 |
# |
| 20 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 21 |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 22 |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 23 |
# NONINFRINGEMENT. IN NO EVENT SHALL ANTON KOKALJ BE LIABLE FOR ANY |
| 24 |
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 25 |
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 26 |
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 27 |
# |
| 28 |
|
| 29 |
#------------------------------------------------------------------------ |
| 30 |
# please edit this line to point to your ActiveTcl8.4's tclsh binary |
| 31 |
# |
| 32 |
ACTIVE_TCL=/opt/ActiveTcl-8.4/bin/tclsh8.4 |
| 33 |
#________________________________________________________________________ |
| 34 |
|
| 35 |
|
| 36 |
if test "x`type readlink`" = "x"; then |
| 37 |
# no readlink cmd; make a function-substitute |
| 38 |
readlink() { |
| 39 |
echo `ls -l $1 | awk '{print $NF}'` |
| 40 |
} |
| 41 |
fi |
| 42 |
|
| 43 |
pathname() { |
| 44 |
file=`type -p $1` |
| 45 |
if test $? -gt 0; then |
| 46 |
file=`which $1` |
| 47 |
if test $? -gt 0; then |
| 48 |
# give-up |
| 49 |
file=$1 |
| 50 |
fi |
| 51 |
fi |
| 52 |
echo $file |
| 53 |
} |
| 54 |
|
| 55 |
pathdir() { |
| 56 |
file=`pathname $1` |
| 57 |
|
| 58 |
while test -h $file; do |
| 59 |
file=`readlink $file` |
| 60 |
done |
| 61 |
|
| 62 |
dir=`dirname $file` |
| 63 |
( cd $dir; pwd ) |
| 64 |
} |
| 65 |
|
| 66 |
if [ -z "$PWGUI" ]; then |
| 67 |
# try to guess the PWGUI value |
| 68 |
export PWGUI=`pathdir $0` |
| 69 |
fi |
| 70 |
|
| 71 |
|
| 72 |
echo " |
| 73 |
================================================== |
| 74 |
This is PWGUI version: `cat $PWGUI/VERSION` |
| 75 |
-------------------------------------------------- |
| 76 |
" |
| 77 |
|
| 78 |
echo " |
| 79 |
PWGUI: using the \"$ACTIVE_TCL\" interpreter |
| 80 |
" |
| 81 |
$ACTIVE_TCL $PWGUI/pwgui.tcl |