Default to a file in /tmp for the restart state.

The file is now created in /tmp using the process PID and the
username of the user running i3. The restart state file is only
loaded when restarting (the --restart option is appended to the
command line prior to the restart). That means that renaming the
old state file with the ".old" extension is no longer needed.

This "--restart" switch is supposed to be only used by i3. The
"-L" switch can be used to load a layout (and not delete it
afterwards). We unlink the state file after we load it so that
we don't keep cruft in /tmp or try to restart from an old config
file if restart_state is set.
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2010-12-01 00:14:08 -02:00
committed by Michael Stapelberg
parent 68f906f278
commit c88c3e3ab2
5 changed files with 95 additions and 24 deletions

View File

@ -82,6 +82,6 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent);
* Loads tree from ~/.i3/_restart.json (used for in-place restarts).
*
*/
bool tree_restore();
bool tree_restore(const char *path);
#endif