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.
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.