diff --git a/.github/workflows/live.yml b/.github/workflows/live.yml index 2921cdd..6107c43 100644 --- a/.github/workflows/live.yml +++ b/.github/workflows/live.yml @@ -19,7 +19,7 @@ jobs: - name: Set current date run: echo "current_date=$(date '+%Y%m%d')" >> $GITHUB_ENV - name: Build Linuxloops Live Disk - run: sudo bash linuxloops -distro Debian -ver Bookworm -env Cinnamon -dst linuxloops_live_${{ env.current_date }}.img -u -a -b -c "file-roller firefox-esr gedit gparted evince python3-venv python3-pyqt6.qtwebengine" -H "linuxloops" + run: sudo bash linuxloops -distro Debian -ver Bookworm -env Plasma -dst linuxloops_live_${{ env.current_date }}.img -u -a -b -c "ark firefox-esr gparted kate okular python3-venv python3-pyqt6.qtwebengine" -H "linuxloops" - name: Compress Linuxloops Live Disk run: 7z a linuxloops_live_${{ env.current_date }}.7z linuxloops_live_${{ env.current_date }}.img - name: Generate release details diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b4ec270..c07124b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: run: | distributions=$(sudo bash linuxloops --list-distributions) for distribution in $distributions; do - versions=$(sudo bash linuxloops --distribution $distribution --list-versions) + versions=$(sudo bash linuxloops --distribution $distribution --list-versions | sed 's@x86-64-.*@@g') for version in $versions; do arg1='' arg2='' @@ -28,7 +28,7 @@ jobs: arg4='' arg5='' arg6='' - environment=$(sudo bash linuxloops --distribution $distribution --version $version --list-environments | tr ' ' '\n' | grep -v 'x86-64-' | sort -R | head -1) + environment=$(sudo bash linuxloops --distribution $distribution --version $version --list-environments | tr ' ' '\n' | sort -R | head -1) if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-btrfs)" == "Yes" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg1='-b'; fi if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-nvidia)" == "Yes" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg2='-n'; fi if [ "$(sudo bash linuxloops --distribution $distribution --version $version --list-surface)" == "Yes" ] && [ "${arg2}" == "" ] && [ $(($RANDOM % 2)) -eq 1 ]; then arg3='-S'; fi diff --git a/Readme.md b/Readme.md index de8a964..c68a650 100644 --- a/Readme.md +++ b/Readme.md @@ -90,26 +90,23 @@ Download the Linuxloops script: Install the `PyQtWebEngine` package for your distribution: - Debian / Ubuntu derivatives: -  Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine` -  Older Debian / Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine` +    Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine` +    Older Debian / Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine` - Arch-based distributions: `sudo pacman -Syu python-pyqt6-webengine` - RHEL-based distributions: `sudo dnf install python3-pyqt6-webengine` - OpenSUSE: `sudo zypper in python3-PyQt6-WebEngine` - Gentoo: `sudo emerge dev-python/PyQt6-WebEngine` - Void: `sudo xbps-install python3-pyqt6-webengine python3-pyqt6-gui python3-pyqt6-widgets python3-pyqt6-network python3-pyqt6-webchannel python3-pyqt6-printsupport` +- NixOS: No package to install (python3Packages.pyqt6-webengine will be installed by linuxloops in nix-shell environment) Once the `PyQtWebEngine` package is installed, start linuxloops in GUI mode: -`sudo -E bash ~/bin/linuxloops` - -Specific process for NixOS: -- Start linuxloops in GUI mode directly from nix-shell: -`sudo -E nix-shell -p bash -p curl -p sudo -p util-linux -p xz -p python3Packages.pyqt6-webengine --run 'bash ~/bin/linuxloops'` +`bash ${HOME}/bin/linuxloops` ### CLI mode List of command line flags: ``` -Usage: sudo -E bash ~/bin/linuxloops -distro -ver -env -dst +Usage: bash ${HOME}/bin/linuxloops -distro -ver -env -dst -distro, --distribution (Distribution to install) -ver, --version (Distribution version to install) -env, --environment (Environment to install) @@ -159,11 +156,11 @@ Usage: sudo -E bash ~/bin/linuxloops -distro -ver ` +`bash ${HOME}/bin/linuxloops -d ` ## Complementary instructions diff --git a/Readme/Install-with-linux.md b/Readme/Install-with-linux.md index 3ca4bf2..3f6f10b 100644 --- a/Readme/Install-with-linux.md +++ b/Readme/Install-with-linux.md @@ -23,23 +23,21 @@ - To use the GUI installer, install the `PyQtWebEngine` package for your distribution: Debian / Ubuntu derivatives: -  Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine` -  Older Debian / Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine` +    Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine` +    Older Debian / Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine` Arch-based distributions: `sudo pacman -Syu python-pyqt6-webengine` RHEL-based distributions: `sudo dnf install python3-pyqt6-webengine` OpenSUSE: `sudo zypper in python3-PyQt6-WebEngine` Gentoo: `sudo emerge dev-python/PyQt6-WebEngine` Void: `sudo xbps-install python3-pyqt6-webengine python3-pyqt6-gui python3-pyqt6-widgets python3-pyqt6-network python3-pyqt6-webchannel python3-pyqt6-printsupport` +NixOS: No package to install (python3Packages.pyqt6-webengine will be installed by linuxloops in nix-shell environment) -Start linuxloops in GUI mode: -`sudo -E bash ~/bin/linuxloops` - -For NixOS, start linuxloops in GUI mode directly from nix-shell: -`sudo -E nix-shell -p bash -p curl -p sudo -p util-linux -p xz -p python3Packages.pyqt6-webengine --run 'bash ~/bin/linuxloops'` +Once the `PyQtWebEngine` package is installed, start linuxloops in GUI mode: +`bash ${HOME}/bin/linuxloops` - To use the CLI installer: ``` -Usage: sudo -E bash ~/bin/linuxloops -distro -ver -env -dst +Usage: bash ${HOME}/bin/linuxloops -distro -ver -env -dst -distro, --distribution (Distribution to install) -ver, --version (Distribution version to install) -env, --environment (Environment to install) @@ -89,11 +87,11 @@ Usage: sudo -E bash ~/bin/linuxloops -distro -ver ` +`bash ${HOME}/bin/linuxloops -d ` 3. Finalisation (For disk installs) diff --git a/Readme/Install-with-windows.md b/Readme/Install-with-windows.md index e64b803..30b6edb 100644 --- a/Readme/Install-with-windows.md +++ b/Readme/Install-with-windows.md @@ -27,9 +27,12 @@ Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine` Older Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine` +Once the `PyQtWebEngine` package is installed, start linuxloops in GUI mode: +`bash ${HOME}/bin/linuxloops` + - To use the CLI installer: ``` -Usage: sudo -E bash ~/bin/linuxloops -distro -ver -env -dst +Usage: bash ${HOME}/bin/linuxloops -distro -ver -env -dst -distro, --distribution (Distribution to install) -ver, --version (Distribution version to install) -env, --environment (Environment to install) @@ -79,11 +82,11 @@ Usage: sudo -E bash ~/bin/linuxloops -distro -ver ` +`bash ${HOME}/bin/linuxloops -d ` 4. Finalisation (For disk installs) diff --git a/linuxloops b/linuxloops old mode 100644 new mode 100755 index 2f5b91e..29a3afa --- a/linuxloops +++ b/linuxloops @@ -4,7 +4,7 @@ usage() { cat << USAGE LinuxLoops: Adaptable / declarative linux distribution installer. -Usage: sudo -E bash ~/bin/linuxloops -distro -ver -env -dst +Usage: bash \${HOME}/bin/linuxloops -distro -ver -env -dst -distro, --distribution (Distribution to install) -ver, --version (Distribution version to install) -env, --environment (Environment to install) @@ -1986,7 +1986,7 @@ sed -i 's@^Server@#Server@g' /etc/pacman.d/mirrorlist if [ ! -z "${mirror_Artix}" ]; then echo 'Server = ${mirror_Artix}/\$repo/os/\$arch' >> /etc/pacman.d/mirrorlist else - cur_speed=0; for i in https://ftp.sh.cvut.cz/artix-linux https://mirror1.artixlinux.org/repos https://us-mirror.artixlinux.org; do if ! avg_speed=\$(curl -fsS -m 5 -r 0-1048576 -w '%{speed_download}' -o /dev/null --url "\${i}/world/os/x86_64/world.db" 2> /dev/null); then avg_speed=0; fi; echo Download speed rating for mirror \${i} is \${avg_speed}; if [ \${avg_speed} -gt \${cur_speed} ]; then cur_speed=\${avg_speed}; default_mirror=\${i}; fi; done; echo Using mirror \${default_mirror}; sed -i "s@#Server = \${default_mirror}@Server = \${default_mirror}@g" /etc/pacman.d/mirrorlist + cur_speed=0; for i in https://mirror1.artixlinux.org/repos https://ftp.sh.cvut.cz/artix-linux https://mirror.clarkson.edu/artix-linux; do if ! avg_speed=\$(curl -fsS -m 5 -r 0-1048576 -w '%{speed_download}' -o /dev/null --url "\${i}/world/os/x86_64/world.db" 2> /dev/null); then avg_speed=0; fi; echo Download speed rating for mirror \${i} is \${avg_speed}; if [ \${avg_speed} -gt \${cur_speed} ]; then cur_speed=\${avg_speed}; default_mirror=\${i}; fi; done; echo Using mirror \${default_mirror}; sed -i "s@#Server = \${default_mirror}@Server = \${default_mirror}@g" /etc/pacman.d/mirrorlist fi curl -L https://gitea.artixlinux.org/artix/artix-keyring/raw/branch/master/artix.gpg -o /usr/share/pacman/keyrings/artix.gpg curl -L https://gitea.artixlinux.org/artix/artix-keyring/raw/branch/master/artix-trusted -o /usr/share/pacman/keyrings/artix-trusted @@ -9778,10 +9778,10 @@ INSTALLNVIDIA fi if [ -f "${bootstrapdir}"/linuxloops/install_nvidia ]; then cat >>"${bootstrapdir}"/linuxloops/install_nvidia </etc/systemd/system-shutdown/nvidia.shutdown <<'SHUTDOWNFIX' #!/bin/sh @@ -10958,7 +10958,7 @@ cat >/usr/bin/linuxloops <<'LIVELAUNCHER' set -e sudo curl -L https://raw.githubusercontent.com/sebanc/linuxloops/main/linuxloops -o /usr/bin/linuxloops.real || zenity --height=480 --width=640 --title="LinuxLoops installer" --error --text="Please make sure you have internet connectivity before running this program.\n" 2>/dev/null sudo chmod 0755 /usr/bin/linuxloops.real -sudo -E bash /usr/bin/linuxloops.real "\${@}" +bash /usr/bin/linuxloops.real "\${@}" LIVELAUNCHER chmod 0755 /usr/bin/linuxloops mkdir -p /etc/skel/Desktop @@ -10982,13 +10982,13 @@ Terminal=true Type=Application Categories=System;Filesystem; LIVEMENUICON -mkdir -p /usr/share/glib-2.0/schemas -cat >/usr/share/glib-2.0/schemas/zz_noscreenlock.gschema.override <<'DCONF' -[org.cinnamon.desktop.screensaver] -lock-delay=0 -lock-enabled=false -DCONF -if [ ! -z "\$(command -v glib-compile-schemas)" ]; then glib-compile-schemas /usr/share/glib-2.0/schemas/; fi +#mkdir -p /usr/share/glib-2.0/schemas +#cat >/usr/share/glib-2.0/schemas/zz_noscreenlock.gschema.override <<'DCONF' +#[org.cinnamon.desktop.screensaver] +#lock-delay=0 +#lock-enabled=false +#DCONF +#if [ ! -z "\$(command -v glib-compile-schemas)" ]; then glib-compile-schemas /usr/share/glib-2.0/schemas/; fi mkdir -p /etc/repart.d echo -e '[Partition]\nType=linux-generic' > /etc/repart.d/50-root.conf cat >/etc/systemd/system/live-configuration.service <<'LIVE_CONFIGURATION_SERVICE' @@ -11050,7 +11050,7 @@ for MODULE in nvidia_drm nvidia_modeset nvidia_uvm nvidia; do done NVIDIA_SHUTDOWNFIX chmod 0755 /etc/systemd/system-shutdown/nvidia.shutdown -yes | DEBIAN_FRONTEND=noninteractive apt install nvidia-driver broadcom-sta-dkms firmware-b43-installer breeze-gtk-theme- breeze-icon-theme- oxygen-icon-theme- +yes | DEBIAN_FRONTEND=noninteractive apt install nvidia-driver broadcom-sta-dkms firmware-b43-installer gnome-backgrounds- gnome-icon-theme- materia-gtk-theme- oxygen-icon-theme- papirus-icon-theme- rm -rf /lib/firmware/bnx2x /lib/firmware/dpaa2 /lib/firmware/liquidio /lib/firmware/mellanox /lib/firmware/mrvl/prestera /lib/firmware/netronome /lib/firmware/qcom /lib/firmware/qed /lib/firmware/ti-connectivity INSTALLLIVE chmod 0755 "${bootstrapdir}"/linuxloops/install_live @@ -13600,6 +13600,13 @@ if [ -d /home/runner/work ]; then github=1; fi if [ "$(grep -o 'NAME=[^,]\+' /etc/os-release | cut -d'=' -f2)" == "Chrome OS" ]; then if [ -f /etc/brunch_version ]; then brunch=1; else chromeos=1; fi; fi } +if [[ $EUID -ne 0 ]]; then + if [ -f /etc/NIXOS ] && [ ${#} -eq 0 ]; then + exec sudo --preserve-env=DISPLAY,XAUTHORITY,WAYLAND_DISPLAY nix-shell -p bash -p curl -p gnupg -p sudo -p util-linux -p xz -p python3Packages.pyqt6-webengine --run "bash $0" + else + exec sudo --preserve-env=DISPLAY,XAUTHORITY,WAYLAND_DISPLAY bash "$0" "$@" + fi +fi set +H set_base_parameters if [ ${#} -eq 0 ] || ([ ${#} -eq 2 ] && [ "${1}" == "-G" ]) || ([ ${#} -eq 2 ] && [ "${1}" == "--generate-config" ]); then