-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·33 lines (26 loc) · 877 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Check if the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
WORKINGDIR="$HOME/Downloads/displaylink"
DLFILE="displaylink.tar.gz"
EVDIFILE="evdi.tar.gz"
download_and_extract() {
local file=$1
wget "https://aur.archlinux.org/cgit/aur.git/snapshot/$file" -P "$WORKINGDIR" || exit 1
tar xzvf "$WORKINGDIR/$file" -C "$WORKINGDIR" || exit 1
(cd "$WORKINGDIR" && makepkg -si) || exit 1
}
# Install necessary packages
pacman -S --needed base-devel || exit 1
pacman -S core/linux-headers || exit 1
# Create working directory
mkdir -p "$WORKINGDIR" || exit 1
# Download and install EVDI and DisplayLink
download_and_extract "$EVDIFILE"
download_and_extract "$DLFILE"
# Load the udl module and start the DisplayLink service
modprobe udl || exit 1
systemctl start displaylink.service || exit 1