# Configuring Viking

## User Configuration File Location

Viking looks for its configuration files (`viking.prefs`, `viking.ini`, `viking.ini` and `keys.rc`) in a specific directory, searching legacy locations first before trying new locations. Thus if you upgrade &appname; it will continue to use your existing setup.

For UNIX like systems:

Up to v1.8

- `~/.viking/`

  (typically `/home/`username`/.viking`)

From v1.9 onwards

- XDG Base Directory compliant

  Typically `~/config/viking/`

For Windows systems:

v1.8 or earlier

- `C:\Users\`username`\.viking`

v1.9 onwards

- `C:\Users\`username`\AppData\Local\viking`

For Mac:

`/Library/Application Support/Viking`

If you've upgraded &app; to v1.9 and want it to use the new location, you will have to manually move the existing directory (when &app; is not running). e.g. in the command line: `mv ~/.viking ~/.config/viking`

The User Configuration File Location directory can be overridden for the current session by explicitly setting the configuration directory via the --config-dir command line option. See commandline for more detail.

## Primary Settings

&app;'s primary configuration options are controllable via the GUI as previously covered in Preferences:prefs.

These values are stored in the plain text file `viking.prefs`

## Miscellaneous Settings

Various individual values are automatically saved between &app; sessions in the `viking.ini` file placed in your config_file_loc.

This file is not intended to be manually edited, but since it is a plain text file it can be changed if desired.

Some values in this file are non-GUI, in the sense that there is no way to set it other than by manually entering in the keys and values (the key will not exist in the file otherwise). This allows some fine tuning of &app; behaviours, without resorting to recompiling the code. However is it not expected that these values should need to be changed for a normal user, hence no GUI options for these have been provided.

Here is the list of the non-GUI keys and their default values.

- curl_cainfo=NULL

  See CURLOPT_CAINFO

- For UNIX like systems: curl_ssl_verifypeer=1

  For Windows systems: curl_ssl_verifypeer=0

  See CURLOPT_SSL_VERIFYPEER

  If you encounter issues downloading from https sources, setting this to 0 should get HTTPS connections to work. For UNIX like operating systems SSL Certificate management is typically handled system wide and trusted certficate issuers updated regularly. Whereas for &appname; under Windows this is only done at installation/version update time and so may become out of date or encounter unknown sources and thus more likely to raise verification failures. Hence this is why is is turned off by default on Windows - especially to ensure the default Maps of OpenTopoMap work without manual user intervention.

- curl_user_agent=NULL

  Override the default HTTP User-Agent (which is otherwise generated automatically from a combination of &appname;'s name, the version and curl information) set in all download requests with the value specified.

  Also see CURLOPT_USERAGENT

  NB The User Agent for individual downloads/requests can be set via the relevant user-agent property when defining use of additional resources.

- export_gpsmapper_option=false

  To enable the export to the little used GPS Mapper format option, set this to true.

- export_gpspoint_option=false

  To enable the export to the little used GPS Point format option, set this to true.

- geoclue_accuracy_level=4

  Set the integer value for the accuracy level request to the GeoClue service. Values to match the GClueAccuracyLevel:

  - 0 = GCLUE_ACCURACY_LEVEL_NONE

  - 1 = GCLUE_ACCURACY_LEVEL_COUNTRY

  - 4 = GCLUE_ACCURACY_LEVEL_CITY

  - 5 = GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD

  - 6 = GCLUE_ACCURACY_LEVEL_STREET

  - 8 = GCLUE_ACCURACY_LEVEL_EXACT

- gpx_tidy_points=true

  ATM Only attempts to remove a suspicious first point of a GPX track (as opposed to any points within a track).

- gpx_tidy_points_max_speed=340

  Over this speed (in metres per second) for the first pair of points - the first point is removed.

- layers_create_trw_auto_default=false

  Create new TrackWaypoint layers without showing the layer properties dialog first.

- layers_panel_calendar_markup_mode=3

  0=No markups. 1=Day marked. 2=Day marked and tooltips created. 3=Auto (timed tooltip creation, so if too slow it reverts to 1).

  If the following message is shown in the message log:

  > vik_layers_panel_calendar_update: detail level reduced as taking too long

  then consider setting this value to 2 - although with the caveat that calendar refreshes may introduce noticable delays.

- maps_cache_status_no_file_color=red

- maps_cache_status_expired_color=yellow

- maps_cache_status_download_error_color=darkred

- maps_cache_status_okay_color=teal

  maps_cache_status_*_color value strings are passed directly into the low level function gdk_color_parse().

  The string can either one of a large set of standard names (taken from the X11 rgb.txt file), or it can be a hexadecimal value in the form "#rgb" "#rrggbb", "#rrrgggbbb" or "#rrrrggggbbbb" where 'r', 'g' and 'b' are hex digits of the red, green, and blue components of the color, respectively.

- maps_max_tiles=1000

- maps_min_shrinkfactor=0.0312499

- maps_max_shrinkfactor=8.0000001

- maps_real_min_shrinkfactor=0.0039062499

- maps_scale_inc_down=4

- maps_scale_inc_up=2

- maps_scale_smaller_zoom_first=true

- modifications_ignore_visibility_toggle=false

  Particularly if one often views large .vik files, then changing the visibility of items may be considered just part of the viewing process. Thus maybe you don't want to be notified on exit about such things - in this case you can set this value to true.

- srtm_http_base_url=https://dds.cr.usgs.gov/srtm/version2_1/SRTM3

  Allows using an alternative service for acquiring DEM SRTM files. Note that the layout on the server needs to be split into Continent directories.

- mapnik_buffer_size=128 (in pixels)

- osm_basic_auth=false

  Set to true to force the use of HTTP Basic Authentication even when OAuth is available

- background_max_threads=10

- background_max_threads_local=Number of CPUs

- window_default_tool=Select

  Options are: Pan, Zoom, Ruler or Select

- window_menubar=true

- window_copy_centre_full_format=false

- window_move_scroll_timeout=5 (milliseconds)

  Time to wait between move scroll events before redrawing

- window_zoom_scroll_timeout=150 (milliseconds)

  Time to wait between zoom scroll events before redrawing

- window_pinch_gesture_factor=1.5

  Sensitivity factor for pinch zooming. Best to use keep this value somewhere between 0.5 and 3.0 - a higher value is more sensitive.

- window_mount_device_id=NULL

  If your desktop environment doesn't automatically mount USB storage devices or you wish to also manage it in &appname; - then set this to a device's drive label e.g GARMIN or UUID value.

  &appname; will then put menu entries under Help so you can be manually perform operations as required.

  This is provided as a very basic opt in feature, only allowing specification and management of just one device via some additional menu entries. Presently no intention to make this a more fully fledged feature; USB device management is left to other programs.

- version_check_period_days=14

- trackwaypoint_start_end_distance_diff=100.0

- trackwaypoint_tab_default=0

  Allows changing the default tab displayed when the layer property dialog is shown.

- gps_statusbar_format=GSA

  This string is in the Message Format Code

- geoclue_statusbar_format=SA

  This string is in the Message Format Code

- trkpt_selected_statusbar_format=KEATDN

  This string is in the Message Format Code

- utils_nearest_tz_factor=1.0

- viewport_history_size=20

- viewport_history_diff_dist=500

  In metres.

  Go Back or Go Forward requests over this range from the last history location will move back to that position. If within this range it will skip over this location and move on to the next saved history location.

- viewport_scale=1

  If Viking doesn't automatically detect a high resolution display, you can force the setting here - typically by setting this to 2.

- viewport_popup_delay=200

  In milliseconds

  Viking should show a popup with the name of the current track selected. If it is not shown (perhaps you have a slowish machine), try increasing this value.

- external_diary_program=rednotebook

  Or in Windows it uses `C:/Progra~1/Rednotebook/rednotebook.exe` - This string value must use Unix separators and not have spaces.

- external_astro_program=stellarium

  Or in Windows use `C:/Progra~1/Stellarium/stellarium.exe` - This string value must use Unix separators and not have spaces. Needs to be version 0.15.0 or greater (otherwise due to this Bug means this does not actually work).

- external_text_program=gedit

  Or in Windows it uses notepad - This string value must use Unix separators and not have spaces.

- bfilter_simplify=100

- bfilter_compress=0.001

- list_date_format=%Y-%m-%d %H:%M

  A date format description as passed on to strftime(). Note that when displayed in tables sorting by this column simply uses the text value, rather than the underlying date/time value.

- export_device_path=OS Specific

  UNIX = "/media/user/GARMIN/Garmin/GPX"

  WINDOWS = ":/Garmin/GPX"

- export_device_trackpoint_limit=10000 (Typical Garmin Edge limit)

  Older Garmins limits are typically much lower - Etrex 20/30 is 500

- export_device_routepoint_limit=250

- kmz_default_maps_dir=Empty

  You may want to use something like: "/media/user/GARMIN/Garmin/CustomMaps"

- geotag_photo_dir="/home/user/Pictures"

  Override the base search location for photographs

  A matching dated directory corresponding to the track is attempted of the format /geotag_photo_dir/YYYY/MM/DD

- gpx_comment_time_format="%d-%B-%y %H:%M:%S"

  The fallback format used in generating timestamps for waypoints from their comment

- use_env_browser=false

  By default &appname; uses the low level function gtk_show_uri_on_window() function to open URLs, which typically results in opening a new instance of a web browser.

  This can be overridden by setting this configuration value to true and setting the environment variable `BROWSER` to invoke the desired browser, optionally including command line parameters to invoke the desired behaviour; such as "firefox --new-tab".

  One could even have a more complicated string to run a specific version with a specific profile, e.g. `BROWSER="/home/rob/Downloads/firefox/firefox -P 'Nightly' --new-tab" viking`

  Note that if you set `BROWSER`, other programs may also use this value.

  This is not applicable on Windows as currently &appname; uses the low level function ShellExecute() method to open URLs.

### Message Format Code

Currently for ease of implementation the message format code is a string of characters.

Each character represents what should be inserted in relation to a Trackpoint.

One day it might evolve into something more user friendly with a frontend to control it, perhaps allowing arbitrary text too. However for now at least some control is offered :)

Character Code

- G = Some text to display at the start of the message - GPSD

  K = Some text to display at the start of the message - Trkpt

  A = Altitude of a Trackpoint

  S = Speed of a Trackpoint

  B = Vertical Speed (Climb)

  C = Course of a Trackpoint

  L = Location of a Trackpoint

  T = Time of a Trackpoint

  M = Time diff of a Trackpoint from the previous trackpoint

  X = Number of satellites used in the trackpoint fix

  D = Distance of the trackpoint from the start of a track (following along the track)

  F = Distance of the trackpoint from the finish (end) of a track (following along the track)

  P = Distance difference of the trackpoint from the previous trackpoint

  N = Name of track to which the trackpoint belongs

  E = Name of the trackpoint

Output Notes

- If the output has * after it, then the value has been calculated via interpolation (such as speed when the Trackpoint does not contain a speed value).

  If the output has ** after it, then difficulties were encountered in trying to work out the value so probably a default of 0 will be shown.

## Keyboard Shortcuts (Accelerator) Settings

This is held in the file `keys.rc` in your config_file_loc.

It is in the standard GTK Accelerator map format. Values are automatically read in and saved between &app; sessions.

This file is not intended to be manually edited, but since it is a plain text file it can be changed if desired.