-
Notifications
You must be signed in to change notification settings - Fork 6
/
debian_nvidia_drivers_installation.sh
executable file
·50 lines (40 loc) · 1.22 KB
/
debian_nvidia_drivers_installation.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Author :Julio Sanz
# Website :www.elarraydejota.com
# Description :script to install Nvidia propietary drivers in Debian GNU/Linux
# Tested in :Debian Wheezy/Jessie
# Usage :Just launch the script -> ./debian_nvidia_drivers_installation.sh
# License :GPLv3
#
########################################################################################################
#
# VARIABLES
#
# Detect Nvidia card model
NVIDIA_CARD=$(nvidia-detect)
#
# FUNCTIONS
#
driver_installation(){
echo "Detected Nvidia card >>> $NVIDIA_CARD"
echo "Installing drivers..."
# Install Nvidia kernel driver and linux-headers
aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms nvidia-settings nvidia-glx
# X.org configuration file
mkdir /etc/X11/xorg.conf.d
echo -e 'Section "Device"\n\tIdentifier "${NVIDIA_CARD}"\n\tDriver "nvidia"\nEndSection' > /etc/X11/xorg.conf.d/20-nvidia.conf
echo "Done. Now, just reboot your machine"
}
how_to_use(){
echo "This script is intended to work without parameters"
echo "Just launch it -> ./debian_nvidia_drivers_installation.sh"
}
#
# MAIN
#
if [ $# -ne 0 ];then
how_to_use
else
driver_installation
fi