-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add system cleanup, lightdm setup, improve progress tracking #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Complete the setup-station post-installation process by adding missing
system cleanup steps, enabling and starting lightdm, fixing progress
bar tracking, updating documentation, and translating new strings.
System Cleanup & Lightdm Integration:
- Add enable_lightdm() to enable lightdm in rc.conf
- Add start_lightdm() to start lightdm service using Popen (non-blocking)
- Add remove_ghostbsd_autologin() to clean up live system configuration
* Remove ghostbsd user entries from /etc/gettytab
* Replace ghostbsd with Pc in /etc/ttys for ttyv0
- Setup process now transitions smoothly from setup to lightdm login screen
- Application exits cleanly after starting lightdm
Progress Bar Improvements:
- Refactor progress tracking to use proper fractions (0/6 to 6/6)
- Update update_progress() to accept fraction parameter instead of incrementing
- Add 7 distinct progress steps with clear status messages:
* Step 0/6: Setting system language
* Step 1/6: Setting keyboard layout
* Step 2/6: Setting timezone
* Step 3/6: Creating admin user
* Step 4/6: Enabling display manager
* Step 5/6: Removing system setup autologin
* Step 6/6: Setup complete
- Progress bar now accurately reflects setup completion percentage
User Interface Improvements:
- Update initial message: "Setting up your system. / Please do not turn off your computer."
- Update completion message: "Configuration complete. / Starting the login screen..."
- Split translatable strings to avoid embedded \n characters for better i18n
- Rename label2 to slide_text for better code clarity
- Add explicit show() call for slide_text widget
- Make slide_text a class variable for access from setup_system thread
- Update slide_text before starting lightdm to show completion status
Documentation:
- Update README.md with comprehensive project overview and vision
- Add translation management instructions (create, update, build)
- Add contribution information (Telegram channel and GitHub discussions)
- Document project goals: evolve to replace MATE Configuration Tool and Station Tweak
- Update license reference to BSD 3-Clause
License:
- Update from BSD 2-Clause to BSD 3-Clause License
- Update copyright to "2025, GhostBSD Project"
- Add clause 3: name usage restriction for endorsements
Translations:
- Update all 37 language .po files with new translatable strings
- Complete French translations for fr_FR and fr_CA:
* "Activation du gestionnaire d'affichage" (Enabling display manager)
* "Suppression de la connexion automatique de configuration" (Removing system setup autologin)
* "Configuration terminée." (Configuration complete.)
* "Démarrage de l'écran de connexion..." (Starting the login screen...)
* "Configuration de votre système." (Setting up your system.)
* "Veuillez ne pas éteindre votre ordinateur." (Please do not turn off your computer.)
- Update POT-Creation-Date to 2025-12-13 15:41-0400
- Remove obsolete strings: "This should not take too long." and "Don't turn your system off."
Reviewer's GuideImplements final setup-station post-install flow by wiring in lightdm enable/start and autologin cleanup, refactoring progress handling to explicit fractions with clearer messaging, improving the main setup window text handling, updating project documentation, switching to BSD 3-Clause licensing, and refreshing all translation files for new strings. Sequence diagram for the updated setup flow and LightDM handoffsequenceDiagram
actor User
participant SetupWindow
participant GtkProgressBar as ProgressBar
participant SetupSystemThread as SetupSystem
participant SystemCalls
participant LightDM
User ->> SetupWindow: Start setup-station
SetupWindow ->> SetupWindow: init()
SetupWindow ->> ProgressBar: create and show
SetupWindow ->> SetupWindow: create slide_text label
SetupWindow ->> SetupSystem: start setup_system thread
loop Setup steps 0 to 3
SetupSystem ->> SetupSystem: Language.save_language()
SetupSystem ->> SetupSystem: Keyboard.save_keyboard()
SetupSystem ->> SetupSystem: TimeZone.apply_timezone()
SetupSystem ->> SetupSystem: AddAdminUser.save_admin_user()
SetupSystem ->> ProgressBar: GLib.idle_add(update_progress, fraction, text)
end
SetupSystem ->> SystemCalls: enable_lightdm()
SystemCalls ->> SystemCalls: sysrc lightdm_enable=YES
SystemCalls -->> SetupSystem: lightdm enabled
SetupSystem ->> ProgressBar: GLib.idle_add(update_progress, 4/6, text)
SetupSystem ->> SystemCalls: remove_ghostbsd_autologin()
SystemCalls ->> SystemCalls: sed /etc/gettytab, /etc/ttys
SystemCalls -->> SetupSystem: autologin removed
SetupSystem ->> ProgressBar: GLib.idle_add(update_progress, 5/6, text)
SetupSystem ->> ProgressBar: GLib.idle_add(update_progress, 1, "Setup complete!")
SetupSystem ->> SetupWindow: GLib.idle_add(update_label)
SetupWindow ->> SetupWindow: slide_text.set_markup("Configuration complete.\n\nStarting the login screen...")
SetupSystem ->> SystemCalls: start_lightdm()
SystemCalls ->> LightDM: service lightdm start
SetupSystem ->> SetupSystem: sys.exit(0)
SetupSystem -->> SetupWindow: process exits
LightDM -->> User: Show login screen
Updated class diagram for SetupWindow and system_calls utilitiesclassDiagram
class SetupWindow {
+Gtk.Label slide_text
+Gtk.Box vBox
+__init__() void
}
class SetupSystemModule {
+update_progress(progress_bar: Gtk.ProgressBar, fraction: float, text: str) void
+setup_system(progress_bar: Gtk.ProgressBar) void
}
class SystemCalls {
+enable_lightdm() void
+start_lightdm() void
+remove_ghostbsd_autologin() void
}
SetupSystemModule ..> SetupWindow : uses slide_text
SetupSystemModule ..> SystemCalls : calls
SetupWindow ..> GtkLabel : uses
SetupSystemModule ..> GtkProgressBar : updates
class GtkLabel
class GtkProgressBar
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Calling
sys.exit(0)at the end ofsetup_system(which appears to run in a worker thread) will only terminate that thread; consider instead signaling the GTK main loop (e.g.,Gtk.main_quit()or closing the window from the UI thread) so the application shuts down cleanly after starting lightdm. SetupWindow.slide_textis a class-level attribute accessed from thesetup_systemthread; it would be safer to guard against it beingNoneor not yet initialized inupdate_label()to avoid races or attribute errors if the window lifecycle changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Calling `sys.exit(0)` at the end of `setup_system` (which appears to run in a worker thread) will only terminate that thread; consider instead signaling the GTK main loop (e.g., `Gtk.main_quit()` or closing the window from the UI thread) so the application shuts down cleanly after starting lightdm.
- `SetupWindow.slide_text` is a class-level attribute accessed from the `setup_system` thread; it would be safer to guard against it being `None` or not yet initialized in `update_label()` to avoid races or attribute errors if the window lifecycle changes.
## Individual Comments
### Comment 1
<location> `setup_station/setup_system.py:80-88` </location>
<code_context>
+ GLib.idle_add(update_progress, progress_bar, 1, get_text("Setup complete!"))
sleep(1)
+ # Update label text before starting lightdm
+ def update_label():
+ SetupWindow.slide_text.set_markup(
+ get_text("Configuration complete.") +
+ "\n\n" +
+ get_text("Starting the login screen...")
+ )
+
+ GLib.idle_add(update_label)
+ sleep(2)
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard against `SetupWindow.slide_text` being `None` when `update_label` runs.
If `setup_system` can run before a `SetupWindow` instance exists, `update_label` will raise when calling `set_markup` on `None`. Adding a simple guard (e.g. `if SetupWindow.slide_text is not None:`) or a safe fallback would prevent this potential runtime error and make the code more resilient to future changes in call order.
</issue_to_address>
### Comment 2
<location> `README.md:15` </location>
<code_context>
+- Network settings (WiFi/Ethernet)
+- Admin user account creation
+
+After completing the setup, the system automatically starts the lightdm login screen.
+
+## Installation
</code_context>
<issue_to_address>
**issue (typo):** Capitalize "LightDM" to match the display manager's proper name.
Using the proper capitalization keeps the documentation consistent with the official project name.
```suggestion
After completing the setup, the system automatically starts the LightDM login screen.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Complete the setup-station post-installation process by adding missing
system cleanup steps, enabling and starting lightdm, fixing progress
bar tracking, updating documentation, and translating new strings.
System Cleanup & Lightdm Integration:
Progress Bar Improvements:
User Interface Improvements:
Documentation:
License:
Translations:
Summary by Sourcery
Finalize the post-install setup flow by adding system cleanup and display manager integration, improving progress tracking, and updating documentation, licensing, and translations.
New Features:
Enhancements:
Documentation:
Chores: