This is a simple brightness control application built with Python and GTK4. It allows users to adjust the brightness of their connected monitors using a graphical interface. The application detects connected displays, and users can select a display and adjust the brightness using a slider or predefined buttons.
- Select from multiple connected monitors.
- Adjust brightness using a horizontal slider.
- Predefined buttons for setting brightness to minimum (20%) or maximum (100%).
- Python 3.11+
- GTK 4.0+
- The
gi
Python package (GObject Introspection). xrandr
installed on your system (used for detecting monitors and adjusting brightness).
-
Install the required packages:
On FreeBSD-based systems:
sudo pkg install python py311-gobject3 gtk4 xrandr
-
Clone the repository:
git clone https://github.com/vimanuelt/brightness-control.git cd brightness-control
-
Make it executable:
chmod +x brightness-control.py
-
Run the application:
./brightness-control.py
- Upon starting the application, it will automatically detect connected monitors via
xrandr
. - Select a monitor from the dropdown list.
- Use the slider to adjust the brightness, or click the buttons to quickly set the brightness to the minimum or maximum value.
- The brightness level is displayed as a percentage.
brightness.py
: The main application code, containing the GUI and logic for detecting monitors and adjusting brightness.- CSS Styling: The application uses embedded CSS for styling, located directly in the code.
- Monitor Detection: The application runs the
xrandr
command to detect connected displays and their current brightness levels. - Brightness Adjustment: Brightness can be adjusted using the
xrandr
command, specifying the selected output and desired brightness level.
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.