Location of Freemat config file for Linux?

51 views
Skip to first unread message

Garystar

unread,
Nov 5, 2009, 11:27:18 AM11/5/09
to freemat
Now that I have FreeMat 4.0 installed on my Ubuntu system, is there a
config file somewhere that I can change so that, when I bring the
program up, it automatically sets the default path to a particular
folder? Right now, it's set to /home/gary. I want to set it to
something else. Or is this something that's set inside of the
executable itself?

Chuong

unread,
Nov 8, 2009, 12:41:01 AM11/8/09
to freemat
You should be able to find the config file in/home/gary/.config/
FreeMat/. The default folder is where FreeMat is started. However, you
can change the default folder by creating a startup.m file on FreeMat
path and adding cd command to the desired folder.

Chuong

Garystar

unread,
Nov 8, 2009, 10:13:40 AM11/8/09
to freemat
I found the Freemat config file under the .config/Freemat folder.
However, I didn't see a line for "default folder". All I found was a
line for "cdlist". That lists "/home/gary". I changed it to the
folder I wanted Freemat to use as the default, and despite that, every
time I started up Freemat, it went back to the "/home/gary" folder.
Since that wasn't even in the config file, where is it pulling that
from? I even deleted the entire history section, so it's not possible
for it to pull it from there.

I tried out the startup.m script, and that works fine, but I'm really
curious as to what all Freemat is pulling from to set up the default
directory.

Thanks!

Timothy Cyders

unread,
Nov 8, 2009, 12:18:26 PM11/8/09
to fre...@googlegroups.com
Another solution I use is to create a shell script .freemat.sh:

cd ~/FreeMat
FreeMat

Then I just add the launcher to my Applications menu as sh .freemat.sh. I think I remember someone asking this question in the past, and there was something in source that needed to be changed, but I've been wrong before.

TJ

Garystar

unread,
Nov 8, 2009, 12:37:06 PM11/8/09
to freemat
So you think it might be something in the source code? If so, then
using the startup.m or your shell script would be the way to go.

I want to add something in the next version of the "Primer", but it
needs to be (1) easy and (2) work across different OSes. This is
making me lean towards the startup.m file method.

Gary

On Nov 8, 12:18 pm, Timothy Cyders <t.cyd...@gmail.com> wrote:
> Another solution I use is to create a shell script .freemat.sh:
>
> cd ~/FreeMat
> FreeMat
>
> Then I just add the launcher to my Applications menu as sh .freemat.sh. I
> think I remember someone asking this question in the past, and there was
> something in source that needed to be changed, but I've been wrong before.
>
> TJ
>

Chuong

unread,
Nov 9, 2009, 4:43:37 AM11/9/09
to freemat
Hi Gary,

By default, FreeMat starts with current folder given by "pwd" command.
If you run FreeMat from terminal, cd to any folder and run FreeMat,
you will see that working folder in FreeMat is the same as the
starting folder. This behaviour is consistent with Matlab and most
programs.

If you create a launcher for FreeMat and run from there, the default
working folder Gnome gives to FreeMat is /home/user, the same as when
you start a terminal.

"cdlist" is a list of previous working folders for quick changing
within FreeMat.

If you can file a feature request if you think it is important to add
a command option to choose working folder when starting FreeMat.

Chuong

Garystar

unread,
Nov 9, 2009, 9:01:41 AM11/9/09
to freemat
Thanks, Chuong. That answers my question. I don't see a need for a
special feature. I just wanted to understand the behavior. I'm
already using the "startup.m" script, which I'm also going to put into
the next printing of the "Primer". The great thing about that is that
it is OS agnostic. Doesn't matter if it's Windows or Linux. And I'm
assuming it works the same on the Mac, though the wife hasn't let me
touch her Mac to find out for sure. :)

Gary
Reply all
Reply to author
Forward
0 new messages