-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBetter-Fedora.sh
260 lines (232 loc) · 7.52 KB
/
Better-Fedora.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#!/bin/bash
# Ask for password
sudo echo "Start"
# Check if it is Linux
echo "Checking for operating system information"
if [ `uname -o` = "GNU/Linux" ]
then
echo `uname -o`
if [ `uname -s` = "Linux" ]
then
echo `uname -s`
else
echo "Error: Not a Linux distribution"
echo "This script will be terminated."
read
exit
fi
else
echo "Error: Not a Linux distribution"
echo "This script will be terminated."
read
exit
fi
# Read and export variables with OS info and silence error output
export $( cat -v /etc/*release ) 2> /dev/null
echo "Detected OS: $NAME $VERSION_ID $VARIANT"
case $ID in
fedora)
# Version check
if (( "$VERSION_ID" < "37" ))
then
echo "$NAME version $VERSION_ID detected"
echo "Only version 37 and newer are supported"
while true;
do
read -p $'Do you wish to proceed?\n' yn
case $yn in
[Yy]* )
echo "Proceeding..."
break
;;
[Nn]* )
echo "This script will be terminated."
read
exit
;;
* ) echo "Please answer \"yes\" or \"no\".";;
esac
done
else
echo "$NAME version $VERSION_ID detected"
fi
# Variant check
if [ "$VARIANT_ID" == "silverblue" ]
then
echo "Variant $VARIANT detected"
else
echo "Variant $VARIANT detected"
echo "Your Fedora variant is not supported."
echo "This script will be terminated."
read
exit
fi
;;
ubuntu)
echo "$NAME detected"
echo "I express you my deepest condolences"
echo "This script will be terminated."
read
exit
;;
*)
echo "Your distribution is not supported. Please check the list of supported distributions."
echo "This script will be terminated."
read
exit
;;
esac
# Enable minimize and maximize buttons
echo "Enabling minimize and maximize buttons"
gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Install "Dash to Dock" by @michele_g
# busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s dash-to-dock@micxgx.gmail.com
# Disable "Dash to Dock" by @michele_g
# gnome-extensions disable "dash-to-dock@micxgx.gmail.com"
# Install "Dash to Panel" by @charlesg99 and @jderose9
busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s dash-to-panel@jderose9.github.com
# Enable "Dash to Panel" by @charlesg99 and @jderose9
gnome-extensions enable "dash-to-panel@jderose9.github.com"
# Add Flathub repository:
echo "Adding Flathub repository"
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Enable Flathub repository:
echo "Enabling Flathub repository"
sudo flatpak remote-modify --enable flathub
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Disable Fedora repository:
echo "Disabling Fedora repository"
sudo flatpak remote-modify --disable fedora
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Remove all applications and runtimes:
echo "Removing all apps and runtimes"
sudo flatpak uninstall --all -y
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Install back Fedora default applications from Flathub:
echo "Installing back default apps from Flathub"
flatpak install flathub -y org.fedoraproject.MediaWriter &&
flatpak install flathub -y org.gnome.Calculator &&
flatpak install flathub -y org.gnome.Calendar &&
flatpak install flathub -y org.gnome.Characters &&
flatpak install flathub -y org.gnome.Connections &&
flatpak install flathub -y org.gnome.Contacts &&
flatpak install flathub -y org.gnome.Evince &&
flatpak install flathub -y org.gnome.Extensions &&
flatpak install flathub -y org.gnome.FileRoller &&
flatpak install flathub -y org.gnome.Logs &&
flatpak install flathub -y org.gnome.Maps &&
flatpak install flathub -y org.gnome.NautilusPreviewer &&
flatpak install flathub -y org.gnome.TextEditor &&
flatpak install flathub -y org.gnome.Weather &&
flatpak install flathub -y org.gnome.baobab &&
flatpak install flathub -y org.gnome.clocks &&
flatpak install flathub -y org.gnome.eog &&
flatpak install flathub -y org.gnome.font-viewer &&
# Install Flatpak apps
echo "Installing Flatpak apps"
flatpak install flathub -y com.google.Chrome &&
flatpak install flathub -y com.anydesk.Anydesk &&
flatpak install flathub -y com.transmissionbt.Transmission &&
flatpak install flathub -y org.videolan.VLC &&
flatpak install flathub -y com.obsproject.Studio &&
flatpak install flathub -y org.libreoffice.LibreOffice &&
flatpak install flathub -y org.gnome.SimpleScan &&
flatpak install flathub -y org.gnome.Firmware &&
flatpak install flathub -y org.gnome.Connections &&
flatpak install flathub -y org.gnome.Boxes &&
flatpak install flathub -y org.gnome.Extensions &&
flatpak install flathub -y com.mattjakeman.ExtensionManager &&
flatpak install flathub -y io.github.realmazharhussain.GdmSettings &&
flatpak install flathub -y com.github.tchx84.Flatseal &&
flatpak install flathub -y com.usebottles.bottles &&
flatpak install flathub -y io.github.prateekmedia.appimagepool &&
flatpak install flathub -y org.telegram.desktop &&
flatpak install flathub -y com.visualstudio.code &&
flatpak install flathub -y io.podman_desktop.PodmanDesktop &&
flatpak install flathub -y com.parsecgaming.parsec
# Install Flatpak runtime extensions
# echo "Installing Flatpak runtime extensions"
# flatpak install flathub -y org.freedesktop.Platform.VulkanLayer.MangoHud
# Enable MangoHud for all Steam (Flatpak) games
# echo "Enabling MangoHud for all Steam (Flatpak) games"
# flatpak override --user \
# --env=MANGOHUD=1 \
# com.valvesoftware.Steam
# if [ $? -eq 0 ];
# then
# echo "[✓] SUCCESS"
# else
# echo "[✗] FAIL"
# fi
# Enable PWA support in Google Chrome
echo "Enabling PWA support in Google Chrome"
flatpak override --user \
--filesystem=~/.local/share/applications:create \
--filesystem=~/.local/share/icons:create \
com.google.Chrome
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Set Google Chrome as the default web browser
echo "Setting Google Chrome as the default web browser"
xdg-settings set default-web-browser com.google.Chrome.desktop
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Set up templates
echo "Creating new.txt template"
touch ~/Templates/new.txt
if [ $? -eq 0 ];
then
echo "[✓] SUCCESS"
else
echo "[✗] FAIL"
fi
# Apply latest updates
if [[ "$VARIANT_ID" == "silverblue" || "kinoite" || "onyx" || "sericea"]]
then
echo "Applying latest updates"
sudo rpm-ostree update
echo "Updates will be applied on next reboot"
else
echo "Your Fedora variant is not supported."
echo "This script will be terminated."
read
exit
fi
# Keep terminal open after completion
echo "✂✂✂ Script ended ✂✂✂"
read