battery_boost.__main__
¶
Entry point for the Battery Boost application.
Initialises and launches the Tkinter GUI for managing TLP battery charge profiles. Battery Boost allows users to toggle between normal optimization and full-charge modes, with battery status display.
main
¶
Entry point of the TLP Battery Boost application.
- Configures the logging level based on the
DEBUGconstant. - Parses command-line arguments to determine the GUI theme and font settings.
- Instantiates the main
Appclass with the chosen theme and fonts. - Starts the Tkinter main event loop.
- Handles user interrupts and ensures clean shutdown.
- Revokes any elevated permissions acquired during execution.
Raises:
| Type | Description |
|---|---|
KeyboardInterrupt
|
Gracefully exits if the user sends an interrupt signal (e.g., Ctrl+C). The GUI is destroyed if it was created. |
Exception
|
Any unhandled exception during app initialization or execution is logged as critical and causes the program to exit with a non-zero status. |
Source code in src/battery_boost/__main__.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |