diff --git a/CMakeLists.txt b/CMakeLists.txt index af12c7b..43395d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,5 +32,7 @@ qt_finalize_executable(lubuntu-installer-prompt) install(TARGETS lubuntu-installer-prompt DESTINATION bin) install(PROGRAMS "scripts/lubuntu-installer" DESTINATION libexec) +install(PROGRAMS "scripts/start-lubuntu-live-env" DESTINATION bin) install(FILES "img/background.png" DESTINATION share/lubuntu/installer-prompt) -install(FILES "lubuntu-installer-prompt.desktop" DESTINATION /etc/xdg/xdg-Lubuntu/autostart) +install(FILES "lubuntu-live-environment.desktop" DESTINATION share/xsessions) +install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink /etc/xdg/xdg-Lubuntu /etc/xdg/xdg-lubuntu-live-environment)") diff --git a/README.md b/README.md index 6dad02c..22b0058 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,20 @@ Releases are signed with Simon Quigley's GPG key: 5C7ABEA20F8630459CC8C8B5E27F2C Licensing info: - Everything is GPL-3 by 2022 Lubuntu Developers unless stated otherwise. - img/background.png is licensed CC-BY-4.0, authored by Aaron Rainbolt , copyright ownership the same as source + +## Architecture + +This section serves to explain how lubuntu-installer-prompt's various components work together to provide the Lubuntu ISO boot experience. + +1. SDDM loads. +2. /etc/sddm.conf is read. This file has been generated (or modified?) by Casper to point to a lubuntu-live-environment.desktop X session. +3. lubuntu-live-environment.desktop executes /bin/start-lubuntu-live-env. +4. start-lubuntu-live-env starts Openbox and backgrounds it. +5. start-lubuntu-live-env starts /bin/lubuntu-installer-prompt but does not background it. +6. The installer prompt appears. +7. The user clicks "Install Lubuntu" or "Try Lubuntu". +8. If "Install Lubuntu" is clicked, the installer prompt executes /usr/libexec/lubuntu-installer.sh, which then executes Calamares. The installer prompt then removes the buttons from the screen. +9. The installer window appears on the user's screen. +10. If Calamares closes, the installer prompt detects this and exits. +11. When the installer prompt exits, start-lubuntu-live-env kills Openbox, then runs startlxqt. +12. If "Try Lubuntu" is clicked, steps 10 and 11 are executed immediately. diff --git a/lubuntu-installer-prompt.desktop b/lubuntu-installer-prompt.desktop deleted file mode 100644 index eee958e..0000000 --- a/lubuntu-installer-prompt.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Exec=/usr/bin/lubuntu-installer-prompt -Name=Lubuntu Installer Prompt -Type=Application -Version=0.3.0 -X-LXQt-Need-Tray=true diff --git a/lubuntu-live-environment.desktop b/lubuntu-live-environment.desktop new file mode 100644 index 0000000..c71f71a --- /dev/null +++ b/lubuntu-live-environment.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Exec=/bin/start-lubuntu-live-env +Name=Lubuntu Live Environment +Comment=Starts the Lubuntu Live Environment +Type=Application diff --git a/scripts/start-lubuntu-live-env b/scripts/start-lubuntu-live-env new file mode 100755 index 0000000..2ac3240 --- /dev/null +++ b/scripts/start-lubuntu-live-env @@ -0,0 +1,8 @@ +#!/bin/bash +# Starts the Lubuntu Live Environment. + +openbox & +lubuntu-installer-prompt # This is intentionally *not* backgrounded. +# If it exits... +killall openbox +startlxqt diff --git a/src/installerprompt.cpp b/src/installerprompt.cpp index 663c88a..5228c28 100644 --- a/src/installerprompt.cpp +++ b/src/installerprompt.cpp @@ -25,12 +25,9 @@ InstallerPrompt::InstallerPrompt(QWidget *parent) // Resize the layout widget to the screen size. ui->gridLayoutWidget->resize(width, height); - // Set the button colors - QString css = "background-color: rgba(0, 104, 200, 100); color: white; border-radius: 15px;"; + // Set the buttons to be translucent ui->tryLubuntu->setAttribute(Qt::WA_TranslucentBackground); - ui->tryLubuntu->setStyleSheet(css); ui->installLubuntu->setAttribute(Qt::WA_TranslucentBackground); - ui->installLubuntu->setStyleSheet(css); // Slots and signals connect(ui->tryLubuntu, &QAbstractButton::clicked, this, &InstallerPrompt::tryLubuntu); @@ -44,8 +41,13 @@ void InstallerPrompt::tryLubuntu() void InstallerPrompt::installLubuntu() { + ui->tryLubuntu->setVisible(false); + ui->installLubuntu->setVisible(false); QProcess *calamares = new QProcess(this); calamares->start("/usr/libexec/lubuntu-installer"); + + // If Calamares exits, it either crashed or the user cancelled the installation. Exit the installer prompt (and start LXQt). + connect(calamares, &QProcess::finished, this, &InstallerPrompt::tryLubuntu); } InstallerPrompt::~InstallerPrompt() diff --git a/src/installerprompt.ui b/src/installerprompt.ui index 2750b62..8146283 100644 --- a/src/installerprompt.ui +++ b/src/installerprompt.ui @@ -6,8 +6,8 @@ 0 0 - 680 - 420 + 2085 + 1303 @@ -36,11 +36,24 @@ - - QLayout::SetMaximumSize - - + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + QLayout::SetMaximumSize @@ -59,18 +72,18 @@ + + + 0 + 0 + + 750 64 - - - 128 - 128 - - 128 @@ -80,18 +93,31 @@ Ubuntu - 12 + 25 + false + false + + false + - QLabel { color : white; font-family: Ubuntu;} + QLabel { + color : white; + font: 25pt "Ubuntu"; + background-color: rgba(0, 104, 200, 200); + border-radius: 15px; +} - # Would you like to try or install Lubuntu? + Lubuntu - Welcome to the Next Universe Qt::MarkdownText + + false + Qt::AlignCenter @@ -113,7 +139,7 @@ - + Qt::Vertical @@ -140,6 +166,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -148,17 +187,31 @@ 75 + + + 16777215 + 75 + + Ubuntu 24 + + <html><head/><body><p><span style=" font-size:12pt;">Try Lubuntu without installing it on your system. Allows you to use programs, browse the Web, and even temporarily install apps without modifying your system. Changes made within the live environment will be lost when the computer shuts down.</span></p></body></html> + false - + QPushButton { + background-color: rgba(0, 104, 200, 100); color: white; border-radius: 15px; +} +QToolTip { + background-color: rgba(0, 104, 200, 100); color: white; border: 1px solid black; +} Try Lubuntu @@ -178,6 +231,35 @@ + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 80 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -186,17 +268,47 @@ 75 + + + 16777215 + 75 + + Ubuntu 24 + + <html><head/><body><p><span style=" font-size:12pt;">Install Lubuntu onto your system. You can install Lubuntu by itself, or alongside an existing operating system.</span></p></body></html> + + + QPushButton { + background-color: rgba(0, 104, 200, 100); color: white; border-radius: 15px; +} +QToolTip { + background-color: rgba(0, 104, 200, 100); color: white; border: 1px solid black; +} + Install Lubuntu + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -212,6 +324,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -225,6 +350,32 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +