fix: array not exportable in bash

This commit is contained in:
ange 2024-05-25 16:58:59 +02:00
parent a69d60fa19
commit 88f882668f
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
8 changed files with 58 additions and 56 deletions

6
config
View File

@ -18,10 +18,8 @@ shell=zsh
hostname="$username-pc"
tz=Europe/Paris
locales=(
en_US
)
lang="${locales[0]}"
locales=en_US # e.g. 'en_US,fr_FR'
lang=en_US
pkg=(
base-devel man-{db,pages} tldr

View File

@ -6,4 +6,6 @@ set -a
. ./config
set +a
printf '%s\n' "${pkg[@]}" > pkglist.txt
bash ./modules/"$install_type".sh

View File

@ -2,7 +2,8 @@
#shellcheck disable=SC2154
cp -r ./modules/chroot/ /mnt/
for i in *.sh; do
for i in ./modules/prechroot/*.sh; do
bash -x "$i"
done

View File

@ -4,9 +4,9 @@
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
hwclock --systohc
for l in "${locales[@]}"; do
while read -r l; do
sed -i "/^#\s*$l.UTF-8/s/^#\s*//" /etc/locale.gen
done
done < <(sed 's/,/\n/g' "$locales")
locale-gen
echo "LANG=$lang.UTF-8" > /etc/locale.conf

View File

@ -1,4 +1,4 @@
#!/bin/bash
#shellcheck disable=SC2154
[ -n "$flatpak" ] && flatpak install -y "${flatpak[@]}"
[ -s flatpak.txt ] && xargs flatpak install -y < flatpak.txt

View File

@ -1,42 +1,42 @@
#!/bin/bash
#shellcheck disable=SC2154
pkg+=(
aerc w3m
bluez{,-utils}
dunst libnotify
feh
gammastep
graphicsmagick ghostscript
gvfs{,-gphoto2,-mtp}
materia-gtk-theme papirus-icon-theme
monero
mpv
#newsraft
noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} otf-font-awesome
pass{,-otp} gcr
pcmanfm-gtk3
pipewire{,-pulse,-jack} pavucontrol playerctl
polkit-gnome
qemu-{base,audio-pipewire,hw-usb-host,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq
xdg-user-dirs
yt-dlp
zathura{,-pdf-poppler}
zenity
)
printf '%s\n' \
aerc w3m \
bluez{,-utils} \
dunst libnotify \
feh \
gammastep \
graphicsmagick ghostscript \
gvfs{,-gphoto2,-mtp} \
materia-gtk-theme papirus-icon-theme \
monero \
mpv \
noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} otf-font-awesome \
pass{,-otp} gcr \
pcmanfm-gtk3 \
pipewire{,-pulse,-jack} pavucontrol playerctl \
polkit-gnome \
qemu-{base,audio-pipewire,hw-usb-host,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq \
xdg-user-dirs \
yt-dlp \
zathura{,-pdf-poppler} \
zenity \
>> pkglist.txt
flatpakpkg+=(
com.valvesoftware.Steam org.freedesktop.Platform.VulkanLayer.gamescope
net.lutris.Lutris
org.gimp.GIMP
org.gtk.Gtk3theme.Materia-dark
org.mozilla.firefox
)
printf '%s\n' \
com.valvesoftware.Steam org.freedesktop.Platform.VulkanLayer.gamescope \
net.lutris.Lutris \
org.gimp.GIMP \
org.gtk.Gtk3theme.Materia-dark \
org.mozilla.firefox \
>> flatpak.txt
case "$(lspci | grep 'VGA\|3D')" in
*AMD*) pkg+=(vulkan-radeon) ;;
*Intel*) pkg+=(vulkan-intel) ;;
*NVIDIA*) pkg+=(vulkan-nouveau) ;;
*AMD*) echo vulkan-radeon >> pkglist.txt ;;
*Intel*) echo vulkan-intel >> pkglist.txt ;;
*NVIDIA*) echo vulkan-nouveau >> pkglist.txt ;;
*) ;;
esac

View File

@ -1,22 +1,22 @@
#!/bin/bash
#shellcheck disable=SC2154
pkg+=(
autorandr
i3lock xss-lock
picom
xorg-{server,xinit,xrandr,xsetroot} xclip xdotool
)
printf '%s\n' \
autorandr \
i3lock xss-lock \
picom \
xorg-{server,xinit,xrandr,xsetroot} xclip xdotool \
>> pkglist.txt
case "$(lsmod)" in
*amdgpu*) pkg+=(xf86-video-amdgpu) ;;
*amdgpu*) echo xf86-video-amdgpu >> pkglist.txt ;;
*i915*)
# https://wiki.archlinux.org/title/Intel_graphics#Installation
#pkg+=(xf86-video-intel)
#echo xf86-video-intel >> pkglist.txt
;;
*nouveau*)
# https://bugs.freedesktop.org/show_bug.cgi?id=94844#c3
#pkg+=(xf86-video-nouveau)
#echo xf86-video-nouveau >> pkglist.txt
;;
*)
;;

View File

@ -2,16 +2,17 @@
#shellcheck disable=SC2154
case "$(lscpu)" in
*AMD*) pkg+=(amd-ucode) ;;
*Intel*) pkg+=(intel-ucode) ;;
*AMD*) echo amd-ucode >> pkglist.txt ;;
*Intel*) echo intel-ucode >> pkglist.txt ;;
*) ;;
esac
[ -n "$flatpak" ] && pkg+=(flatpak xdg-desktop-portal-gtk)
[ -s "$flatpakpkg" ] \
&& printf '%s\n' flatpak xdg-desktop-portal-gtk >> pkglist.txt
[ -f /sys/class/power_supply/BAT0 ] && pkg+=(tlp)
[ -f /sys/class/power_supply/BAT0 ] && echo tlp >> pkglist.txt
pacstrap -C rootfs/etc/pacman.conf -K /mnt/ \
base linux{,-lts,-firmware} "$shell" "${pkg[@]}"
base linux{,-lts,-firmware} "$shell" - < pkglist.txt
find /mnt/etc -name '*.pacnew' -delete