Debian Codegraph @

GUI/PWgui/pwgui

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