-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflatpak.sh
60 lines (48 loc) · 3.94 KB
/
flatpak.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
#!/bin/bash
set -Eeuo pipefail
source <(curl -s https://codeberg.org/f1uff3h/bash/raw/tag/v0.0.7/handlers.sh)
handle_root
handle_errors
cat <<EOT
███ █████ ████ ████
░░░ ░░███ ░░███ ░░███
████ ████████ █████ ███████ ██████ ░███ ░███
░░███ ░░███░░███ ███░░ ░░░███░ ░░░░░███ ░███ ░███
░███ ░███ ░███ ░░█████ ░███ ███████ ░███ ░███
░███ ░███ ░███ ░░░░███ ░███ ███ ███░░███ ░███ ░███
█████ ████ █████ ██████ ░░█████ ░░████████ █████ █████
░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░░░░░
██████ ████ █████ █████
███░░███░░███ ░░███ ░░███
░███ ░░░ ░███ ██████ ███████ ████████ ██████ ░███ █████ █████
███████ ░███ ░░░░░███ ░░░███░ ░░███░░███ ░░░░░███ ░███░░███ ███░░
░░░███░ ░███ ███████ ░███ ░███ ░███ ███████ ░██████░ ░░█████
░███ ░███ ███░░███ ░███ ███ ░███ ░███ ███░░███ ░███░░███ ░░░░███
█████ █████░░████████ ░░█████ ░███████ ░░████████ ████ █████ ██████
░░░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░███░░░ ░░░░░░░░ ░░░░ ░░░░░ ░░░░░░
░███
█████
░░░░░
EOT
log info "Detecting OS"
if [ -f /etc/os-release ]; then
source /etc/os-release
else
log error "OS detection failed"
exit 1
fi
log info "OS detected: $ID"
case $ID in
ubuntu)
log info "Installing flatpak"
apt-get install -y flatpak gnome-software-plugin-flatpak
;;
*)
log error "OS $ID is not supported"
;;
esac
userName=$(id -un 1000)
log info "Adding flathub remote"
sudo -u "${userName}" /bin/bash -e -c "flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo"
log info "Installing flatpaks"
sudo -u "${userName}" /bin/bash -e -c "flatpak install -y --user flathub com.github.tchx84.Flatseal ca.desrt.dconf-editor com.bitwarden.desktop com.brave.Browser com.jgraph.drawio.desktop com.mattjakeman.ExtensionManager com.rustdesk.RustDesk me.proton.Mail org.localsend.localsend_app"