Sunday, May 18, 2008

Using Forte Agent in Linux

I'm going to catch a lot of flack for this, I'm sure. But I'm going to post it anyway. Maybe it'll help out some other poor Linux user in a similar situation.

I've been browsing the newsgroups for years. I first subscribed to alt.music.tmbg way back in the early 90s, and while I don't read that particular group anymore, I still spend a fair amount of time in the newsgroups. It wasn't long before I picked up a program called Forte Free Agent, and eventually I decided I used it enough to justify buying a registered copy. That was back in the 1.x days. I've kept up my registration since, and despite my move to Linux, I still use Agent. I'm a little strange in the Linux world in that I don't mind paying for software that I actually use, particularly when it's a reasonable price.

You see, there are no newsreaders that don't suck, in any platform. Agent just happens to suck the least. I tried out a Linux-based Agent clone called Pan at some point, and it was nothing short of horrific. Okay, in all fairness, it really was a decent piece of software, regardless of platform. But it pales in comparison to Agent.

Agent isn't technically supported in Linux, but it is reported to work quite nicely for many users, such as myself. There are just a couple of tricks to keep in mind if you want to use it with WinE.

Launching Agent

Agent will install just fine through the regular WinE interface, and run properly the first time. The second time you try to open it, you might get an error that says "The share directory does not exist." This is probably because you tried to run it like this:

cd ~/.wine/drive_c/Program\ Files/Agent
wine agent.exe &


Try this instead:

cd ~/.wine/drive_c/Program\ Files/Agent
wine ./agent.exe &


I don't know why the dot slash helps, but I found it on Google a few years ago, and it seems to help me out.

NNTP over SSL

Yes, you can browse the newsgroups securly over SSL. This is often referred to as NNTPS, and is supported by a variety of news servers, such as Giganews (yes, I pay extra for a decent news service too).

Unfortunately, Agent doesn't seem to handle SSL too well in Linux. In fact, I've been having difficulty getting another usenet program, nzbperl, to handle SSL. I don't know what the problem is, but I do know it doesn't work so well. Unencrypted NNTP still works fine.

Launching Images

Back in my Windows days, if I came across a message with an attachment in it (mostly images, and no, not THAT kind of image), I would just hit 'L' to launch the viewer. This doesn't work so well in Linux, because of the way that Agent passes the filename to be launched. WinE tells its applications that / (the root directory in Linux) is the same as Z:\, which is almost enough... but it still passes a filename to the viewer that looks like "C:\Windows\temp\someimage.png". Since Linux apps don't know what to do with drive letters, this command fails.

With images, I found an easy workaround. Create a file in ~/.wine/drive_c/ called eog.exe (the .exe part isn't necessary, but I thought it was a nice touch) with the following three lines:

#!/bin/bash
IMG=$(echo $1 | sed -e 's/\\/\//g' -e "s/c:/\/home\/$USER\/.wine\/drive_c/i")
/usr/bin/eog $IMG


Set the execute bit...

chmod +x ~/.wine/drive_c/eog.exe

...and add it as the default file type for images. The error will still pop up, but the Eye of Gnome image viewer will open the image successfully. Feel free to substitute your own image viewer as necessary if you don't like the Eye of Gnome. Also, this is a quick and dirty script that doesn't handle spaces in filenames very well. But in general, it does seem to work pretty well.

I don't use Agent to its full extent, so I'm sure there are other oddities out there. These are the only three that I've come across. Let me know if you find any others.

Update:

I don't know why I didn't think of this. Maybe it's just late. The following code should handle files with spaces in their names just fine:

#!/bin/bash
IMG=$(echo $* | sed -e 's/\\/\//g' -e "s/c:/\/home\/$USER\/.wine\/drive_c/i")
/usr/bin/eog "$IMG"

No comments:

Post a Comment

Comments for posts over 14 days are moderated

Note: Only a member of this blog may post a comment.