Ask Your Question
0

How to set folder for temporary graphics files

asked 2022-05-19 02:45:37 +0200

richardquint gravatar image

With Ubuntu changing to Firefox as a snap there is a problem with SageMath's location for temporary files, i.e., $HOME/.sage/temp/$HOSTNAME/<some random 4 digit number>, since the snap version of Firefox can't access hidden folders. Is there a way to set another location to hold the html files generates by plot3d? (The files are there but my default browser, Firefox, can't display them.) A less satisfactory solution would be to use a different browser (e.g., Epiphany) just to display these files.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-19 07:20:34 +0200

It should work to set the environment variable DOT_SAGE to something that is not hidden. The default value is $HOME/.sage. A more drastic solution would be to rewrite the definition of SAGE_TMP in src/sage/misc/misc.py to use some other directory.

edit flag offensive delete link more

Comments

Thank you John. After copying $HOME/.sage to $HOME/dotsage and doing export DOT_SAGE=$HOME/dotsage in the terminal before running <path to sage>/sage works. I then added export DOT_SAGE=$HOME/dotsage to my .bashrc file and running <path to sage>/sage works in a terminal. What still confuses me is a Ubuntu/Gnome problem I have using a desktop file where I start a sage session using the command EXEC=gnome-terminal --class=SageTerminal -- /home/rquint/Sage/sage-9.6/sage. If I just paste gnome-terminal --class=SageTerminal -- /home/rquint/Sage/sage-9.6/sageinto a terminal session everything works as expected. But when running sage using the desktop file the DOT_SAGE environment value set in .bashrc isn't inherited.

richardquint gravatar imagerichardquint ( 2022-05-19 21:51:40 +0200 )edit

I'm afraid I don't know how environment variables work in Ubuntu with desktop files. Maybe DOT_SAGE=... EXEC=gnome-terminal --class=...?

John Palmieri gravatar imageJohn Palmieri ( 2022-05-19 22:55:18 +0200 )edit

With lots of help, I got it working. If anyone is interested, take a look at the discussion at AskUbuntu

richardquint gravatar imagerichardquint ( 2022-05-20 19:39:47 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-05-19 02:45:37 +0200

Seen: 217 times

Last updated: May 19 '22