Center-Windows is a lightweight background utility for Windows that automatically centers new windows on the screen. This feature is commonly found in Linux environments but is often unavailable or requires paid software on Windows. Center-Windows aims to solve this problem by providing an easy-to-use, free alternative.
Feel free to donate to me here:
https://www.paypal.com/paypalme/basigraphics
- Automatic Window Centering: Centers newly opened windows on the screen.
- System Tray Icon: Includes a system tray icon for easy control and status indication.
You can download the precompiled installer from the Releases page.
-
Download Installer:
- Navigate to the Releases page.
- Download the latest
Center-Windows-Setup.exe
installer.
-
Install the Application:
- Double-click on the installer file (
Center-Windows-Setup.exe
). - Follow the on-screen instructions to complete the installation.
- Double-click on the installer file (
-
Run the Application:
- Once installed, you can run the application from the Start menu or desktop shortcut.
- Clone the Repository:
git clone https://github.com/Basiiii/Center-Windows.git
cd Center-Windows
- Create a Virtual Environment (optional but recommended):
python -m venv venv
- Activate the Virtual Environment:
venv\Scripts\activate
- Install Dependencies:
pip install -r requirements.txt
- Run the Application:
-
To run in your terminal:
python Center-Windows.py
-
To compile and create an executable (allows running in the background without a terminal):
python setup.py py2exe
This will create an executable in the
dist
directory.
Once the application is running, it will automatically monitor for new windows and center them on the screen. The application runs silently in the background and can be controlled via the system tray icon.
- Hover Text: Displays "Center-Windows" when you hover over the icon.
- Quit: Right-click the system tray icon and select "Quit" to exit the application.
- Window Monitoring: Continuously checks for new windows and centers them if they are not in the ignore list.
- System Tray Icon: Provides an interface for users to interact with the application.
get_process_name_from_hwnd(hwnd)
: Retrieves the name of the process associated with a given window handle.get_window_title_from_hwnd(hwnd)
: Retrieves the title of the window associated with a given window handle.center_window(window)
: Centers a given window on the screen.on_quit_callback(sysTrayIcon)
: Stops the application and exits the monitoring loop.monitor_windows()
: Main loop for monitoring and centering windows.initialize_sys_tray_and_monitoring()
: Initializes the system tray icon and starts the window monitoring loop.
This project is licensed under the GPL-3.0 License. See the LICENSE
file for more details.