Path: /screens/screen_browser_select.py
This component presents a full-screen UI for selecting the user's preferred web browser and saves the choice to a temporary configuration file.
Guide users, on first run or during setup, to choose which installed browser Talon should integrate with.
Allow users to re-select or change their preferred browser by re-running the selection screen.
PyQt5 for the GUI framework (QApplication, QWidget, events).
ui_components package for UIBaseFull, UITitleText, UIHeaderText, UIImage, and UIButton.
Parameter | Type | Description | Default |
---|---|---|---|
None | N/A | This script does not accept any command-line parameters. | N/A |
python screen_browser_select.py
On launch, the script creates a full-screen overlay (UIBaseFull), displays a title "Welcome", a header prompting browser selection, and an image browser_selection.png. It dynamically generates buttons for each supported browser (Chrome, Edge, Brave, Firefox, LibreWolf) with associated colors and labels. A ResizeHandler listens for window resize events to reposition buttons below the image. Clicking a button writes the chosen browser's package ID to browser_choice.json in the system temporary directory and then exits the application.
There is no explicit exception handling around file operations or UI events; uncaught exceptions (e.g., failure to write the JSON file) will propagate and print a traceback to the console.
Writes user choice to a temporary directory using safe os.makedirs with exist_ok=True. No sensitive input is processed. Ensure the temporary path is secure and not writable by untrusted users if running in a multi-user environment.
No built-in logging is used; debugging output will appear in the console via default PyQt5 logging of uncaught exceptions.
To test, launch the script, verify the UI appears full-screen, resize the window and confirm buttons reposition correctly, click each browser option, and check that browser_choice.json is created with the correct {"browser": <pkg_id>} entry in the temporary talon subdirectory.
Author: Raven Development Team