{"id":14986205,"url":"https://github.com/veryfunnymonkey/gamesconfigswitcher","last_synced_at":"2026-03-11T08:24:36.492Z","repository":{"id":251030978,"uuid":"836042132","full_name":"VeryFunnyMonkey/GamesConfigSwitcher","owner":"VeryFunnyMonkey","description":"Easily Copy Game Config File Profiles via UI or CLI","archived":false,"fork":false,"pushed_at":"2024-09-29T03:05:15.000Z","size":200,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T18:21:18.632Z","etag":null,"topics":["cli","cocona","dotnet","gaming","ui","winforms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VeryFunnyMonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T03:42:28.000Z","updated_at":"2025-03-03T11:43:00.000Z","dependencies_parsed_at":"2024-08-19T16:45:03.146Z","dependency_job_id":"313db842-3d46-4063-a854-b61eeb04276e","html_url":"https://github.com/VeryFunnyMonkey/GamesConfigSwitcher","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.30434782608695654","last_synced_commit":"9c54adb452a049078363d52ded27c66219bbbdd7"},"previous_names":["veryfunnymonkey/gamesconfigswitcher"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VeryFunnyMonkey%2FGamesConfigSwitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VeryFunnyMonkey%2FGamesConfigSwitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VeryFunnyMonkey%2FGamesConfigSwitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VeryFunnyMonkey%2FGamesConfigSwitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VeryFunnyMonkey","download_url":"https://codeload.github.com/VeryFunnyMonkey/GamesConfigSwitcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487763,"owners_count":21112207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cocona","dotnet","gaming","ui","winforms"],"created_at":"2024-09-24T14:12:31.655Z","updated_at":"2025-12-29T07:42:07.947Z","avatar_url":"https://github.com/VeryFunnyMonkey.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Game Config Switcher (GCS)\r\n\r\n**Game Config Switcher (GCS)** is a lightweight, zero-dependency CLI tool written in C. It allows you to easily swap configuration files for games or applications, making it ideal for switching settings between different environments (e.g., \"TV Mode\" vs. \"Monitor Mode\" or \"Steam Deck\" vs. \"Desktop\").\r\n\r\nIt supports variable substitution, allowing you to dynamically inject values (like resolution or refresh rate) into configuration files at runtime.\r\n\r\n## Table of Contents\r\n- [Features](#features)\r\n- [Project Structure](#project-structure)\r\n- [Building](#building)\r\n- [Usage](#usage)\r\n  - [Adding Profiles](#adding-profiles)\r\n  - [Using Profiles](#using-profiles)\r\n  - [Global Switch (UseAll)](#global-switch-useall)\r\n  - [Editing](#editing)\r\n  - [Listing \u0026 Deleting](#listing--deleting)\r\n  - [Variable Substitution](#variable-substitution)\r\n- [Configuration File](#configuration-file)\r\n\r\n## Features\r\n- **Zero Dependencies:** Written in standard POSIX C. No heavy runtimes (.NET/Java) required.\r\n- **Multiple Files per Profile:** A single profile can swap out multiple config files simultaneously (e.g., `graphics.ini` AND `controls.ini`).\r\n- **Variable Substitution:** Define placeholders like `${width}` in your source files and replace them via CLI arguments.\r\n- **Global Switching:** Apply a specific profile name (e.g., \"TV\") across *all* configured games with one command.\r\n- **Portable:** Stores configuration in a simple `gcs.ini` file alongside the binary.\r\n\r\n## Project Structure\r\nThe project follows a standard C makefile structure:\r\n\r\n```text\r\nGamesConfigSwitcher/\r\n├── Makefile             # Build automation\r\n├── gcs.ini              # Config storage (created on first run)\r\n├── src/                 # Implementation (.c)\r\n│   ├── main.c           # CLI entry point\r\n│   ├── config.c         # INI parsing \u0026 list management\r\n│   ├── ops.c            # File copying \u0026 variable logic\r\n│   └── utils.c          # Helper functions\r\n└── include/             # Headers (.h)\r\n    └── gcs.h            # Data structures \u0026 prototypes\r\n```\r\n\r\n## Building\r\n\r\n### Prerequisites\r\n- GCC (GNU Compiler Collection) or Clang\r\n- Make\r\n\r\n### Build Steps\r\n1.  **Clone the repository:**\r\n    ```bash\r\n    git clone [https://github.com/YourUsername/GamesConfigSwitcher.git](https://github.com/YourUsername/GamesConfigSwitcher.git)\r\n    cd GamesConfigSwitcher\r\n    ```\r\n\r\n2.  **Compile:**\r\n    Run `make` in the root directory.\r\n    ```bash\r\n    make\r\n    ```\r\n    This will create the `gcs` binary.\r\n\r\n3.  **Clean (Optional):**\r\n    To remove build artifacts:\r\n    ```bash\r\n    make clean\r\n    ```\r\n\r\n## Usage\r\n\r\n### Adding Profiles\r\nUse the `add` command to create a game profile. You specify the Game Name, Profile Name, Source file (your template), and Destination file (where the game reads configs).\r\n\r\n**Syntax:**\r\n```bash\r\n./gcs add \"Game Name\" \"Profile Name\" -s \"./path/to/source\" -d \"./path/to/dest\"\r\n```\r\n\r\n**Multiple Files per Profile:**\r\nTo add a second config file to the *same* profile, simply run the `add` command again with the same Game and Profile names.\r\n\r\n```bash\r\n# Add graphics config\r\n./gcs add \"Skyrim\" \"TV\" -s \"./configs/skyrim_tv_graphics.ini\" -d \"~/Documents/My Games/Skyrim/SkyrimPrefs.ini\"\r\n\r\n# Add controls config to the SAME profile\r\n./gcs add \"Skyrim\" \"TV\" -s \"./configs/skyrim_controller.ini\" -d \"~/Documents/My Games/Skyrim/ControlMap.txt\"\r\n```\r\n\r\n### Using Profiles\r\nThe `use` command copies the source file(s) to the destination path(s) for a specific game.\r\n\r\n**Syntax:**\r\n```bash\r\n./gcs use \"Game Name\" \"Profile Name\"\r\n```\r\n\r\n**Example:**\r\n```bash\r\n./gcs use \"Skyrim\" \"TV\"\r\n```\r\n\r\n### Global Switch (UseAll)\r\nThe `useall` command attempts to apply a specific profile name to **all** configured games. Games that do not have a profile with that name are skipped.\r\n\r\n**Syntax:**\r\n```bash\r\n./gcs useall \"Profile Name\"\r\n```\r\n\r\n**Example:**\r\n```bash\r\n# Switches Skyrim, Cyberpunk, and Witcher 3 to \"TV\" mode simultaneously\r\n./gcs useall \"TV\"\r\n```\r\n\r\n### Editing\r\nYou can rename games or modify profiles using the `edit` command.\r\n\r\n**1. Rename a Game Title:**\r\nUpdates the game name across all profiles.\r\n```bash\r\n./gcs edit game \"Skyrim\" \"The Elder Scrolls V\"\r\n```\r\n\r\n**2. Rename a Profile:**\r\n```bash\r\n./gcs edit profile \"Skyrim\" \"TV\" -n \"LivingRoom\"\r\n```\r\n\r\n**3. Update Profile Paths:**\r\nUpdates the source and destination paths for an existing profile.\r\n*Note: This replaces the file list for this profile.*\r\n```bash\r\n./gcs edit profile \"Skyrim\" \"TV\" -s \"./new_src.ini\" -d \"./new_dest.ini\"\r\n```\r\n\r\n### Listing \u0026 Deleting\r\n- **List:** View all configured games, profiles, and their file paths.\r\n  ```bash\r\n  ./gcs list\r\n  ```\r\n\r\n- **Delete:** Remove a profile and all its associated file pairings.\r\n  ```bash\r\n  ./gcs delete \"Skyrim\" \"TV\"\r\n  ```\r\n\r\n### Variable Substitution\r\nYou can inject values into your config files at runtime using the `-v` flag. This works with both `use` and `useall`.\r\n\r\n1.  **Prepare your source file:** Use `${variableName}` tags.\r\n    *Source File (`template.ini`):*\r\n    ```ini\r\n    [Display]\r\n    ResolutionWidth=${x}\r\n    ResolutionHeight=${y}\r\n    ```\r\n\r\n2.  **Run the command:**\r\n    ```bash\r\n    ./gcs use \"MyGame\" \"TV\" -v x:3840 -v y:2160\r\n    ```\r\n\r\n3.  **Result:** The destination file is written as:\r\n    ```ini\r\n    [Display]\r\n    ResolutionWidth=3840\r\n    ResolutionHeight=2160\r\n    ```\r\n\r\n## Configuration File\r\nGCS uses a plain text INI file named `gcs.ini` to store data. Sections are formatted as `[GameName|ProfileName]`.\r\n\r\n**Example `gcs.ini`:**\r\n```ini\r\n[Skyrim|TV]\r\nsrc=./configs/tv_graphics.ini\r\ndst=/home/user/games/skyrim/prefs.ini\r\nsrc=./configs/controller.ini\r\ndst=/home/user/games/skyrim/controls.txt\r\n\r\n[Skyrim|Monitor]\r\nsrc=./configs/monitor_graphics.ini\r\ndst=/home/user/games/skyrim/prefs.ini\r\n```\r\n\r\n## Todo\r\n- [ ] Add support for dry-run (preview mode).\r\n- [ ] Add backup functionality before overwriting destination files.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveryfunnymonkey%2Fgamesconfigswitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveryfunnymonkey%2Fgamesconfigswitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveryfunnymonkey%2Fgamesconfigswitcher/lists"}