-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinitialize-graphics
More file actions
executable file
·67 lines (56 loc) · 1.81 KB
/
initialize-graphics
File metadata and controls
executable file
·67 lines (56 loc) · 1.81 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
############################################################
# Copyright (c) 2015 Jonathan Yantis
# Released under the MIT license
############################################################
# Is the host using Nvidia drivers?
if [ -f /proc/driver/nvidia/version ];
then
# If it is my unique version (modified to make sure only I have it)
# Then just start X so it doesn't take over my screens.
CHECKSUM=$(md5sum /proc/driver/nvidia/version | cut -b1-32)
if [[ $CHECKSUM = "d2a02e1560be195870db33679a77d3e5" ]]
then
echo "X Server Disabled"
exit 0
fi
# Might be cleaner to remove the mesa libraries once
# But doing it this way allows the user to still use mesa
# If all else fails.
# Get the string that has the version info from the host
NVIDIA=$(cat /proc/driver/nvidia/version | grep NVRM)
# Is this the 304 series?
if [[ $NVIDIA == *" 304."* ]]
then
cd /root/nvidia/304/
pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl
pacman -U --noconfirm *.xz
fi
# Is this the 340 series?
if [[ $NVIDIA == *" 340."* ]]
then
cd /root/nvidia/340/
pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl
pacman -U --noconfirm *.xz
fi
# Is this the 346 series?
if [[ $NVIDIA == *" 346."* ]]
then
cd /root/nvidia/346/
pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl
pacman -U --noconfirm *.xz
fi
# Is it version 367 (BETA) ?
if [[ $NVIDIA == *" 367."* ]]
then
cd /root/nvidia/367/
pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl
pacman -U --noconfirm *.xz
fi
# Configure for headless operation for all GPUs on the system.
/usr/bin/nvidia-xconfig --query-gpu-info | \
grep BusID | \
cut -d \ -f6 | \
xargs -I{} nvidia-xconfig --use-display-device=none --busid={}
fi
# vim:set ts=2 sw=2 et: