Minecraft Window Resizer for macOS is a Python-based tool that allows you to resize all Minecraft (Java-based) windows on macOS with a simple CMD
keypress. The script toggles between two predefined window sizes, providing a seamless way to adjust your Minecraft experience.
- Automatically detects all Java application windows (e.g., Minecraft).
- Resizes all detected windows to predefined dimensions.
- Toggles between two configurable window sizes with a single
CMD
keypress. - Built using Python and AppleScript for smooth macOS integration.
- macOS (compatible with recent versions).
- Python 3.7 or later.
- Required libraries:
pynput
subprocess
(built-in with Python)
Install the required Python libraries with the following command:
pip install pynput
-
Clone the repository:
git clone https://github.com/yourusername/minecraft-window-resizer-macos.git cd minecraft-window-resizer-macos
-
Install the required Python packages:
pip install pynput
-
Ensure that Accessibility permissions are enabled for
Terminal
or your Python executable:- Go to System Settings > Privacy & Security > Accessibility.
- Add
Terminal
or your Python application and enable it.
-
Run the script:
python3 resize_java_windows.py
-
Press the
CMD
key to toggle between the predefined window sizes:- Size 1:
200x1000
- Size 2:
1920x1080
- Size 1:
-
All Minecraft (or other Java-based) windows will be resized to the selected dimensions.
You can modify the window_sizes
variable in the script to set your desired dimensions:
window_sizes = [(200, 1000), (1920, 1080)]
Add as many size options as you need.
To make the script standalone, use PyInstaller:
- Install PyInstaller:
pip install pyinstaller
- Create an executable:
pyinstaller --onefile resize_java_windows.py
- The executable will be located in the
dist
directory.
- CMD Key Press:
All Java windows resized to 200x1000. All Java windows resized to 1920x1080.
- Ensure that all Java-based applications (e.g., Minecraft) are running before triggering the resize.
- If a window does not support resizing or an error occurs, the script will skip it gracefully.
- To avoid macOS security restrictions, grant the required permissions as mentioned above.
This project is licensed under the MIT License.
Feel free to submit issues or pull requests to improve this project. Suggestions are always welcome!