Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exit gnuplot after close dialog #33

Open
GHolk opened this issue Jan 2, 2019 · 0 comments
Open

exit gnuplot after close dialog #33

GHolk opened this issue Jan 2, 2019 · 0 comments

Comments

@GHolk
Copy link

GHolk commented Jan 2, 2019

--persist option keep graph window live.
however, because you remove the temp file,
window often crash when zoom or panning.

i suggest that use pause mouse close which make gnuplot wait til window close.
then you can remove temperary file safely after gnuplot exit.

this would be a easy patch like this. do you want me to send pull request?

--- /usr/bin/battery-graph	2016-11-17 18:51:44.000000000 +0800
+++ ./battery-graph	2019-01-02 22:10:36.559350289 +0800
@@ -217,10 +217,8 @@
     if $SWITCH_RATE ; then 
 		echo ", g(x -($TIME_LAST_DISCHARGE_BEGIN-$adjustment) ) title (B<0?sprintf(\"slope= (%.2f +/- %.2f) %/h\", B*3600, B_err*3600):\"\") lc rgb \"black\" lt 2 "
     fi
+    echo pause mouse close
     
-)  | gnuplot -persist ${geometry:+-geometry} $geometry ${title:+-title} "${title}" ; rm -f $TMPFILENAME
+)  | gnuplot ${geometry:+-geometry} $geometry ${title:+-title} "${title}"
 
-
-# TODO Have to decide if we want to clean up or leave the file for us to zoom in/out in the graph
-# For now we will just go the clean way and delete everything again.
 rm -f $TMPFILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant