Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Launch fink apps from xterm in Apple's X11 UNIX
I like fink because it's relatively simple to set up. For convenience, I use it only with binaries -- Tetex, GnuCash, xnmap, ... everything works with a few clicks of a mouse. But it took me ages to figure out the path problem. For some reason, Apple X11's xterm couldn't remember fink's /sw/bin path. I configured ~/.xinitrc (as recommended in fink FAQ and earlier hints) and various bash profiles. But I never got it right. The fink FAQ recommends to prefix fink applications with a source command. That works nicely. For example:
source /sw/bin/init.sh ; gnucash
But I don't want to prefix every command I type in a terminal window. For example, when sudo-ing xnmap or running latex on a file several times before launching xdvi. The fink FAQ recommends to customize applications in the Applications menu in X11 with the source prefix. That works. In X11, I chose Applications -> GnuCash to launch GnuCash. Very nice, indeed.

And here's the hint: Do the same with xterm. In Apple X11's Applications menu, choose Customize... and change the default entry for xterm to:
source /sw/bin/init.sh ; xterm -sb
That's it. fink applications launch in X11 from a command line. No need to configure system files, write shell scripts or prefix commands individually with source /sw/bin/init.sh. BTW, I use -sb to add a scrollbar to the xterm window.

I don't know if this hint is too obvious. The trick is that xterm is not a fink application. xterm launches also without the source prefix (which xterm returns /usr/X11R6/bin/xterm), so it took some time before I tried to prefix it also.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[8,827 views]  

Launch fink apps from xterm in Apple's X11 | 4 comments | Create New Account
Click here to return to the 'Launch fink apps from xterm in Apple's X11' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Launch fink apps from xterm in Apple's X11
Authored by: wgscott on Jun 21, '04 11:11:38AM

put

source /sw/bin/init.csh

and

if (! $?DISPLAY) then
  setenv DISPLAY :0.0
endif


in your .cshrc or .tcshrc file, and now you can do the same from Terminal.app



[ Reply to This | # ]
Launch fink apps from xterm in Apple's X11
Authored by: gshenaut on Jun 21, '04 02:01:02PM
I use ksh, but this would also work for bash and other sh derivatives:
if [ -e /sw/bin/init.sh ] ; then
    . /sw/bin/init.sh
fi
The "if" will avoid error messages if fink isn't installed. It probably wouldn't be a bad idea to do something like that with *csh too.

Greg Shenaut

[ Reply to This | # ]

Launch fink apps from xterm in Apple's X11
Authored by: Detrius on Jun 21, '04 05:55:41PM

Open fink X11 apps from Terminal:


open-x11 xmahjongg
open-x11 xemacs

I hate to say it, but I never had the problem you listed; However, I changed my shell from bash to tcsh in Netinfo.



[ Reply to This | # ]
Launch fink apps from xterm in Apple's X11
Authored by: Ranger Rick on Jun 22, '04 07:47:45AM

All you really need to do to set up your xinitrc is to do:

echo "source /sw/bin/init.sh" > ~/.xinitrc
cat /etc/X11/xinit/xinitrc >> ~/.xinitrc

...basically, all you need is Apple's xinitrc, but with the source line at the top. You still need to put "source /sw/bin/init.sh " in the apple menu ones though, because those menu items are created before the xinitrc is processed, so they don't know about the environment that it sets up.



[ Reply to This | # ]