3

I am trying to change the default settings, such as the font of the axes' labels, in xmgrace.

I found many equivalent suggestions to do so online, for example the one in this blog:

open xmgrace, make the desired settings, save them as:

~/.grace/templates/Default.agr

But if I try to do this, I get the following error message:

Can't write to file ~/.grace/templates/Default.agr, check permissions!

The same happens if I open xmgrace with sudo xmgrace.

What should I do?

PS Since there was no .grace/templates folder in my home dir, I had to create it, like it is suggested here.

valerio
  • 677
  • 4
  • 12
  • 25
  • Did you try doing a `chmod` on the ~/.grace folder to allow you to modify it? – feedMe Aug 11 '16 at 13:26
  • @feedMe What command should I use exactly? PS I forgot to specify it at first (now I've edited my answer), but the folder was created by me because there was no .grace folder in y home dir. – valerio Aug 12 '16 at 14:26
  • You could try `chmod 700 ~/.grace`. You aren't using a mounted remote drive by any chance are you? I had a similar problem once where xmgrace was trying to modify the wrong default folder. – feedMe Aug 16 '16 at 13:42

1 Answers1

3

You probably have problems with folder ownership in the home directory, which you can check with ls -la.

This is how you can create your folder for default Grace/xmgrace templates and set the correct permissions. On the terminal:

cd ~

Need to use sudo to create a folder in root directory:

sudo mkdir .grace

When you create a folder with sudo it belongs to root. We change ownership with chown so that we can edit it without using sudo each time (this would also mean that xmgrace could potentially edit/overwrite the Default.agr file too, if we wanted):

sudo chown -R <user>:<group> .grace
# e.g. sudo chown -R valerio:valerio .grace

Now that we are able to make changes to the folder we go in and create a sub-directory called "templates":

cd .grace
mkdir templates

Now launch xmgrace, make changes to the new project and save the project anywhere (e.g. in the home directory) as "Default.agr".

Now move it to the templates folder:

mv /home/valerio/Default.agr ~.grace/templates/

So now when you launch xmgrace it should use this default template :) The last step could be skipped if we save Default.agr directly to our templates folder, but xmgrace in normal mode cannot see hidden folders.

feedMe
  • 3,431
  • 2
  • 36
  • 61