summaryrefslogtreecommitdiff
path: root/src/run-nautilus
blob: a7f2274d5161369199add22f44d6b66cd4aa79af (plain)
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
#!/bin/sh

##
## Disable the gnome crash dialog.  Once bug buddy supports 
## Bugzilla, we will turn take this hack out.
##
GNOME_DISABLE_CRASH_DIALOG=1 ; export GNOME_DISABLE_CRASH_DIALOG

##
## Find out if Nautilus is already running
##
ps ax|awk '{ print $5; }' | grep -w -e  "nautilus$" > /dev/null 2>&1

ps_rv=$?

if [ $ps_rv -eq 1 ]
then
  ##
  ## Start with a fresh environment
  ##
  nautilus-clean.sh -q -x

  ##
  ## Run Nautilus with optional command line arguments.
  ## This should open the first Nautilus window.
  ##
  nautilus ${1+"$@"}
  RETURN=$?

  ##
  ## End with a fresh environment
  ##
  nautilus-clean.sh -q -x
else
  ## If no arguments give, open a new new home window
  if [ $# -eq 0 ]
  then
    nautilus ~
    RETURN=$?
  ## Run Nautilus with optional command line arguments
  else
    nautilus ${1+"$@"}
    RETURN=$?
  fi
fi

exit $RETURN