Files
davidandClaude Opus 5.5 a102e6fe0b
shellcheck / shellcheck (push) Successful in 11s
Check the machine before installing, and keep old shells' mise working
install.sh now stops early, with a clear message, if this isn't 64-bit
Arch, it's run as root, there's no internet, or sudo doesn't work.
system/preflight.sh then asks before going on with too little disk space
or / not on btrfs, and offers to switch another login screen to GDM and
PulseAudio to PipeWire. Keeping another login screen puts GDM in
services-off, so install and update stop failing to enable it; a
migration does the same on existing machines. It says nothing when all
is well, as refresh runs install.sh again.

Intel GPUs also get intel-media-driver for hardware video decoding, with
a migration for existing machines.

The mise migration links ~/.local/bin/mise to /usr/bin/mise instead of
deleting it, so shells opened before the update don't print an error at
every prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 08:25:46 -06:00

29 lines
910 B
Bash

#!/bin/bash
#
# Purpose : Install the Vulkan driver for each Intel or AMD GPU in the machine,
# and Intel's video decoding driver (VA-API), so video and calls
# don't decode on the CPU. AMD's comes with mesa, NVIDIA's with its
# driver (see nvidia.sh).
set -e
source "$HOME/.local/share/coredesktop/utils.sh"
# Read vendor IDs from sysfs: lspci needs pciutils and wakes suspended GPUs
PACKAGES=()
for device in /sys/bus/pci/devices/*; do
[[ $(< "$device/class") == 0x03* ]] || continue
case "$(< "$device/vendor")" in
# intel-media-driver covers Broadwell (2014) and newer
0x8086) PACKAGES+=(vulkan-intel intel-media-driver) ;;
0x1002) PACKAGES+=(vulkan-radeon) ;;
esac
done
if (( ${#PACKAGES[@]} > 0 )); then
mapfile -t PACKAGES < <(printf '%s\n' "${PACKAGES[@]}" | sort -u)
install_packages "${PACKAGES[@]}"
else
echo "No Intel or AMD GPU found."
fi