-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStratOS-choose-brave
executable file
·61 lines (58 loc) · 1.89 KB
/
StratOS-choose-brave
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
#!/bin/bash
bash $(realpath $(dirname $0))/maneki-logo
menu(){
dialog --clear --title "Which Brave do you want?" \
--menu "Choose one of the following options:" 15 40 4 \
1 "Brave (AUR)" \
2 "Brave (Flatpak)" \
3 "Brave (Snap)" \
4 "Exit" 2>&1 >/dev/tty
}
check_flatpak() {
if ! command -v flatpak &>/dev/null; then
echo "Flatpak is not installed. Installing flatpak!"
sudo pacman -S --needed flatpak
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
exit 1
fi
}
check_snap() {
if ! command -v snap &>/dev/null; then
echo "Snap is not installed. Installing snap!"
sudo pacman -S --needed snapd
sudo systemctl enable --now snapd.socket
exit 1
fi
}
while true; do
choice=$(menu)
case $choice in
1)
echo "Downloading Brave (AUR)..."
yay -S brave-bin --noconfirm
echo -e "\n==> Downloaded and Installed Brave (AUR)."
xdg-settings set default-web-browser brave-browser.desktop
echo -e "\nSetting Default Browser to Brave (AUR): OK"
;;
2)
check_flatpak
echo "Downloading Brave (Flatpak)..."
flatpak install flathub com.brave.Browser
echo -e "\n==> Downloaded and Installed Brave (Flatpak)."
flatpak set default-web-browser com.brave.Browser
echo -e "\nSetting Default Browser to Brave (Flatpak): OK"
;;
3)
check_snap
echo "Downloading Brave (Snap)..."
sudo snap install brave
echo -e "\n==> Downloaded and Installed Brave (Snap)."
sudo snap set default-web-browser brave
echo -e "\nSetting Default Browser to Brave (Snap): OK"
;;
4)
echo "Exiting..."
exit 0
;;
esac
done