This is a simple Windows batch script designed to automatically disable Logitech G Hub’s integration with Discord.
Logitech G Hub often ignores its own “disable Discord integration” settings and can prompt users repeatedly to connect to Discord. This script modifies the internal G Hub configuration file and prevents it from asking to connect to Discord, while safely restarting G Hub afterward.
-
Shuts down G Hub completely
The script killslghub.exe,lghub_agent.exe, andlghub_updater.exeto ensure no processes are running before making changes. -
Locates the Discord integration config
The relevant configuration file is located at:
%LocalAppData%\LGHUB\integrations\applet_discord\config.json -
Removes the read-only attribute if set
Ensures the script can modify the JSON configuration file. -
Checks and updates the “enabled” setting
- If
"enabled": falseis already set, it reports it. - Otherwise, it replaces
"enabled": truewith"enabled": falsein the JSON file.
-
Restores the read-only attribute
Prevents G Hub from automatically re-enabling the integration until manually changed. -
Waits safely and provides a countdown
Pauses are included to allow G Hub’s backend services to fully shut down and catch up, preventing errors during restart. A 10-second countdown is displayed for visual feedback. -
Restarts G Hub
Launches the G Hub application after making the changes.
- Close any G Hub windows (optional, as the script will force close them).
- Double-click the batch file or run it from a terminal.
- Wait for the countdown and confirmation messages.
- G Hub will restart automatically with Discord integration disabled.
Note: Each time G Hub updates, it may reset this configuration. You will need to re-run this script after updates.
- Windows OS
- Logitech G Hub installed
- No additional software required; uses built-in CMD and PowerShell
- The script only modifies the
applet_discord/config.jsonfile. - All changes are local to your user account.
- The read-only attribute ensures changes persist even if G Hub tries to reset them.
If you find this script useful, feel free to buy me a coffee or make a small donation:
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.