Skip to content

TheYarin/lang-fixer

Repository files navigation

lang-fixer

A python script that fixes typing in the wrong language when you tap a (configurable) hotkey.

Installation

Note: I tried packing this into an easy installer but it turns out anything packed with pyinstaller (the industry standard for converting python scripts into native executables) is detected as malicious by antivirus engines at VirusTotal, and since I prefer shipping complicated software rather than malicious software, I reluctantly decided to go with "install your own python environment" option. Sorry. I tried to avoid it, I really did.

Prerequisites

You need to have the following software installed on your machine:

  1. Python (3)
  2. pipenv - manages a python script's dependencies inside a venv for you, so the dependencies are not installed in your global scope.
    Install pipenv by running:
    pip install pipenv

Installing lang-fixer

  1. Clone this repository:

    git clone https://github.com/TheYarin/lang-fixer.git
  2. Run:

    cd lang-fixer
    pipenv install
  3. Add lang-fixer to startup somehow.

    1. On windows:
      1. Right click "run.bat"
      2. Choose "Create Shortcut"
      3. Move the created shortcut to:
        C:\Users\<YOUR USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
        
        (Don't forget to replace with your username)
      4. Optional: rename the shortcut to something prettier like lang-fixer.lnk

Running lang-fixer

If you're using Windows, you can simply run the run.bat file.

Otherwise, run:

cd lang-fixer
pipenv run python ./lang-fixer.py

How to use the fixer

When you've made the typo, hit the pause button (usually found above the Page Up button).

Changing Settings

You can change the hotkey that triggers the fixing in the settings.json file. You can use a syntax like ctrl+shift+a.

In general, these are the configurable settings in settings.json:

{
  "TRIGGER_HOTKEY": "pause",
  "OS_SPECIFIC": {
    "WINDOWS": {
      "COPY": "ctrl+c",
      "CHANGE_LANGUAGE": "alt+shift"
    },

    "LINUX": {
      "COPY": "ctrl+c",
      "CHANGE_LANGUAGE": "alt+shift"
    },

    "MAC_OS": {
      "COPY": "cmd+c",
      "CHANGE_LANGUAGE": "ctrl+space"
    }
  }
}

Known issues

This tool uses the clipboard to get the text you typed, and while it attempts to restore any previous value that was in the clipboard before overriding it, the restoration only works if the previous value is textual. It's recommended to use a clipboard manager to avoid losing important clipboard content.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published