Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add root check #821

Closed
wants to merge 13 commits into from
21 changes: 20 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions core/tabs/applications-setup/Developer-tools/githubdesktop-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ installGithubDesktop() {
printf "%b\n" "${YELLOW}Installing Github Desktop...${RC}"
case "$PACKAGER" in
apt-get|nala)
curl -fsSL https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | "$ESCALATION_TOOL" tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main\n' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/shiftkey-packages.list > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
curl -fsSL https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | elevated_execution tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main\n' | elevated_execution tee /etc/apt/sources.list.d/shiftkey-packages.list > /dev/null
elevated_execution "$PACKAGER" update
elevated_execution "$PACKAGER" install -y github-desktop
;;
zypper)
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | "$ESCALATION_TOOL" tee /etc/zypp/repos.d/shiftkey-packages.repo > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install github-desktop
elevated_execution rpm --import https://rpm.packages.shiftkey.dev/gpg.key
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | elevated_execution tee /etc/zypp/repos.d/shiftkey-packages.repo > /dev/null
elevated_execution "$PACKAGER" refresh
elevated_execution "$PACKAGER" --non-interactive install github-desktop
;;
pacman)
"$AUR_HELPER" -S --needed --noconfirm github-desktop-bin
;;
dnf)
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/shiftkey-packages.repo > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
elevated_execution rpm --import https://rpm.packages.shiftkey.dev/gpg.key
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | elevated_execution tee /etc/yum.repos.d/shiftkey-packages.repo > /dev/null
elevated_execution "$PACKAGER" install -y github-desktop
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
Expand Down
4 changes: 2 additions & 2 deletions core/tabs/applications-setup/Developer-tools/meld-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ installMeld() {
printf "%b\n" "${YELLOW}Installing Meld...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm meld
elevated_execution "$PACKAGER" -S --needed --noconfirm meld
;;
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
elevated_execution "$PACKAGER" -y install meld
;;
*)
. ../setup-flatpak.sh
Expand Down
8 changes: 4 additions & 4 deletions core/tabs/applications-setup/Developer-tools/neovim-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ installNeovim() {
printf "%b\n" "${YELLOW}Installing Neovim...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck git
elevated_execution "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck git
;;
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y ripgrep fd-find python3-venv luarocks golang-go shellcheck git
elevated_execution "$PACKAGER" install -y ripgrep fd-find python3-venv luarocks golang-go shellcheck git
curl -sSLo /tmp/nvim.appimage https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x /tmp/nvim.appimage
"$ESCALATION_TOOL" mv /tmp/nvim.appimage /usr/local/bin/nvim
elevated_execution mv /tmp/nvim.appimage /usr/local/bin/nvim
;;
dnf|zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
elevated_execution "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
Expand Down
10 changes: 8 additions & 2 deletions core/tabs/applications-setup/Developer-tools/ngrok-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
installNgrok() {
if ! command_exists ngrok; then
printf "%b\n" "${YELLOW}Installing Ngrok...${RC}"
curl -sSLO https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz | "$ESCALATION_TOOL" tar -xz -C /usr/local/bin
curl -sSLO https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
if [ -f "ngrok-v3-stable-linux-amd64.tgz" ]; then
elevated_execution tar -xz -f ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin
else
printf "%b\n" "${RED}Error occurred when downloading.${RC}"
exit 1
fi
else
printf "%b\n" "${GREEN}Ngrok is already installed.${RC}"
fi
}

checkEnv
checkEscalationTool
installNgrok
installNgrok
22 changes: 11 additions & 11 deletions core/tabs/applications-setup/Developer-tools/sublime-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ installSublime() {
printf "%b\n" "${YELLOW}Installing Sublime...${RC}"
case "$PACKAGER" in
apt-get|nala)
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | "$ESCALATION_TOOL" apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/sublime-text.list
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | elevated_execution apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | elevated_execution tee /etc/apt/sources.list.d/sublime-text.list
elevated_execution "$PACKAGER" update
elevated_execution "$PACKAGER" install -y sublime-text
;;
zypper)
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
"$ESCALATION_TOOL" "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install sublime-text
elevated_execution rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
elevated_execution "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo
elevated_execution "$PACKAGER" refresh
elevated_execution "$PACKAGER" --non-interactive install sublime-text
;;
pacman)
"$AUR_HELPER" -S --needed --noconfirm sublime-text-4
;;
dnf)
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
elevated_execution rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
elevated_execution "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
elevated_execution "$PACKAGER" install -y sublime-text
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
Expand Down
22 changes: 11 additions & 11 deletions core/tabs/applications-setup/Developer-tools/vscode-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ installVsCode() {
case "$PACKAGER" in
apt-get|nala)
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
"$ESCALATION_TOOL" install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/vscode.list > /dev/null
elevated_execution install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | elevated_execution tee /etc/apt/sources.list.d/vscode.list > /dev/null
rm -f packages.microsoft.gpg
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y apt-transport-https code
elevated_execution "$PACKAGER" update
elevated_execution "$PACKAGER" install -y apt-transport-https code
;;
zypper)
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/zypp/repos.d/vscode.repo > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install code
elevated_execution rpm --import https://packages.microsoft.com/keys/microsoft.asc
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | elevated_execution tee /etc/zypp/repos.d/vscode.repo > /dev/null
elevated_execution "$PACKAGER" refresh
elevated_execution "$PACKAGER" --non-interactive install code
;;
pacman)
"$AUR_HELPER" -S --needed --noconfirm visual-studio-code-bin
;;
dnf)
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/vscode.repo > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" install -y code
elevated_execution rpm --import https://packages.microsoft.com/keys/microsoft.asc
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | elevated_execution tee /etc/yum.repos.d/vscode.repo > /dev/null
elevated_execution "$PACKAGER" install -y code
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
Expand Down
22 changes: 11 additions & 11 deletions core/tabs/applications-setup/Developer-tools/vscodium-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ installVsCodium() {
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
case "$PACKAGER" in
apt-get|nala)
curl -fsSL https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | "$ESCALATION_TOOL" dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/vscodium.list
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
curl -fsSL https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | elevated_execution dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | elevated_execution tee /etc/apt/sources.list.d/vscodium.list
elevated_execution "$PACKAGER" update
elevated_execution "$PACKAGER" install -y codium
;;
zypper)
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/zypp/repos.d/vscodium.repo
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install codium
elevated_execution rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | elevated_execution tee -a /etc/zypp/repos.d/vscodium.repo
elevated_execution "$PACKAGER" refresh
elevated_execution "$PACKAGER" --non-interactive install codium
;;
pacman)
"$AUR_HELPER" -S --noconfirm vscodium-bin
;;
dnf)
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
elevated_execution rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | elevated_execution tee -a /etc/yum.repos.d/vscodium.repo
elevated_execution "$PACKAGER" install -y codium
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
Expand Down
4 changes: 2 additions & 2 deletions core/tabs/applications-setup/alacritty-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ installAlacritty() {
printf "%b\n" "${YELLOW}Installing Alacritty...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
elevated_execution "$PACKAGER" -S --needed --noconfirm alacritty
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
elevated_execution "$PACKAGER" install -y alacritty
;;
esac
else
Expand Down
10 changes: 5 additions & 5 deletions core/tabs/applications-setup/android-debloat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ install_adb() {
printf "%b\n" "${YELLOW}Installing ADB...${RC}."
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y android-sdk-platform-tools
elevated_execution "$PACKAGER" install -y android-sdk-platform-tools
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm android-tools
elevated_execution "$PACKAGER" -S --noconfirm android-tools
;;
dnf|zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
elevated_execution "$PACKAGER" install -y android-tools
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
Expand All @@ -29,8 +29,8 @@ install_universal_android_debloater() {
if ! command_exists uad; then
printf "%b\n" "${YELLOW}Installing Universal Android Debloater...${RC}."
curl -sSLo "${HOME}/uad" "https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/releases/download/v1.1.0/uad-ng-linux"
"$ESCALATION_TOOL" chmod +x "${HOME}/uad"
"$ESCALATION_TOOL" mv "${HOME}/uad" /usr/local/bin/uad
elevated_execution chmod +x "${HOME}/uad"
elevated_execution mv "${HOME}/uad" /usr/local/bin/uad
else
printf "%b\n" "${GREEN}Universal Android Debloater is already installed. Run 'uad' command to execute.${RC}"
fi
Expand Down
Loading