summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-xorg-base.in20
1 files changed, 12 insertions, 8 deletions
diff --git a/setup-xorg-base.in b/setup-xorg-base.in
index b7c6bc0..9d50ebe 100644
--- a/setup-xorg-base.in
+++ b/setup-xorg-base.in
@@ -3,18 +3,22 @@
# simple script to setup x basic org server
# you will still need a window manager and login manager or xinit
-base_pkgs="xorg-server xf86-video-vesa xf86-video-modesetting
- xf86-input-evdev xf86-input-mouse xf86-input-keyboard udev"
+base_pkgs="xorg-server xf86-input-libinput eudev"
-# TODO: detect graphics card and pick proper xf86-video-* driver based on that
+apk add pciutils
+vgaline=$(lspci | grep -w VGA)
-# TODO: detect if we need xf86-input-synaptics
+case "$vgaline" in
+*Intel*) videodrv="xf86-video-intel";;
+*AMD*) videodrv="xf86-video-amdgpu";;
+*NVIDIA*) videodrv="xf86-video-nouveau";;
+*VMware*) videodrv="xf86-video-vmware";;
+esac
-# ps mouse
-modprobe psmouse
-grep -q -w psmouse /etc/modules || echo "psmouse" >> /etc/modules
+# fallback driver
+videodrv="$videodrv xf86-video-modesetting"
# install packages
-apk add $base_pkgs $@
+apk add $base_pkgs $videodrv $@
setup-udev