diff --git a/bin/blob-install-gaming-gpu-lib32 b/bin/blob-install-gaming-gpu-lib32 index c4ce61a..6a4f012 100755 --- a/bin/blob-install-gaming-gpu-lib32 +++ b/bin/blob-install-gaming-gpu-lib32 @@ -27,4 +27,7 @@ elif blob-hw-nvidia-without-gsp; then PACKAGES+=(lib32-nvidia-580xx-utils) fi -(( ${#PACKAGES[@]} > 0 )) && blob-pkg-add "${PACKAGES[@]}" +if (( ${#PACKAGES[@]} > 0 )); then + blob-pkg-multilib + blob-pkg-add "${PACKAGES[@]}" +fi diff --git a/bin/blob-install-gaming-steam b/bin/blob-install-gaming-steam index a728946..513c3a8 100755 --- a/bin/blob-install-gaming-steam +++ b/bin/blob-install-gaming-steam @@ -6,6 +6,7 @@ set -e echo "Installing Steam..." +blob-pkg-multilib blob-pkg-add steam blob-install-gaming-gpu-lib32 diff --git a/bin/blob-pkg-multilib b/bin/blob-pkg-multilib new file mode 100755 index 0000000..de13301 --- /dev/null +++ b/bin/blob-pkg-multilib @@ -0,0 +1,30 @@ +#!/bin/bash + +# blob:summary=Enable the multilib repository in pacman.conf if it is disabled +# blob:requires-sudo=true + +pacman_conf=/etc/pacman.conf + +multilib_enabled() { + grep -q '^\[multilib\]' "$pacman_conf" +} + +as_root() { + if (( EUID == 0 )); then + "$@" + else + sudo "$@" + fi +} + +multilib_enabled && exit 0 + +echo "Enabling the multilib repository..." +as_root sed -i '/^#\[multilib\]$/,/^#Include/ s/^#//' "$pacman_conf" + +if ! multilib_enabled; then + echo -e "\033[31mError: Could not enable multilib in $pacman_conf\033[0m" >&2 + exit 1 +fi + +as_root pacman -Syu --noconfirm diff --git a/docs/commands.md b/docs/commands.md index 873fd22..db7d351 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -379,6 +379,7 @@ of the `blob` listing. | `blob-pkg-drop` | Remove all the named packages from the system if they're installed (otherwise ignore). | | | `blob-pkg-install` | Show a fuzzy-finder TUI for picking new Arch and OPR packages to install. | - | | `blob-pkg-missing` | Returns true if any of the named packages are missing from the system (or false if they're all there). | | +| `blob-pkg-multilib` | Enable the multilib repository in pacman.conf if it is disabled | - | | `blob-pkg-present` | Returns true if all of the named packages are installed on the system (or false if any of them are missing). | | | `blob-pkg-remove` | Show a fuzzy-finder TUI for picking packages installed on the system to be removed. | - |