-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·121 lines (92 loc) · 3.4 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·121 lines (92 loc) · 3.4 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
set -euo pipefail
# Import utils and settings
cd "$(dirname "${BASH_SOURCE[0]}")" &&
. "setup/utils.sh" && . "os/settings.sh"
# Functions
init_fedora_setup() {
print_in_purple " • Starting initial Fedora setup "
./os/fedora/init_fedora_setup.sh
print_in_green " • Initial setup done! "
}
install_extensions_and_pkg_managers() {
print_in_purple " • Installing basic extensions and pkg managers "
./os/fedora/extensions_and_pkg_managers.sh
print_in_green " • Finished installing basic extensions and pkg managers! "
sleep 2
}
install_dev_packages() {
print_in_purple " • Installing dev pa,ckages "
./os/dev_packages.sh
print_in_green " Dev packages installed! "
sleep 2
}
setup_os_theme_and_terminal_style() {
print_in_purple " • Setting up OS theme and terminal tweaks "
./os/theme/main.sh
print_in_green " Theme and terminal setup done! "
sleep 2
}
set_wallpaper() {
print_in_yellow " • Setting wallpaper "
# Check if gsettings is available
if ! command -v gsettings &> /dev/null; then
print_in_red "gsettings not found. Please install it to set the wallpaper."
return 1
fi
# Set the wallpaper using gsettings
gsettings set org.gnome.desktop.background picture-uri "file:///home/chaitanya/dotfiles/wallpaper/mandelbrot_set.jpg"
print_in_green " • Wallpaper set! "
}
fedora_setup_final() {
# cleanup
sudo dnf autoremove -y
# Enable and start services
print_in_yellow " • Enabling and starting services "
set_wallpaper
# to do : add services to enable and start here
print_in_green "\n • All done! Install the suggested extensions and restart. \n"
}
install_nvidia_drivers() {
print_in_purple " • Checking for NVIDIA GPU drivers"
# Check for NVIDIA GPU
if lspci | grep -i nvidia &>/dev/null; then
echo "NVIDIA GPU detected. Installing drivers..."
# Enable RPM Fusion repositories
sudo dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
sudo dnf install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
# Update package cache
sudo dnf update -y
# Install NVIDIA drivers and necessary packages
sudo dnf install -y akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs
# For CUDA support (optional)
sudo dnf install -y xorg-x11-drv-nvidia-cuda
echo "NVIDIA drivers installed. Please reboot your system to apply changes."
elif lspci | grep -i "Advanced Micro Devices" &>/dev/null || lspci | grep -i "AMD" &>/dev/null; then
echo "AMD GPU detected. No need to install drivers manually on Fedora."
echo "Fedora already includes open-source AMD drivers. You're good to go!"
else
echo "No NVIDIA GPU detected. Skipping driver installation."
fi
}
update_device_firmware() {
print_in_purple " • Updating device firmwares... "
sudo fwupdmgr get-devices
sudo fwupdmgr refresh --force
sudo fwupdmgr get-updates
sudo fwupdmgr update -y
}
main() {
init_fedora_setup
install_extensions_and_pkg_managers
install_dev_packages
setup_os_theme_and_terminal_style
fedora_setup_final
install_nvidia_drivers
update_device_firmware
}
if [ "$#" -gt 0 ]; then
"$@"
else
main
fi