Re: Determine session type?
"Chavdar Ivanov" <[email protected]>
| Newsgroups | gmane.os.netbsd.help |
|---|---|
| Message-ID | <[email protected]> |
On 11/30/06, Jan Danielsson <[email protected]> wrote: > Hello, > > I have a script which I use to edit encrypted files. It simply > decrypts the file onto /tmp/, starts "vi" against the decrypted file, > then - when I quit the editor - it encrypts the file again. > > But I'd like it to start "nedit" instead *if* I'm running under X. I > assume this is possible? If so -- how? Shamelessly modified gftp script: #!/bin/sh prefix=/usr/pkg exec_prefix=${prefix} if [ "$DISPLAY " != " " ] && [ -f ${exec_prefix}/bin/nedit ]; then exec ${exec_prefix}/bin/nedit ${1+"$@"} else exec /usr/bin/vi ${1+"$@"} fi > > -- > Kind regards, > Jan Danielsson > > > > > Chavdar