Documentation · Settings

Lang Switcher’s settings file: where it is and what to edit

%APPDATA%\Lang_Switcher\config.toml. Some things can only be changed there: how many seconds it takes for a word to be forgotten, the replacement method and the clipboard pauses — and the feed, until its switch appears in the “From the author” window.

Where it is

%APPDATA%\Lang_Switcher\config.toml. Each Windows user has their own. There are no settings in the program folder, C:\Program Files\Lang_Switcher. Next to the file you may find the diag.log journal, if you’ve turned it on, and config.toml.bad, a copy of a corrupted file.

How to edit it

  1. Exit the program: tray menu → “Exit”.
  2. Open config.toml in Notepad, make your changes and save.
  3. Start Lang Switcher again from the Start menu.

Why exit first? The program writes the file from scratch, using what it has in memory, when you click “OK” or “Apply” in the settings window and when it exits. A change made while it’s running will be lost, and comments, the order of lines and lines the program doesn’t know won’t survive the rewrite.

What’s only in the file

The settings window doesn’t show everything. These keys can only be changed in the file:

Section and keyWhat it sets
[buffer] idle_timeout_sHow many seconds without typing before a word is forgotten. The default is 300, and 0 means never; otherwise, from 30 to 86,400.
[buffer] capacityHow many recent keystrokes the program remembers. The default is 256, from 1 to 4,096; 0 is read as 256.
[replacement] methodHow the text is replaced. auto (the default) picks a method for each window and suits almost everyone; backspace and selection force one by hand, as a last resort.
[replacement] inter_event_delay_msA pause between the events of a replacement, in milliseconds, for programs that lose fast input. The default is 0, and the maximum is 250.
[selection] clipboard_timeout_msHow long to wait for selected text to reach the clipboard, in milliseconds. The default is 300, and the maximum is 5,000.
[selection] clipboard_restore_delay_msHow long to wait before putting back what was on the clipboard. The default is 200, and the maximum is 5,000. If the old clipboard contents get pasted instead of the converted selection, raise it.
[letters] feedWhether to read the author’s feed: true or false. The switch in the “From the author” window doesn’t appear right away.

What matches the window

The other sections hold the same settings as the window:

  • [general]: enabled (false means the program is suspended), autostart, language (the interface language: ru, en, uk, de, fr, es, pt, it, pl, cs, tr, el, he, ar) and theme (system, light or dark);
  • [hotkey]: the hotkey, explained on the hotkey page;
  • [layouts]: a pair or a cycle, explained in Three or more layouts;
  • [selection] enabled: “Convert the selected text”;
  • [exclusions] processes: the exclusions;
  • [feedback] sound: “Sound feedback”;
  • [diagnostics] log_enabled: “Keep a journal”.

The rest of [letters], and schema_version, are kept by the program itself: the dates and state of letters, and the version of the file’s format. Leave them alone.

If you made a mistake

  • Not a valid number in a number field (300ms, -1): that key gets its default value, and the rest of the file is read as usual. A number outside the limits in the table is set to the nearest limit.
  • A mistake anywhere else, such as a typo in mode, method or language, or a broken quote or bracket, makes the whole file count as corrupted. The program renames it to config.toml.bad and starts with the default settings. It doesn’t tell you about it, so take a look in the folder.
  • An unknown key name in [hotkey]: the hotkey falls back to Pause, and under the field in the settings window you’ll see “The key name is not recognized — the default key, Pause, is in force.”
  • A layout that Windows doesn’t have: the “Layouts” section shows “The session has no layout named in the file (…) — choose again.”

Questions and problemson GitHub Issues ↗ or by email: send.me@panda-pishet-kod.dev