diff --git a/doc/FAQ.md b/doc/FAQ.md
index 9daefb40..d257084e 100644
--- a/doc/FAQ.md
+++ b/doc/FAQ.md
@@ -22,7 +22,7 @@ Instructions for these are in the beginning of the [guide](Guide.md#installation
No. Once settings are passed to the driver by the GUI, they stay in use until the computer is shut down.
## Does the GUI need to be run every time I start my PC?
-Yes. The driver itself does not store your settings. To enable them on PC start, run the GUI, or run `writer.exe settings.json`.
+Yes. The driver itself does not store your settings. To enable them on PC start, run the GUI, or run `writer.exe %LOCALAPPDATA%\rawaccel\settings.json`.
## I don't understand something, or have some other question.
Read the guide to see if it answers your question. If not, join our [Discord](https://discord.gg/7pQh8zH) and ask.
\ No newline at end of file
diff --git a/doc/Guide.md b/doc/Guide.md
index b557f5ff..7617df78 100644
--- a/doc/Guide.md
+++ b/doc/Guide.md
@@ -174,7 +174,7 @@ Natural features a concave curve which starts at 1 and approaches some maximum s

### Look Up Table
-This curve style is a blank canvas on which to create a curve. It allows the user to define the points which will make up the curve. For this reason, this mode is only for experts who know exactly what they want. Points can be supplied in the GUI according to format x1,y1;x2,y2;...xn.yn or in the settings.json in json format. The default Windows mouse acceleration settings (Enhanced Pointer Precision) can be very closely emulated with this style, using velocity points: "1.505035,0.85549892;4.375,3.30972978;13.51,15.17478447;140,354.7026875;".
+This curve style is a blank canvas on which to create a curve. It allows the user to define the points which will make up the curve. For this reason, this mode is only for experts who know exactly what they want. Points can be supplied in the GUI according to format x1,y1;x2,y2;...xn.yn or in the `%LOCALAPPDATA%\rawaccel\settings.json` file in json format. The default Windows mouse acceleration settings (Enhanced Pointer Precision) can be very closely emulated with this style, using velocity points: "1.505035,0.85549892;4.375,3.30972978;13.51,15.17478447;140,354.7026875;".

## Further Help
diff --git a/grapher/Common/Constants.cs b/grapher/Common/Constants.cs
index b4628039..9317f3f3 100644
--- a/grapher/Common/Constants.cs
+++ b/grapher/Common/Constants.cs
@@ -123,11 +123,6 @@ public static class Constants
/// Text for y component.
public const string YComponent = "Y";
- /// Default name of settings file.
- public const string DefaultSettingsFileName = @"settings.json";
-
- public const string GuiConfigFileName = ".config";
-
/// Text to directionality panel title when panel is closed.
public const string DirectionalityTitleClosed = "Anisotropy \u25BC";
diff --git a/grapher/Common/Helper.cs b/grapher/Common/Helper.cs
index 22584bca..29f9f5e5 100644
--- a/grapher/Common/Helper.cs
+++ b/grapher/Common/Helper.cs
@@ -1,7 +1,17 @@
-namespace grapher.Common
+using System;
+using System.IO;
+
+namespace grapher.Common
{
public static class Helper
{
+ public static string GetCfgPath() => Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+ "rawaccel");
+
+ public static string GetDefaultSettingsFilePath() => Path.Combine(
+ GetCfgPath(), @"settings.json");
+
public static double GetSensitivityFactor(Profile profile) => GetSensitivityFactor(profile.outputDPI);
public static double GetSensitivityFactor(double outputDPI) => outputDPI / Constants.DriverNormalizedDPI;
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index 44b8acd2..0981b199 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -361,7 +361,8 @@ static void MakeStartupShortcut(bool gui)
try
{
- if (!gui) lnk.Arguments = Constants.DefaultSettingsFileName;
+ if (!gui) lnk.Arguments = Helper.GetDefaultSettingsFilePath();
+
lnk.TargetPath = $@"{Application.StartupPath}\{name}.exe";
lnk.Save();
}
diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs
index 9965ecb5..d9f1f4fa 100644
--- a/grapher/Models/Serialized/GUISettings.cs
+++ b/grapher/Models/Serialized/GUISettings.cs
@@ -41,6 +41,13 @@ public GUISettings() {}
[DefaultValue("Light Theme")]
public string CurrentColorScheme { get; set; }
+ [JsonIgnore]
+ public static string GuiConfigFileName {
+ get {
+ return Path.Combine(Helper.GetCfgPath(), ".config");
+ }
+ }
+
#endregion Properties
#region Methods
@@ -79,7 +86,7 @@ public override int GetHashCode()
public void Save()
{
- File.WriteAllText(Constants.GuiConfigFileName, JsonConvert.SerializeObject(this));
+ File.WriteAllText(GuiConfigFileName, JsonConvert.SerializeObject(this));
}
public static GUISettings MaybeLoad()
@@ -89,7 +96,7 @@ public static GUISettings MaybeLoad()
try
{
settings = JsonConvert.DeserializeObject(
- File.ReadAllText(Constants.GuiConfigFileName));
+ File.ReadAllText(GuiConfigFileName));
}
catch (Exception ex)
{
diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs
index dddbfbc8..5f334113 100644
--- a/grapher/Models/Serialized/SettingsManager.cs
+++ b/grapher/Models/Serialized/SettingsManager.cs
@@ -188,7 +188,7 @@ public bool TryActivate(DriverConfig settings, out string errors)
UserConfig = settings;
ActiveConfig = settings;
- File.WriteAllText(Constants.DefaultSettingsFileName, settings.ToJSON());
+ File.WriteAllText(Helper.GetDefaultSettingsFilePath(), settings.ToJSON());
new Thread(() => ActiveConfig.Activate()).Start();
}
@@ -300,7 +300,7 @@ public void OnDeviceChangeMessage()
private DriverConfig InitActiveAndGetUserConfig()
{
- var path = Constants.DefaultSettingsFileName;
+ var path = Helper.GetDefaultSettingsFilePath();
if (File.Exists(path))
{
try
diff --git a/grapher/Models/Theming/IO/ThemeFileOperations.cs b/grapher/Models/Theming/IO/ThemeFileOperations.cs
index b361e4c4..66c70e8f 100644
--- a/grapher/Models/Theming/IO/ThemeFileOperations.cs
+++ b/grapher/Models/Theming/IO/ThemeFileOperations.cs
@@ -1,4 +1,4 @@
-using System;
+using grapher.Common;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -13,7 +13,7 @@ public class ThemeFileOperations
public IEnumerable LoadThemes()
{
- ThemePath = Path.Combine(Environment.CurrentDirectory, "themes");
+ ThemePath = Path.Combine(Helper.GetCfgPath(), "themes");
var pathFound = Directory.Exists(ThemePath);