Skip to content

Commit

Permalink
added hotkey saving
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminiserman committed Jan 8, 2022
1 parent b7f516d commit cafce1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HotKeyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ public static void UpdateHotkey(string s)
_listener.Update(_hotkey, newHotkey);

_hotkey = newHotkey;
Program.Config.ToggleHotkey = newHotkey;

Program.SaveConfig();
}
}
4 changes: 3 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void Main()
if (!File.Exists(CONFIG_PATH))
{
Config = new Config();
File.WriteAllText(CONFIG_PATH, JsonSerializer.Serialize(Config));
SaveConfig();
}
else Config = JsonSerializer.Deserialize<Config>(File.ReadAllText(CONFIG_PATH));

Expand All @@ -24,4 +24,6 @@ static void Main()

Application.Run(taskBarProcess);
}

public static void SaveConfig() => File.WriteAllText(CONFIG_PATH, JsonSerializer.Serialize(Config));
}

0 comments on commit cafce1e

Please sign in to comment.