This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 286
/
Copy pathinstall_flatpak_apps
60 lines (57 loc) · 1.64 KB
/
install_flatpak_apps
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
# install app from flathub repository
function install_flathub_app() {
echo_message header "Starting 'install_flathub_app' function..."
# check if flathub repo is added
check_flatpak_repo "flathub" "https://flathub.org/repo/flathub.flatpakrepo" install_flatpak_apps
#install_flatpak_package "Name" "remote" "com.package.Name" return_function
install_flatpak_package ${1} "flathub" ${2} install_flatpak_apps
}
# Install Flatpak Applications
function install_flatpak_apps {
# check if 'flatpak' is installed
check_package "flatpak" main
# install
NAME="Flatpak Applications"
echo_message title "Starting installation of ${NAME,,}..."
status="0"
while [ "$status" -eq 0 ]; do
# Draw window
FLATPAKS=$(eval `resize` && whiptail \
--notags \
--title "Install $NAME" \
--menu "\nWhat ${NAME,,} would you like to install?" \
--ok-button "Install" \
--cancel-button "Go Back" \
$LINES $COLUMNS $(( $LINES - 12 )) \
'install_flatpak_gimp' 'GIMP' \
'install_flatpak_peek' 'Peek' \
'install_flatpak_peek' 'Riot' \
'install_flatpak_steam' 'Steam' \
3>&1 1>&2 2>&3)
case "${FLATPAKS}" in
install_flatpak_gimp)
# install GIMP
install_flathub_app "GIMP" "org.gimp.GIMP"
;;
install_flatpak_peek)
# install Peek
install_flathub_app "Peek" "com.uploadedlobster.peek"
;;
install_flatpak_riot)
# install Riot chat
install_flathub_app "Riot" "im.riot.Riot"
;;
install_flatpak_steam)
# install Steam
install_flathub_app "Steam" "com.valvesoftware.Steam"
;;
*)
# cancel
echo_message info "Returning..."
status=1
main
;;
esac
done
}