-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·171 lines (151 loc) · 6.05 KB
/
install.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
#! /bin/bash
#
# Part of kde-service-menu-revideo Version 0.2.0
# Copyright (C) 2018-2019 Giuseppe Benigno <giuseppe.benigno(at)gmail.com>
# Copyright (C) 2024 <fashim99.(at)gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# environment variables
qtpaths_bin="${qtpaths_bin:-"qtpaths"}"
user_install_prefix="${user_install_prefix:-"${HOME}/.local"}"
# local variables
required_vars=("bin_dir" "servicemenu_dir" "doc_dir")
# determine installation directories
if [[ ${EUID} -eq 0 ]]; then
printf "Sudo install for revideo is not recommended if you want the full package! \n"
printf "It will only install the minimal version. \n\n"
printf "Are you sure you want to proceed ? \n\n"
are_you_sure_list=("Yes, proceed anyway!" "No, abort mission!")
select inst in "${are_you_sure_list[@]}"; do
case $inst in
("Yes, proceed anyway!")
bin_dir="$(${qtpaths_bin} --install-prefix)/bin"
servicemenu_dir="$(${qtpaths_bin} --locate-dirs GenericDataLocation kio/servicemenus | sed 's/.*://')"
doc_dir="$(${qtpaths_bin} --install-prefix)/share/doc/kde-service-menu-revideo/"
install_mode="system"
install_list=("Get this AI garbage off my lawn!!!" "I'll have some of it..." "Everything you have!")
fav="Get this AI garbage off my lawn!!!"
break
;;
("No, abort mission!")
echo "Exiting install..."
exit 1
;;
(*) echo "Exiting install..."
exit 1
esac
done
else
bin_dir="${user_install_prefix}/bin"
servicemenu_dir="$(${qtpaths_bin} --locate-dirs GenericDataLocation kio/servicemenus | sed 's/:.*//')"
doc_dir="${user_install_prefix}/share/doc/kde-service-menu-revideo/"
install_mode="local"
install_list=("Get this AI garbage off my lawn!!!" "I'll have some of it..." "Everything you have!")
fi
# ensure all required variables are set
for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
echo "ERROR: Required variable ${var} was not set successfully. Aborting installation of kde-service-menu-revideo."
exit 1
fi
done
if [[ ${EUID} -ne 0 ]]; then
echo "Installing kde-service-menu-revideo (${install_mode}) ..."
printf "revideo comes with extra AI tools that requires extra installation. \n\n"
printf "Which install do you want to do ? \n"
select fav in "${install_list[@]}"; do
break
done
fi
case $fav in
("Get this AI garbage off my lawn!!!")
echo "OK. Beginning minimal install:"
# install required binaries
install -d "${bin_dir}" && \
install -m 755 -p bin/* "${bin_dir}" && \
# install documentation files
install -d "${doc_dir}" && \
install -m 644 -p doc/* "${doc_dir}"
# install service menus
install -d "${servicemenu_dir}" && \
install -m 755 -p ServiceMenus/minimal/*.desktop "${servicemenu_dir}" && \
sleep 0.01
;;
("I'll have some of it...")
echo "OK. Beginning normal install:"
# install required binaries
install -d "${bin_dir}" && \
install -m 755 -p bin/* "${bin_dir}" && \
# install documentation files
install -d "${doc_dir}" && \
install -m 644 -p doc/* "${doc_dir}"
# install service menus
install -d "${servicemenu_dir}" && \
install -m 755 -p ServiceMenus/normal/*.desktop "${servicemenu_dir}" && \
# install extra dependencies
# Package managers
sudo pacman -S --noconfirm --quiet yay
sudo pacman -S --noconfirm --quiet python-pipx
# Video Restoration
#yay -S --noconfirm --quiet realesrgan-ncnn-vulkan
# Video Upscale
#yay -S --noconfirm --quiet srmd-ncnn-vulkan-bin
# Interpolation
yay -S --noconfirm --quiet rife-ncnn-vulkan-bin
# Audio separation
#pipx install openunmix
# Transcript
#pipx install whisperx
;;
("Everything you have!")
echo "OK. Beginning everything install:"
# install required binaries
install -d "${bin_dir}" && \
install -m 755 -p bin/* "${bin_dir}" && \
# install documentation files
install -d "${doc_dir}" && \
install -m 644 -p doc/* "${doc_dir}"
# install service menus
install -d "${servicemenu_dir}" && \
install -m 755 -p ServiceMenus/everything/*.desktop "${servicemenu_dir}" && \
# install extra dependencies
# Package managers
sudo pacman -S --noconfirm --quiet yay
sudo pacman -S --noconfirm --quiet python-pipx
## Video Restoration
#yay -S --noconfirm --quiet realesrgan-ncnn-vulkan
## Video Upscale
#yay -S --noconfirm --quiet srmd-ncnn-vulkan-bin
#yay -S --noconfirm --quiet realsr-ncnn-vulkan-python
## Interpolation
yay -S --noconfirm --quiet rife-ncnn-vulkan-bin
yay -S --noconfirm --quiet dain-ncnn-vulkan-bin
## Audio separation
#pipx install openunmix
## Transcript
#pipx install openai-whisper
#pipx install whisperx
;;
(*)
echo "Exiting install..."
exit 1;;
esac
# report installation result
if [ ${?} -eq 0 ]; then
echo "SUCCESS: kde-service-menu-revideo has been installed successfully."
else
echo "ERROR: kde-service-menu-revideo installation failed."
exit 1
fi