Skip to content

Conversation

@ericbsd
Copy link
Member

@ericbsd ericbsd commented Dec 13, 2025

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."

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:

  • Integrate lightdm into the setup flow by enabling it in rc.conf, starting the service at the end of setup, and transitioning directly to the login screen.
  • Add automated cleanup of GhostBSD live autologin configuration to restore normal login behavior after setup.

Enhancements:

  • Refine setup progress tracking to use explicit fractional steps with descriptive status messages for each configuration stage.
  • Improve the setup UI messaging with clearer initial and completion texts and a dedicated slide text label accessible from the setup thread.
  • Expand and modernize the README with an overview, usage instructions, translation workflow, contribution info, and project links.

Documentation:

  • Update README with a detailed project description, installation and usage instructions, translation management steps, contribution channels, and license information.

Chores:

  • Switch the project licensing from BSD 2-Clause to BSD 3-Clause and refresh copyright attribution.
  • Refresh all translation catalogs and the POT file to include new and updated setup and status messages across supported locales.

  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."
@ericbsd ericbsd requested review from a team as code owners December 13, 2025 19:56
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 13, 2025

Reviewer's Guide

Implements 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 handoff

sequenceDiagram
    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
Loading

Updated class diagram for SetupWindow and system_calls utilities

classDiagram
    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
Loading

File-Level Changes

Change Details Files
Refactor setup progress handling to use explicit fractions and add new setup steps, then transition cleanly into starting lightdm and exiting.
  • Change update_progress to accept an explicit fraction parameter and set both fraction and text directly.
  • Import new system_calls helpers into setup_system and add 7 well-defined progress stages, including enabling lightdm and removing autologin.
  • After final step, update the slide text to a completion/login message via GLib.idle_add, pause briefly, start lightdm via system_calls.start_lightdm, and terminate the process.
setup_station/setup_system.py
Expose the side text label as a class variable and adjust its initial text for better UX and i18n.
  • Introduce SetupWindow.slide_text as a class attribute and use it instead of a local label variable.
  • Update initial slide text to new user-facing strings, keep label wrapping/justification, and explicitly call show() before packing it into the layout.
setup_station/setup_system.py
Add system-level helpers to enable and start lightdm and to remove GhostBSD autologin configuration from the live system.
  • Implement enable_lightdm using sysrc lightdm_enable=YES with error wrapping in a RuntimeError.
  • Implement start_lightdm using Popen to run service lightdm start non-blockingly.
  • Implement remove_ghostbsd_autologin to strip ghostbsd entries from /etc/gettytab and replace ghostbsd with Pc for ttyv0 in /etc/ttys using sed, wrapping failures in RuntimeError.
setup_station/system_calls.py
Provide a full project README with overview, usage, translation workflow, contribution links, and license note.
  • Rename project in documentation to "Setup Station" and describe purpose and scope.
  • Document installation, how to run the setup tool, and how to create/update/build translations via setup.py commands.
  • Add contribution guidance (Telegram and GitHub discussions) and explicitly state BSD 3-Clause license and project links.
README.md
Change project licensing from BSD 2-Clause to BSD 3-Clause and adjust copyright details.
  • Replace the previous license text with the BSD 3-Clause variant.
  • Update the copyright holder line to "2025, GhostBSD Project" and include clause restricting name usage in endorsements.
LICENSE
Update translation template and all locale .po files for new and changed UI strings, including French completions and removal of obsolete messages.
  • Regenerate setup-station.pot with a new POT-Creation-Date and updated msgids for the new status/progress messages.
  • Update each locale .po to include the new setup/progress and slide_text strings and remove obsolete ones like the previous short-duration/"don't turn off" messages.
  • Fill in the new French strings for fr_FR and fr_CA as described in the PR description.
po/ar_SA.po
po/bg_BG.po
po/ca_ES.po
po/cs_CZ.po
po/da_DK.po
po/de_DE.po
po/el_GR.po
po/en_GB.po
po/en_US.po
po/es_ES.po
po/et_EE.po
po/fi_FI.po
po/fr_CA.po
po/fr_FR.po
po/hr_HR.po
po/hu_HU.po
po/it_IT.po
po/ja_JP.po
po/ko_KR.po
po/lt_LT.po
po/lv_LV.po
po/nl_NL.po
po/no_NO.po
po/pl_PL.po
po/pt_BR.po
po/pt_PT.po
po/ro_RO.po
po/ru_RU.po
po/setup-station.pot
po/sk_SK.po
po/sl_SI.po
po/sv_SE.po
po/th_TH.po
po/tr_TR.po
po/vi_VN.po
po/zh_CN.po
po/zh_TW.po

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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>
@ericbsd ericbsd merged commit 1cca95d into master Dec 13, 2025
1 check passed
@ericbsd ericbsd deleted the missing-parts branch December 13, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants