-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfedora_ws_base.sh
211 lines (198 loc) · 5.5 KB
/
fedora_ws_base.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#! /bin/bash
# Script by Farid Zellipour
# https://github.com/FaridZelli
# Last updated 2024-11-15 7:37 PM
# Check the current user
USER=$(whoami)
if [ "$USER" == "root" ]; then
# Welcome text
echo -e "
--------------------------------------------------
\033[32mYou are logged in as root.\033[0m
--------------------------------------------------"
else
# Non-root user detected
echo -e "
--------------------------------------------------
\033[31mWARNING: You do not seem to be logged in as root!\033[0m
--------------------------------------------------"
fi
# Ask whether to proceed
echo -e "
This script will reconfigure your \033[36mFedora Workstation\033[0m environment.
I am not responsible for any damage or data loss that may occur.
\033[33mDo you wish to continue? (Y/N)\033[0m
"
# User input
read -p "Your choice:" ANSWER
# Read input
case $ANSWER in
[Yy]* )
# Proceed with the rest of the script
;;
* )
# Stop the script for any other input
echo "Stopping the script..."
exit 1
;;
esac
# Ask whether to install codecs
echo -e "
\033[33mWould you like to install multimedia codecs from RPM Fusion? (Recommended)\033[0m
1) Yes, install proprietary codecs
2) No, skip this step
0) Exit
"
# User input
read -p "Your choice:" ANSWER
# Read input
case $ANSWER in
1 )
# Adding RPM Fusion repository
dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf config-manager setopt fedora-cisco-openh264.enabled=1
dnf config-manager setopt rpmfusion-free.enabled=1
dnf config-manager setopt rpmfusion-free-updates.enabled=1
dnf config-manager setopt rpmfusion-nonfree.enabled=1
dnf config-manager setopt rpmfusion-nonfree-updates.enabled=1
# Installing codecs
dnf swap ffmpeg-free ffmpeg --allowerasing
dnf install pipewire-codec-aptx libavcodec-freeworld gstreamer1-plugins-{base,good,good-extras,bad-freeworld,ugly} gstreamer1-plugin-{openh264,libav} --allowerasing
dnf upgrade @multimedia --allowerasing
;;
2 )
# Proceed with the rest of the script
echo "Skipping..."
;;
0 )
# Exit the script
echo "Stopping the script..."
exit 1
;;
* )
# Stop the script for any other input
echo "Invalid input, stopping the script..."
exit 1
;;
esac
# Ask whether to setup hardware acceleration
echo -e "
\033[33mWould you like to setup hardware video acceleration? (Recommended)\033[0m
1) Yes, install everything for Intel and AMD GPUs
2) Yes, install Intel Media Driver and Intel Compute Runtime (for Intel GPUs)
3) Yes, install Mesa VAAPI and VDPAU drivers (for AMD GPUs)
4) No, skip this step
0) Exit
"
# User input
read -p "Your choice:" ANSWER
# Read input
case $ANSWER in
1 )
# Installing drivers
dnf install intel-media-driver intel-compute-runtime
dnf swap mesa-va-drivers mesa-va-drivers-freeworld
dnf swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld
;;
2 )
# Installing drivers
dnf install intel-media-driver intel-compute-runtime
;;
3 )
# Installing drivers
dnf swap mesa-va-drivers mesa-va-drivers-freeworld
dnf swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld
;;
4 )
# Proceed with the rest of the script
echo "Skipping..."
;;
0 )
# Exit the script
echo "Stopping the script..."
exit 1
;;
* )
# Stop the script for any other input
echo "Invalid input, stopping the script..."
exit 1
;;
esac
# Ask whether to setup Flathub
echo -e "
\033[33mWould you like to install Flatpak and setup Flathub?\033[0m
1) Yes, install Flatpak and only add Flathub
2) Yes, install Flatpak and add Flathub + Flathub Beta
3) No, skip this step
0) Exit
"
# User input
read -p "Your choice:" ANSWER
# Read input
case $ANSWER in
1 )
# Installing Flatpak
dnf install flatpak
# Adding Flathub
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-modify --enable flathub
;;
2 )
# Installing Flatpak
dnf install flatpak
# Adding Flathub and Flathub Beta
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists flathub-beta https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo
flatpak remote-modify --enable flathub
flatpak remote-modify --enable flathub-beta
;;
3 )
# Proceed with the rest of the script
echo "Skipping..."
;;
0 )
# Exit the script
echo "Stopping the script..."
exit 1
;;
* )
# Stop the script for any other input
echo "Invalid input, stopping the script..."
exit 1
;;
esac
# Ask whether to install remove-retired-packages
echo -e "
\033[33mWould you like to install remove-retired-packages?\033[0m
1) Yes, install remove-retired-packages
2) No, skip this step
0) Exit
"
# User input
read -p "Your choice:" ANSWER
# Read input
case $ANSWER in
1 )
# Installing remove-retired-packages
dnf install remove-retired-packages
;;
2 )
# Proceed with the rest of the script
echo "Skipping..."
;;
0 )
# Exit the script
echo "Stopping the script..."
exit 1
;;
* )
# Stop the script for any other input
echo "Invalid input, stopping the script..."
exit 1
;;
esac
# End of script
echo -e "
--------------------------------------------------
\033[32mIt's time to reboot!\033[0m
--------------------------------------------------"