~mil/mepo_website

1aefc8ff870b53c1cf7ec0483fd8d620f36aa25f — Miles Alan 2 months ago 0d7df88
Cleanup config file and savestate section
1 files changed, 23 insertions(+), 11 deletions(-)

M src/pages/userguide.md
M src/pages/userguide.md => src/pages/userguide.md +23 -11
@@ 11,7 11,7 @@
<li><a href="#poi-searches">POI Searches</a></li>
<li><a href="#routing">Routing</a></li>
<li><a href="#repositioning-the-map">Repositioning the map</a></li>
<li><a href="#autoloading-preferences">Autoloading preferences</a></li>
<li><a href="#save-state-and-autoloading-preferences-via-config-file">Save state and Autoloading preferences (via config file)</a></li>
<li><a href="#offline-usage">Offline Usage</a></li>
<li><a href="#overridable-script-env-variables">Overridable Script ENV variables</a></li>
<li><a href="#mepolang">Mepolang</a></li>


@@ 235,23 235,35 @@ reposition the map accordingly.

---

## Autoloading preferences

Within the default config, the file located at `~/.mepo/config` is loaded
from the filesystem by default when starting mepo. You can put user-specific
configuration here that will override the default configuration.

Example `~/.mepo/config`:
## Save state and Autoloading preferences (via config file)

Within the default config, the mepolang command [bind_quit]() is used along 
with [filedump]() to write out save state of the application on quitting.
Then on boot, [fileload]() is used to restore this save state. As such, 
after quitting mepo, reopening the application will restore location,
pins, and all [preferences](). Note save state is saved to `$XDG_CACHE_HOME/mepo/savestate`,
so for most users if you wish to temporarily delete any saved state
you could run `rm ~/.config/mepo/savestate`.

In regards to using a config file; while for most users restoring the
old state is preferable, you may want to automatically always start the
map in a specific location, or with a given set of pins (or bookmarks),
or customized in a different way. For this functionality you can use the
file at `$XDG_CONFIG_HOME/mepo/config`, likely `~/.config/mepo/config` to
store mepolang to run; reference the [mepolang guide]() for more details.
The config file mentioned always gets loaded **after** savestate so it will
be applied ontop of any given savestate in all cases.

A simple configuration file you might for `~/.config/mepo/config`
to reposition the map to Boson, MA, US and have an arbitrary
bookmark pin named foopin placed on the map, might look like:

```sh
prefset_n lat 42.3608;
prefset_n lon -71.0573;
pin_groupprefset 3 active 1;
pin_add 3 0 42.355 -71.0780 [foopin] [foopin];
prefset_n zoom 15;
```
In the above example, the map is repositioned to Boson, MA, US and an
arbitrary bookmark pin named foopin is placed on the map.

---