Skip to content

Commit

Permalink
Try to use gconf to determine terminal program.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bach committed May 8, 2005
1 parent f458e31 commit e365d13
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions viewglob/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Other contributors:
Kevin B. McCarty
Artis Rozentals
Ron Ross
Koenraad Heijlen
Pavel Tavoda
Andy Bastien
Johannes Jordan
Expand Down
5 changes: 5 additions & 0 deletions viewglob/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2005-05-08 13:42 Stephen Bach <sjbach@users.sourceforge.net>

* AUTHORS, viewglob.in:
Try to use gconf to determine terminal program.

2005-05-05 22:24 Stephen Bach <sjbach@users.sourceforge.net>

* AUTHORS, NEWS, configure.ac, README, README.ms:
Expand Down
2 changes: 1 addition & 1 deletion viewglob/TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- dir-order doesn't work

Critical:
- make: viewglob.in should not be packaged?

Non-critical:
- cygwin
Expand Down
20 changes: 17 additions & 3 deletions viewglob/shell/viewglob.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,24 @@ if [[ "$VG_VIEWGLOB_ACTIVE" = yep ]]
then vg_error "This shell is already being monitored" 2
elif [[ -z "$DISPLAY" ]]
then VGSEER_ONLY=yep
elif [[ -z "$TERM" ]] || [[ "$TERM" = dumb ]]
elif [[ -z "$TERM" ]] || [[ "$TERM" = dumb ]]; then
# There's no terminal associated with the shell, but an X display is
# present, so make a new xterm.
then VGSEER_EXEC="xterm -e $VGSEER_EXEC"
# present, so make a new xterm. Try to use gconf-tool2 to determine
# a usable terminal program. Thanks to Koenraad Heijlen.

GCONF='gconftool-2'
if [ `which ${GCONF} 2>/dev/null` ]; then
TERM_EXEC=`${GCONF} -g \
/desktop/gnome/applications/terminal/exec \
2>/dev/null`
TERM_EXEC_ARG=`${GCONF} -g \
/desktop/gnome/applications/terminal/exec_arg \
2>/dev/null`
VGSEER_EXEC="${TERM_EXEC} ${TERM_EXEC_ARG} $VGSEER_EXEC"
else
# Fallback to xterm.
VGSEER_EXEC="xterm -e $VGSEER_EXEC"
fi
fi

# This is an excellent script to replace bash's getopts with one which allows
Expand Down

0 comments on commit e365d13

Please sign in to comment.