Skip to content

Commit

Permalink
Add launcher command
Browse files Browse the repository at this point in the history
  • Loading branch information
sebanc committed Oct 16, 2024
1 parent 0433ab8 commit 027c759
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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=''
arg3=''
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
Expand Down
23 changes: 10 additions & 13 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
Usage: bash ${HOME}/bin/linuxloops -distro <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
-distro, --distribution <distribution name> (Distribution to install)
-ver, --version <version name> (Distribution version to install)
-env, --environment <environment name> (Environment to install)
Expand Down Expand Up @@ -159,22 +156,22 @@ Usage: sudo -E bash ~/bin/linuxloops -distro <distribution name> -ver <distribut
```

The main parameters are: the distribution, the version, the environment and the destination. Use the below command to list available distributions, versions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

As an example:
`sudo -E bash ~/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`sudo -E bash ~/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.
`bash ${HOME}/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`bash ${HOME}/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.

### Declarative mode

Have a look at the declarative configuration examples available here:
[Declarative configuration examples][Declarative configuration examples]

The main parameters are: the distribution, the version and the environment. Use the below command to list available distributions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

Create your own declarative configuration and run the below command to start the install:
`sudo -E bash ~/bin/linuxloops -d <path_to_your_declarative_configuration>`
`bash ${HOME}/bin/linuxloops -d <path_to_your_declarative_configuration>`

## Complementary instructions

Expand Down
24 changes: 11 additions & 13 deletions Readme/Install-with-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,21 @@

- To use the GUI installer, install the `PyQtWebEngine` package for your distribution:
Debian / Ubuntu derivatives:
&nbsp;&nbsp;Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine`
&nbsp;&nbsp;Older Debian / Ubuntu versions: `sudo apt install python3-venv python3-pyqt5.qtwebengine`
&nbsp;&nbsp;&nbsp;&nbsp;Debian 12 / Ubuntu 24.04 and above: `sudo apt install python3-venv python3-pyqt6.qtwebengine`
&nbsp;&nbsp;&nbsp;&nbsp;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 <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
Usage: bash ${HOME}/bin/linuxloops -distro <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
-distro, --distribution <distribution name> (Distribution to install)
-ver, --version <version name> (Distribution version to install)
-env, --environment <environment name> (Environment to install)
Expand Down Expand Up @@ -89,22 +87,22 @@ Usage: sudo -E bash ~/bin/linuxloops -distro <distribution name> -ver <distribut
```

The main parameters are: the distribution, the version, the environment and the destination. Use the below command to list available distributions, versions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

As an example:
`sudo -E bash ~/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`sudo -E bash ~/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.
`bash ${HOME}/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`bash ${HOME}/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.

- To use the Declarative installer:

Have a look at the declarative configuration examples available here:
[Declarative configuration examples][Declarative configuration examples]

The main parameters are: the distribution, the version and the environment. Use the below command to list available distributions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

Create your own declarative configuration and run the below command to start the install:
`sudo -E bash ~/bin/linuxloops -d <path_to_your_declarative_configuration>`
`bash ${HOME}/bin/linuxloops -d <path_to_your_declarative_configuration>`

3. Finalisation (For disk installs)

Expand Down
15 changes: 9 additions & 6 deletions Readme/Install-with-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
Usage: bash ${HOME}/bin/linuxloops -distro <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
-distro, --distribution <distribution name> (Distribution to install)
-ver, --version <version name> (Distribution version to install)
-env, --environment <environment name> (Environment to install)
Expand Down Expand Up @@ -79,22 +82,22 @@ Usage: sudo -E bash ~/bin/linuxloops -distro <distribution name> -ver <distribut
```

The main parameters are: the distribution, the version, the environment and the destination. Use the below command to list available distributions, versions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

As an example:
`sudo -E bash ~/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`sudo -E bash ~/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.
`bash ${HOME}/bin/linuxloops -distro Ubuntu -ver 24.04 -env Plasma/Full -dst /dev/sdX -e` will install Ubuntu with the complete kde environment on the drive /dev/sdX with encryption.
`bash ${HOME}/bin/linuxloops -distro Arch -ver Current -env Cinnamon -dst ~/arch.img -s 30 -S` will install Arch with the cinnamon desktop environment and linux-surface patches in a 30 GB image located at /home/username/arch.img.

- To use the Declarative installer:

Have a look at the declarative configuration examples available here:
[Declarative configuration examples][Declarative configuration examples]

The main parameters are: the distribution, the version and the environment. Use the below command to list available distributions and environments:
`sudo -E bash ~/bin/linuxloops -l`
`bash ${HOME}/bin/linuxloops -l`

Create your own declarative configuration and run the below command to start the install:
`sudo -E bash ~/bin/linuxloops -d <path_to_your_declarative_configuration>`
`bash ${HOME}/bin/linuxloops -d <path_to_your_declarative_configuration>`

4. Finalisation (For disk installs)

Expand Down
37 changes: 22 additions & 15 deletions linuxloops
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ usage()
{
cat << USAGE
LinuxLoops: Adaptable / declarative linux distribution installer.
Usage: sudo -E bash ~/bin/linuxloops -distro <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
Usage: bash \${HOME}/bin/linuxloops -distro <distribution name> -ver <distribution version> -env <environment name> -dst <disk name or disk image path>
-distro, --distribution <distribution name> (Distribution to install)
-ver, --version <version name> (Distribution version to install)
-env, --environment <environment name> (Environment to install)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -9778,10 +9778,10 @@ INSTALLNVIDIA
fi
if [ -f "${bootstrapdir}"/linuxloops/install_nvidia ]; then
cat >>"${bootstrapdir}"/linuxloops/install_nvidia <<INSTALLNVIDIA
if [ -f /usr/lib/systemd/system/nvidia-hibernate.service ]; then systemctl enable nvidia-hibernate.service; fi
if [ -f /usr/lib/systemd/system/nvidia-resume.service ]; then systemctl enable nvidia-resume.service; fi
if [ -f /usr/lib/systemd/system/nvidia-suspend.service ]; then systemctl enable nvidia-suspend.service; fi
if [ -d /etc/systemd ]; then
if [ -x /usr/lib/systemd/systemd ]; then
if [ -f /usr/lib/systemd/system/nvidia-hibernate.service ]; then systemctl enable nvidia-hibernate.service; fi
if [ -f /usr/lib/systemd/system/nvidia-resume.service ]; then systemctl enable nvidia-resume.service; fi
if [ -f /usr/lib/systemd/system/nvidia-suspend.service ]; then systemctl enable nvidia-suspend.service; fi
mkdir -p /etc/systemd/system-shutdown
cat >/etc/systemd/system-shutdown/nvidia.shutdown <<'SHUTDOWNFIX'
#!/bin/sh
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 027c759

Please sign in to comment.