Minor improvements to install-stormux. Added xdotool dependency for I38.

This commit is contained in:
Storm Dragon
2025-12-19 02:56:48 -05:00
parent 3d62262849
commit d8056278d2

View File

@@ -256,15 +256,27 @@ partition_disk_uefi_separate_home() {
local disk="$1" local disk="$1"
log_info "Creating UEFI separate home partition layout on $disk" log_info "Creating UEFI separate home partition layout on $disk"
# Get disk size in GB for calculating root partition size # Get disk size in MiB for calculating root partition size
local diskSizeGB local diskSizeMiB
diskSizeGB=$(lsblk -dno SIZE "$disk" | grep -oE '[0-9]+' | head -1) diskSizeMiB=$(lsblk -dno SIZE -b "$disk" | awk '{print int($1/1024/1024)}')
# Calculate root partition size (30GB or 40% of disk, whichever is larger) # Calculate root partition size (30GiB or 40% of disk, whichever is larger)
local rootSizeGB=30 local rootSizeMiB=$((30 * 1024))
local fortyPercent=$((diskSizeGB * 40 / 100)) local fortyPercentMiB=$((diskSizeMiB * 40 / 100))
if [[ $fortyPercent -gt $rootSizeGB ]]; then if [[ $fortyPercentMiB -gt $rootSizeMiB ]]; then
rootSizeGB=$fortyPercent rootSizeMiB=$fortyPercentMiB
fi
# Ensure space for EFI (1GiB) and a minimal home partition (1GiB)
local efiEndMiB=1025
local minHomeMiB=1024
local maxRootMiB=$((diskSizeMiB - efiEndMiB - minHomeMiB))
if [[ $maxRootMiB -lt 1024 ]]; then
log_error "Disk too small for separate /home partition layout"
return 1
fi
if [[ $rootSizeMiB -gt $maxRootMiB ]]; then
rootSizeMiB=$maxRootMiB
fi fi
# Wipe existing partition table # Wipe existing partition table
@@ -278,7 +290,7 @@ partition_disk_uefi_separate_home() {
parted -s "$disk" set 1 esp on parted -s "$disk" set 1 esp on
# Create root partition # Create root partition
local rootEndMiB=$((1025 + rootSizeGB * 1024)) local rootEndMiB=$((efiEndMiB + rootSizeMiB))
parted -s "$disk" mkpart primary ext4 1025MiB "${rootEndMiB}MiB" parted -s "$disk" mkpart primary ext4 1025MiB "${rootEndMiB}MiB"
# Create home partition (rest of disk) # Create home partition (rest of disk)
@@ -344,15 +356,26 @@ partition_disk_bios_separate_home() {
local disk="$1" local disk="$1"
log_info "Creating BIOS separate home partition layout on $disk" log_info "Creating BIOS separate home partition layout on $disk"
# Get disk size in GB # Get disk size in MiB
local diskSizeGB local diskSizeMiB
diskSizeGB=$(lsblk -dno SIZE "$disk" | grep -oE '[0-9]+' | head -1) diskSizeMiB=$(lsblk -dno SIZE -b "$disk" | awk '{print int($1/1024/1024)}')
# Calculate root partition size (30GB or 40% of disk, whichever is larger) # Calculate root partition size (30GiB or 40% of disk, whichever is larger)
local rootSizeGB=30 local rootSizeMiB=$((30 * 1024))
local fortyPercent=$((diskSizeGB * 40 / 100)) local fortyPercentMiB=$((diskSizeMiB * 40 / 100))
if [[ $fortyPercent -gt $rootSizeGB ]]; then if [[ $fortyPercentMiB -gt $rootSizeMiB ]]; then
rootSizeGB=$fortyPercent rootSizeMiB=$fortyPercentMiB
fi
# Ensure space for a minimal home partition (1GiB)
local minHomeMiB=1024
local maxRootMiB=$((diskSizeMiB - 1 - minHomeMiB))
if [[ $maxRootMiB -lt 1024 ]]; then
log_error "Disk too small for separate /home partition layout"
return 1
fi
if [[ $rootSizeMiB -gt $maxRootMiB ]]; then
rootSizeMiB=$maxRootMiB
fi fi
# Wipe existing partition table # Wipe existing partition table
@@ -362,7 +385,7 @@ partition_disk_bios_separate_home() {
parted -s "$disk" mklabel msdos parted -s "$disk" mklabel msdos
# Create root partition # Create root partition
local rootEndMiB=$((1 + rootSizeGB * 1024)) local rootEndMiB=$((1 + rootSizeMiB))
parted -s "$disk" mkpart primary ext4 1MiB "${rootEndMiB}MiB" parted -s "$disk" mkpart primary ext4 1MiB "${rootEndMiB}MiB"
parted -s "$disk" set 1 boot on parted -s "$disk" set 1 boot on
@@ -416,25 +439,25 @@ partition_disks() {
case "$partitionLayout" in case "$partitionLayout" in
single) single)
if [[ "$bootMode" == "uefi" ]]; then if [[ "$bootMode" == "uefi" ]]; then
partition_disk_uefi_single "$targetDisk" partition_disk_uefi_single "$targetDisk" || return 1
else else
partition_disk_bios_single "$targetDisk" partition_disk_bios_single "$targetDisk" || return 1
fi fi
;; ;;
separate_home) separate_home)
if [[ "$bootMode" == "uefi" ]]; then if [[ "$bootMode" == "uefi" ]]; then
partition_disk_uefi_separate_home "$targetDisk" partition_disk_uefi_separate_home "$targetDisk" || return 1
else else
partition_disk_bios_separate_home "$targetDisk" partition_disk_bios_separate_home "$targetDisk" || return 1
fi fi
;; ;;
separate_disk) separate_disk)
if [[ "$bootMode" == "uefi" ]]; then if [[ "$bootMode" == "uefi" ]]; then
partition_disk_uefi_root_only "$targetDisk" partition_disk_uefi_root_only "$targetDisk" || return 1
partition_disk_uefi_home_only "$homeDisk" partition_disk_uefi_home_only "$homeDisk" || return 1
else else
partition_disk_bios_root_only "$targetDisk" partition_disk_bios_root_only "$targetDisk" || return 1
partition_disk_bios_home_only "$homeDisk" partition_disk_bios_home_only "$homeDisk" || return 1
fi fi
;; ;;
esac esac
@@ -861,7 +884,7 @@ install_base_system() {
allPackages+=(python-i3ipc python-wxpython sox yad) allPackages+=(python-i3ipc python-wxpython sox yad)
allPackages+=(lxsession magic-wormhole pcmanfm) allPackages+=(lxsession magic-wormhole pcmanfm)
allPackages+=(python-gobject python-pillow python-pytesseract scrot tesseract) allPackages+=(python-gobject python-pillow python-pytesseract scrot tesseract)
allPackages+=(tesseract-data-eng udiskie xorg-setxkbmap) allPackages+=(tesseract-data-eng udiskie xorg-setxkbmap xdotool)
# Add Stormux-specific i3 packages # Add Stormux-specific i3 packages
stormuxPackages+=(xlibre-xserver xlibre-input-libinput nodm-dgw brave-bin) stormuxPackages+=(xlibre-xserver xlibre-input-libinput nodm-dgw brave-bin)
;; ;;
@@ -1221,6 +1244,12 @@ if [[ "${desktopEnvironment}" == "i3" ]]; then
echo "Configuring I38 for accessibility..." echo "Configuring I38 for accessibility..."
cd /home/\$firstUser/git/I38 || exit 1 cd /home/\$firstUser/git/I38 || exit 1
# Ensure xdotool is available for I38 setup
if ! command -v xdotool >/dev/null 2>&1; then
echo "Installing xdotool for I38..."
pacman -Sy --noconfirm --needed xdotool 2>/dev/null || true
fi
# Run I38 setup scripts as the user # Run I38 setup scripts as the user
# -x generates xinitrc and xprofile # -x generates xinitrc and xprofile
# Main script generates i3 config with accessibility features # Main script generates i3 config with accessibility features