← Installation instructions and more scripts
Minimizes Discord to the system tray (instead of quitting it) and focuses the topmost window when pressing Alt + F4.
In Discord's Settings → Windows Settings, the "Minimize to Tray" setting specifies that "Hitting X will make Discord sit back and relax in your system tray when you close the app."
However, there are two bugs related to the setting:
- Pressing Alt + F4 ignores the setting: Discord is quitted instead of minimized to the system tray. When opening Discord the next time, it opens slowly because it has to do initializations and whatnot. This is annoying and an accessibility issue (no way to minimize Discord with the keyboard).
- After minimizing Discord to the system tray, the focus goes to the taskbar instead of the topmost window. You have to manually focus the topmost window e.g. with Alt + Tab. This is also annoying.
This script makes Alt + F4:
- minimize Discord to the system tray instead of quitting it.
- focus the topmost window after minimizing Discord.
It's not necessary to enable the "Minimize to Tray" setting for this script to work. However, you might want to enable it anyhow so that clicking the top-right X will also minimize Discord to the system tray. (The focus will be incorrectly set to the taskbar, but this probably isn't a big issue when using the mouse.)
In order of upvotes (as of Sep 10, 2021):