mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 13:15:21 +00:00
fix all shellcheck warnings + formatting
This commit is contained in:
parent
5878f4dbf0
commit
d317d1e5cf
|
@ -6,15 +6,15 @@ installGithubDesktop() {
|
||||||
if ! command_exists github-desktop; then
|
if ! command_exists github-desktop; then
|
||||||
printf "%b\n" "${YELLOW}Installing Github Desktop...${RC}"
|
printf "%b\n" "${YELLOW}Installing Github Desktop...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
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
|
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
|
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" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
"$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
|
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" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install github-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install github-desktop
|
||||||
;;
|
;;
|
||||||
|
@ -23,7 +23,7 @@ installGithubDesktop() {
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
"$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
|
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
|
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -9,7 +9,7 @@ installMeld() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm meld
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm meld
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -24,4 +24,4 @@ installMeld() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installMeld
|
installMeld
|
||||||
|
|
|
@ -15,25 +15,25 @@ cloneNeovim() {
|
||||||
|
|
||||||
installNeovim() {
|
installNeovim() {
|
||||||
if ! command_exists neovim ripgrep git fzf; then
|
if ! command_exists neovim ripgrep git fzf; then
|
||||||
printf "%b\n" "${YELLOW}Installing Neovim...${RC}"
|
printf "%b\n" "${YELLOW}Installing Neovim...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck git
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck git
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ripgrep fd-find python3-venv luarocks golang-go shellcheck git
|
"$ESCALATION_TOOL" "$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
|
curl -sSLo /tmp/nvim.appimage https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
||||||
chmod u+x /tmp/nvim.appimage
|
chmod u+x /tmp/nvim.appimage
|
||||||
"$ESCALATION_TOOL" mv /tmp/nvim.appimage /usr/local/bin/nvim
|
"$ESCALATION_TOOL" mv /tmp/nvim.appimage /usr/local/bin/nvim
|
||||||
;;
|
;;
|
||||||
dnf|zypper)
|
dnf | zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
|
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,4 +13,4 @@ installNgrok() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installNgrok
|
installNgrok
|
||||||
|
|
|
@ -6,7 +6,7 @@ installSublime() {
|
||||||
if ! command_exists sublime; then
|
if ! command_exists sublime; then
|
||||||
printf "%b\n" "${YELLOW}Installing Sublime...${RC}"
|
printf "%b\n" "${YELLOW}Installing Sublime...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | "$ESCALATION_TOOL" apt-key add -
|
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
|
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" update
|
||||||
|
|
|
@ -6,17 +6,17 @@ installVsCode() {
|
||||||
if ! command_exists code; then
|
if ! command_exists code; then
|
||||||
printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
|
printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
|
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
|
"$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
|
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
|
||||||
rm -f packages.microsoft.gpg
|
rm -f packages.microsoft.gpg
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y apt-transport-https code
|
"$ESCALATION_TOOL" "$PACKAGER" install -y apt-transport-https code
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
"$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
|
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" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install code
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install code
|
||||||
;;
|
;;
|
||||||
|
@ -25,7 +25,7 @@ installVsCode() {
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
"$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
|
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
|
"$ESCALATION_TOOL" "$PACKAGER" install -y code
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -41,4 +41,4 @@ installVsCode() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installVsCode
|
installVsCode
|
||||||
|
|
|
@ -6,7 +6,7 @@ installVsCodium() {
|
||||||
if ! command_exists codium; then
|
if ! command_exists codium; then
|
||||||
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
|
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
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
|
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
|
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" update
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
installAlacritty() {
|
installAlacritty() {
|
||||||
if ! command_exists alacritty; then
|
if ! command_exists alacritty; then
|
||||||
printf "%b\n" "${YELLOW}Installing Alacritty...${RC}"
|
printf "%b\n" "${YELLOW}Installing Alacritty...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
||||||
|
|
|
@ -3,20 +3,20 @@
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
install_adb() {
|
install_adb() {
|
||||||
if ! command_exists adb ; then
|
if ! command_exists adb; then
|
||||||
printf "%b\n" "${YELLOW}Installing ADB...${RC}."
|
printf "%b\n" "${YELLOW}Installing ADB...${RC}."
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-sdk-platform-tools
|
"$ESCALATION_TOOL" "$PACKAGER" install -y android-sdk-platform-tools
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm android-tools
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm android-tools
|
||||||
;;
|
;;
|
||||||
dnf|zypper)
|
dnf | zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -34,9 +34,9 @@ install_universal_android_debloater() {
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Universal Android Debloater is already installed. Run 'uad' command to execute.${RC}"
|
printf "%b\n" "${GREEN}Universal Android Debloater is already installed. Run 'uad' command to execute.${RC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
install_adb
|
install_adb
|
||||||
install_universal_android_debloater
|
install_universal_android_debloater
|
||||||
|
|
|
@ -14,4 +14,4 @@ installBottles() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
installBottles
|
installBottles
|
||||||
|
|
|
@ -6,7 +6,7 @@ installBrave() {
|
||||||
if ! command_exists brave; then
|
if ! command_exists brave; then
|
||||||
printf "%b\n" "${YELLOW}Installing Brave...${RC}"
|
printf "%b\n" "${YELLOW}Installing Brave...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
||||||
"$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
|
"$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list
|
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list
|
||||||
|
@ -42,4 +42,4 @@ installBrave() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installBrave
|
installBrave
|
||||||
|
|
|
@ -3,21 +3,21 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installChromium() {
|
installChromium() {
|
||||||
if ! command_exists chromium; then
|
if ! command_exists chromium; then
|
||||||
printf "%b\n" "${YELLOW}Installing Chromium...${RC}"
|
printf "%b\n" "${YELLOW}Installing Chromium...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}"
|
printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installChromium
|
installChromium
|
||||||
|
|
|
@ -6,7 +6,7 @@ installFirefox() {
|
||||||
if ! command_exists firefox; then
|
if ! command_exists firefox; then
|
||||||
printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}"
|
printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr
|
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
|
|
|
@ -6,7 +6,7 @@ installChrome() {
|
||||||
if ! command_exists google-chrome; then
|
if ! command_exists google-chrome; then
|
||||||
printf "%b\n" "${YELLOW}Installing Google Chrome...${RC}"
|
printf "%b\n" "${YELLOW}Installing Google Chrome...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb
|
||||||
;;
|
;;
|
||||||
|
@ -36,4 +36,4 @@ installChrome() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installChrome
|
installChrome
|
||||||
|
|
|
@ -6,21 +6,21 @@ installLibreWolf() {
|
||||||
if ! command_exists librewolf; then
|
if ! command_exists librewolf; then
|
||||||
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
|
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates
|
"$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates
|
||||||
distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi`
|
distro=$(if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi)
|
||||||
curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg
|
curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg
|
||||||
echo "Types: deb
|
echo "Types: deb
|
||||||
URIs: https://deb.librewolf.net
|
URIs: https://deb.librewolf.net
|
||||||
Suites: $distro
|
Suites: $distro
|
||||||
Components: main
|
Components: main
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources > /dev/null
|
Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources >/dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y librewolf
|
"$ESCALATION_TOOL" "$PACKAGER" install -y librewolf
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo > /dev/null
|
curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo >/dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y librewolf
|
"$ESCALATION_TOOL" "$PACKAGER" install -y librewolf
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
|
@ -45,4 +45,4 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installLibreWolf
|
installLibreWolf
|
||||||
|
|
|
@ -20,4 +20,4 @@ installLynx() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installLynx
|
installLynx
|
||||||
|
|
|
@ -6,13 +6,13 @@ installThrorium() {
|
||||||
if ! command_exists thorium-browser; then
|
if ! command_exists thorium-browser; then
|
||||||
printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}"
|
printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list
|
"$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list
|
||||||
"$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list
|
"$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser
|
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser
|
||||||
;;
|
;;
|
||||||
zypper|dnf)
|
zypper | dnf)
|
||||||
url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm')
|
url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm')
|
||||||
echo "$url" && curl -L "$url" -o thorium-latest.rpm
|
echo "$url" && curl -L "$url" -o thorium-latest.rpm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm
|
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm
|
||||||
|
@ -32,4 +32,4 @@ installThrorium() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installThrorium
|
installThrorium
|
||||||
|
|
|
@ -6,7 +6,7 @@ installVivaldi() {
|
||||||
if ! command_exists vivaldi; then
|
if ! command_exists vivaldi; then
|
||||||
printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}"
|
printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
||||||
"$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg
|
"$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg
|
||||||
"$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list
|
"$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list
|
||||||
|
|
|
@ -7,10 +7,10 @@ installWaterfox() {
|
||||||
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
|
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
. ../setup-flatpak.sh
|
. ../setup-flatpak.sh
|
||||||
flatpak install -y flathub net.waterfox.waterfox
|
flatpak install -y flathub net.waterfox.waterfox
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -6,7 +6,7 @@ installDiscord() {
|
||||||
if ! command_exists discord; then
|
if ! command_exists discord; then
|
||||||
printf "%b\n" "${YELLOW}Installing Discord...${RC}"
|
printf "%b\n" "${YELLOW}Installing Discord...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -Lo discord.deb "https://discord.com/api/download?platform=linux&format=deb"
|
curl -Lo discord.deb "https://discord.com/api/download?platform=linux&format=deb"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y discord.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y discord.deb
|
||||||
;;
|
;;
|
||||||
|
@ -14,14 +14,14 @@ installDiscord() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install discord
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install discord
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm discord
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm discord
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
"$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y discord
|
"$ESCALATION_TOOL" "$PACKAGER" install -y discord
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -32,4 +32,4 @@ installDiscord() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installDiscord
|
installDiscord
|
||||||
|
|
|
@ -6,9 +6,9 @@ installJitsi() {
|
||||||
if ! command_exists jitsi-meet; then
|
if ! command_exists jitsi-meet; then
|
||||||
printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
|
printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl https://download.jitsi.org/jitsi-key.gpg.key | "$ESCALATION_TOOL" gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg
|
curl https://download.jitsi.org/jitsi-key.gpg.key | "$ESCALATION_TOOL" gpg --dearmor >/usr/share/keyrings/jitsi-keyring.gpg
|
||||||
printf "%b\n" 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null
|
printf "%b\n" 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/jitsi-stable.list >/dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install jitsi-meet
|
"$ESCALATION_TOOL" "$PACKAGER" -y install jitsi-meet
|
||||||
;;
|
;;
|
||||||
|
@ -34,4 +34,4 @@ installJitsi() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installJitsi
|
installJitsi
|
||||||
|
|
|
@ -6,9 +6,8 @@ installSignal() {
|
||||||
if ! command_exists org.signal.Signal && ! command_exists signal; then
|
if ! command_exists org.signal.Signal && ! command_exists signal; then
|
||||||
printf "%b\n" "${YELLOW}Installing Signal...${RC}"
|
printf "%b\n" "${YELLOW}Installing Signal...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -fsSL https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
|
curl -fsSL https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor | "$ESCALATION_TOOL" tee /usr/share/keyrings/signal-desktop-keyring.gpg >/dev/null
|
||||||
cat signal-desktop-keyring.gpg | "$ESCALATION_TOOL" tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
|
|
||||||
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/signal-xenial.list
|
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/signal-xenial.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install signal-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" -y install signal-desktop
|
||||||
|
@ -35,4 +34,4 @@ installSignal() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installSignal
|
installSignal
|
||||||
|
|
|
@ -9,7 +9,7 @@ installSlack() {
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm slack-desktop
|
"$AUR_HELPER" -S --needed --noconfirm slack-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
flatpak install -y flathub com.slack.Slack
|
flatpak install -y flathub com.slack.Slack
|
||||||
;;
|
;;
|
||||||
|
@ -22,4 +22,4 @@ installSlack() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installSlack
|
installSlack
|
||||||
|
|
|
@ -7,10 +7,10 @@ installTelegram() {
|
||||||
printf "%b\n" "${YELLOW}Installing Telegram...${RC}"
|
printf "%b\n" "${YELLOW}Installing Telegram...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -20,4 +20,4 @@ installTelegram() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installTelegram
|
installTelegram
|
||||||
|
|
|
@ -10,7 +10,7 @@ installThunderBird() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -20,4 +20,4 @@ installThunderBird() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installThunderBird
|
installThunderBird
|
||||||
|
|
|
@ -22,4 +22,4 @@ installZoom() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
installZoom
|
installZoom
|
||||||
|
|
|
@ -13,18 +13,30 @@ choose_installation() {
|
||||||
read -r CHOICE
|
read -r CHOICE
|
||||||
|
|
||||||
case "$CHOICE" in
|
case "$CHOICE" in
|
||||||
1) INSTALL_DOCKER=1; INSTALL_COMPOSE=0 ;;
|
1)
|
||||||
2) INSTALL_DOCKER=0; INSTALL_COMPOSE=1 ;;
|
INSTALL_DOCKER=1
|
||||||
3) INSTALL_DOCKER=1; INSTALL_COMPOSE=1 ;;
|
INSTALL_COMPOSE=0
|
||||||
*) printf "%b\n" "${RED}Invalid choice. Exiting.${RC}"; exit 1 ;;
|
;;
|
||||||
|
2)
|
||||||
|
INSTALL_DOCKER=0
|
||||||
|
INSTALL_COMPOSE=1
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
INSTALL_DOCKER=1
|
||||||
|
INSTALL_COMPOSE=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "%b\n" "${RED}Invalid choice. Exiting.${RC}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
install_docker() {
|
install_docker() {
|
||||||
printf "%b\n" "${YELLOW}Installing Docker...${RC}"
|
printf "%b\n" "${YELLOW}Installing Docker...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -fsSL https://get.docker.com | sh
|
curl -fsSL https://get.docker.com | sh
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
|
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
|
||||||
|
@ -52,7 +64,7 @@ install_docker() {
|
||||||
install_docker_compose() {
|
install_docker_compose() {
|
||||||
printf "%b\n" "${YELLOW}Installing Docker Compose...${RC}"
|
printf "%b\n" "${YELLOW}Installing Docker Compose...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
|
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
|
@ -74,7 +86,7 @@ install_docker_compose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_components() {
|
install_components() {
|
||||||
choose_installation
|
choose_installation
|
||||||
|
|
||||||
if [ "$INSTALL_DOCKER" -eq 1 ]; then
|
if [ "$INSTALL_DOCKER" -eq 1 ]; then
|
||||||
if ! command_exists docker; then
|
if ! command_exists docker; then
|
||||||
|
@ -95,4 +107,4 @@ install_components() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
install_components
|
install_components
|
||||||
|
|
|
@ -8,7 +8,7 @@ setupDWM() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y build-essential libx11-dev libxinerama-dev libxft-dev libimlib2-dev libx11-xcb-dev libfontconfig1 libx11-6 libxft2 libxinerama1 libxcb-res0-dev git unzip flameshot lxappearance feh mate-polkit
|
"$ESCALATION_TOOL" "$PACKAGER" install -y build-essential libx11-dev libxinerama-dev libxft-dev libimlib2-dev libx11-xcb-dev libfontconfig1 libx11-6 libxft2 libxinerama1 libxcb-res0-dev git unzip flameshot lxappearance feh mate-polkit
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
|
@ -25,7 +25,7 @@ setupDWM() {
|
||||||
makeDWM() {
|
makeDWM() {
|
||||||
cd "$HOME" && git clone https://github.com/ChrisTitusTech/dwm-titus.git # CD to Home directory to install dwm-titus
|
cd "$HOME" && git clone https://github.com/ChrisTitusTech/dwm-titus.git # CD to Home directory to install dwm-titus
|
||||||
# This path can be changed (e.g. to linux-toolbox directory)
|
# This path can be changed (e.g. to linux-toolbox directory)
|
||||||
cd dwm-titus/ # Hardcoded path, maybe not the best.
|
cd dwm-titus/ # Hardcoded path, maybe not the best.
|
||||||
"$ESCALATION_TOOL" make clean install # Run make clean install
|
"$ESCALATION_TOOL" make clean install # Run make clean install
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,10 @@ picom_animations() {
|
||||||
printf "%b\n" "${GREEN}Repository already exists, skipping clone${RC}"
|
printf "%b\n" "${GREEN}Repository already exists, skipping clone${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$HOME/.local/share/ftlabs-picom" || { printf "%b\n" "${RED}Failed to change directory to picom${RC}"; return 1; }
|
cd "$HOME/.local/share/ftlabs-picom" || {
|
||||||
|
printf "%b\n" "${RED}Failed to change directory to picom${RC}"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
if ! meson setup --buildtype=release build; then
|
if ! meson setup --buildtype=release build; then
|
||||||
|
@ -172,7 +175,7 @@ configure_backgrounds() {
|
||||||
# Rename the cloned directory to 'backgrounds'
|
# Rename the cloned directory to 'backgrounds'
|
||||||
mv "$PIC_DIR/nord-background" "$PIC_DIR/backgrounds"
|
mv "$PIC_DIR/nord-background" "$PIC_DIR/backgrounds"
|
||||||
# Print a success message indicating that the backgrounds have been downloaded
|
# Print a success message indicating that the backgrounds have been downloaded
|
||||||
printf "%b\n" "${GREEN}Downloaded desktop backgrounds to $BG_DIR${RC}"
|
printf "%b\n" "${GREEN}Downloaded desktop backgrounds to $BG_DIR${RC}"
|
||||||
else
|
else
|
||||||
# If the backgrounds directory already exists, print a message indicating that the download is being skipped
|
# If the backgrounds directory already exists, print a message indicating that the download is being skipped
|
||||||
printf "%b\n" "${GREEN}Path $BG_DIR exists for desktop backgrounds, skipping download of backgrounds${RC}"
|
printf "%b\n" "${GREEN}Path $BG_DIR exists for desktop backgrounds, skipping download of backgrounds${RC}"
|
||||||
|
@ -185,14 +188,14 @@ setupDisplayManager() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm xorg-xinit xorg-server
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm xorg-xinit xorg-server
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg xinit
|
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg xinit
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg
|
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -207,41 +210,44 @@ setupDisplayManager() {
|
||||||
done
|
done
|
||||||
printf "%b\n" "${GREEN}Current display manager: $currentdm${RC}"
|
printf "%b\n" "${GREEN}Current display manager: $currentdm${RC}"
|
||||||
if [ "$currentdm" = "none" ]; then
|
if [ "$currentdm" = "none" ]; then
|
||||||
printf "%b\n" "${YELLOW}--------------------------${RC}"
|
printf "%b\n" "${YELLOW}--------------------------${RC}"
|
||||||
printf "%b\n" "${YELLOW}Pick your Display Manager ${RC}"
|
printf "%b\n" "${YELLOW}Pick your Display Manager ${RC}"
|
||||||
printf "%b\n" "${YELLOW}1. SDDM ${RC}"
|
printf "%b\n" "${YELLOW}1. SDDM ${RC}"
|
||||||
printf "%b\n" "${YELLOW}2. LightDM ${RC}"
|
printf "%b\n" "${YELLOW}2. LightDM ${RC}"
|
||||||
printf "%b\n" "${YELLOW}3. GDM ${RC}"
|
printf "%b\n" "${YELLOW}3. GDM ${RC}"
|
||||||
printf "%b\n" "${YELLOW} ${RC}"
|
printf "%b\n" "${YELLOW} ${RC}"
|
||||||
printf "%b" "${YELLOW}Please select one: ${RC}"
|
printf "%b" "${YELLOW}Please select one: ${RC}"
|
||||||
read -r DM
|
read -r DM
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
printf "%b\n" "${GREEN}$DM installed successfully${RC}"
|
printf "%b\n" "${GREEN}$DM installed successfully${RC}"
|
||||||
systemctl enable "$DM"
|
systemctl enable "$DM"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_slstatus() {
|
install_slstatus() {
|
||||||
printf "Do you want to install slstatus? (y/N): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX
|
printf "Do you want to install slstatus? (y/N): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX
|
||||||
read -r response # -r flag to prevent backslashes from being interpreted
|
read -r response # -r flag to prevent backslashes from being interpreted
|
||||||
if [ "$response" = "y" ] || [ "$response" = "Y" ]; then
|
if [ "$response" = "y" ] || [ "$response" = "Y" ]; then
|
||||||
printf "%b\n" "${YELLOW}Installing slstatus${RC}"
|
printf "%b\n" "${YELLOW}Installing slstatus${RC}"
|
||||||
cd "$HOME/dwm-titus/slstatus" || { printf "%b\n" "${RED}Failed to change directory to slstatus${RC}"; return 1; }
|
cd "$HOME/dwm-titus/slstatus" || {
|
||||||
|
printf "%b\n" "${RED}Failed to change directory to slstatus${RC}"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
if "$ESCALATION_TOOL" make clean install; then
|
if "$ESCALATION_TOOL" make clean install; then
|
||||||
printf "%b\n" "${GREEN}slstatus installed successfully${RC}"
|
printf "%b\n" "${GREEN}slstatus installed successfully${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,7 +9,7 @@ installFastfetch() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
|
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
|
||||||
rm /tmp/fastfetch.deb
|
rm /tmp/fastfetch.deb
|
||||||
|
@ -35,4 +35,4 @@ setupFastfetchConfig() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installFastfetch
|
installFastfetch
|
||||||
setupFastfetchConfig
|
setupFastfetchConfig
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
themeinstall(){
|
themeinstall() {
|
||||||
mkdir -p "$HOME/.local/share"
|
mkdir -p "$HOME/.local/share"
|
||||||
cd "$HOME/.local/share"
|
cd "$HOME/.local/share"
|
||||||
if [ -d 'Top-5-Bootloader-Themes' ]; then
|
if [ -d 'Top-5-Bootloader-Themes' ]; then
|
||||||
|
|
|
@ -31,4 +31,4 @@ setupKittyConfig() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installKitty
|
installKitty
|
||||||
setupKittyConfig
|
setupKittyConfig
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
|
#shellcheck disable=SC1091
|
||||||
installLinutil() {
|
installLinutil() {
|
||||||
printf "%b\n" "${YELLOW}Installing Linutil...${RC}"
|
printf "%b\n" "${YELLOW}Installing Linutil...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
|
@ -30,7 +31,7 @@ installLinutil() {
|
||||||
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
|
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
|
||||||
read -r choice
|
read -r choice
|
||||||
case $choice in
|
case $choice in
|
||||||
y|Y)
|
y | Y)
|
||||||
if ! command_exists cargo; then
|
if ! command_exists cargo; then
|
||||||
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
|
@ -43,11 +44,11 @@ installLinutil() {
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
. $HOME/.cargo/env
|
. "$HOME/.cargo/env"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
. $HOME/.cargo/env
|
. "$HOME/.cargo/env"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -58,16 +59,17 @@ installLinutil() {
|
||||||
;;
|
;;
|
||||||
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
|
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
|
||||||
esac
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
installExtra() {
|
installExtra() {
|
||||||
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
|
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
|
||||||
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
|
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
|
||||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null
|
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' >/dev/null
|
||||||
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
|
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
|
||||||
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
|
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
|
||||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null
|
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop >/dev/null
|
||||||
printf "%b\n" "${GREEN}Done.${RC}"
|
printf "%b\n" "${GREEN}Done.${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
|
#shellcheck disable=SC1091
|
||||||
updateLinutil() {
|
updateLinutil() {
|
||||||
if [ ! -e "$HOME/.cargo/bin/linutil" ]; then
|
if [ ! -e "$HOME/.cargo/bin/linutil" ]; then
|
||||||
printf "%b\n" "${RED}This script only updates the binary installed through cargo.\nlinutil_tui is not installed.${RC}"
|
printf "%b\n" "${RED}This script only updates the binary installed through cargo.\nlinutil_tui is not installed.${RC}"
|
||||||
|
@ -10,19 +11,19 @@ updateLinutil() {
|
||||||
|
|
||||||
if ! command_exists cargo; then
|
if ! command_exists cargo; then
|
||||||
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
. $HOME/.cargo/env
|
. "$HOME/.cargo/env"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INSTALLED_VERSION=$(cargo install --list | grep "linutil_tui" | awk '{print $2}' | tr -d 'v:')
|
INSTALLED_VERSION=$(cargo install --list | grep "linutil_tui" | awk '{print $2}' | tr -d 'v:')
|
||||||
|
|
|
@ -2,30 +2,30 @@
|
||||||
|
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installFreeOffice() {
|
installFreeOffice() {
|
||||||
if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then
|
if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then
|
||||||
printf "%b\n" "${YELLOW}Installing Free Office...${RC}"
|
printf "%b\n" "${YELLOW}Installing Free Office...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -O https://www.softmaker.net/down/softmaker-freeoffice-2024_1218-01_amd64.deb
|
curl -O https://www.softmaker.net/down/softmaker-freeoffice-2024_1218-01_amd64.deb
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ./softmaker-freeoffice-2024_1218-01_amd64.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y ./softmaker-freeoffice-2024_1218-01_amd64.deb
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker
|
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys refresh
|
"$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm freeoffice
|
"$AUR_HELPER" -S --needed --noconfirm freeoffice
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" curl -O -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo
|
"$ESCALATION_TOOL" curl -O -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024
|
"$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Free Office is already installed.${RC}"
|
printf "%b\n" "${GREEN}Free Office is already installed.${RC}"
|
||||||
|
@ -35,4 +35,4 @@ installFreeOffice() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAurHelper
|
checkAurHelper
|
||||||
installFreeOffice
|
installFreeOffice
|
||||||
|
|
|
@ -6,10 +6,10 @@ installLibreOffice() {
|
||||||
if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then
|
if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then
|
||||||
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
|
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
|
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
|
||||||
;;
|
;;
|
||||||
zypper|dnf)
|
zypper | dnf)
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
flatpak install -y flathub org.libreoffice.LibreOffice
|
flatpak install -y flathub org.libreoffice.LibreOffice
|
||||||
;;
|
;;
|
||||||
|
@ -28,4 +28,4 @@ installLibreOffice() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installLibreOffice
|
installLibreOffice
|
||||||
|
|
|
@ -6,11 +6,11 @@ installOnlyOffice() {
|
||||||
if ! command_exists org.onlyoffice.desktopeditors && ! command_exists onlyoffice-desktopeditors; then
|
if ! command_exists org.onlyoffice.desktopeditors && ! command_exists onlyoffice-desktopeditors; then
|
||||||
printf "%b\n" "${YELLOW}Installing Only Office..${RC}."
|
printf "%b\n" "${YELLOW}Installing Only Office..${RC}."
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl -O https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb
|
curl -O https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb
|
||||||
;;
|
;;
|
||||||
zypper|dnf)
|
zypper | dnf)
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
flatpak install -y flathub org.onlyoffice.desktopeditors
|
flatpak install -y flathub org.onlyoffice.desktopeditors
|
||||||
;;
|
;;
|
||||||
|
@ -30,4 +30,4 @@ installOnlyOffice() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAurHelper
|
checkAurHelper
|
||||||
installOnlyOffice
|
installOnlyOffice
|
||||||
|
|
|
@ -22,4 +22,4 @@ installWpsOffice() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkAurHelper
|
checkAurHelper
|
||||||
installWpsOffice
|
installWpsOffice
|
||||||
|
|
|
@ -20,4 +20,4 @@ installEvince() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installEvince
|
installEvince
|
||||||
|
|
|
@ -20,4 +20,4 @@ installOkular() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installOkular
|
installOkular
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
installRofi() {
|
installRofi() {
|
||||||
if ! command_exists rofi; then
|
if ! command_exists rofi; then
|
||||||
printf "%b\n" "${YELLOW}Installing Rofi...${RC}"
|
printf "%b\n" "${YELLOW}Installing Rofi...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
|
||||||
|
|
|
@ -40,4 +40,4 @@ installExtra() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
installExtra
|
installExtra
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
checkGpu() {
|
checkGpu() {
|
||||||
if lspci | grep -i nvidia > /dev/null; then
|
if lspci | grep -i nvidia >/dev/null; then
|
||||||
printf "%b\n" "${RED}Waydroid is not compatible with NVIDIA GPUs.${RC}"
|
printf "%b\n" "${RED}Waydroid is not compatible with NVIDIA GPUs.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -11,7 +11,7 @@ checkGpu() {
|
||||||
|
|
||||||
installWaydroid() {
|
installWaydroid() {
|
||||||
if ! command_exists waydroid; then
|
if ! command_exists waydroid; then
|
||||||
printf "%b\n" "${YELLOW}Installing Waydroid...${RC}"
|
printf "%b\n" "${YELLOW}Installing Waydroid...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm waydroid
|
"$AUR_HELPER" -S --needed --noconfirm waydroid
|
||||||
|
@ -27,7 +27,7 @@ installWaydroid() {
|
||||||
"$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms
|
"$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms
|
||||||
"$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder
|
"$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
curl https://repo.waydro.id | "$ESCALATION_TOOL" sh
|
curl https://repo.waydro.id | "$ESCALATION_TOOL" sh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y waydroid
|
"$ESCALATION_TOOL" "$PACKAGER" install -y waydroid
|
||||||
if command_exists dkms; then
|
if command_exists dkms; then
|
||||||
|
|
|
@ -4,33 +4,33 @@
|
||||||
|
|
||||||
# Function to install zsh
|
# Function to install zsh
|
||||||
installZsh() {
|
installZsh() {
|
||||||
if ! command_exists zsh; then
|
if ! command_exists zsh; then
|
||||||
printf "%b\n" "${YELLOW}Installing Zsh...${RC}"
|
printf "%b\n" "${YELLOW}Installing Zsh...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}ZSH is already installed.${RC}"
|
printf "%b\n" "${GREEN}ZSH is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup zsh configuration
|
# Function to setup zsh configuration
|
||||||
setupZshConfig() {
|
setupZshConfig() {
|
||||||
printf "%b\n" "${YELLOW}Setting up Zsh configuration...${RC}"
|
printf "%b\n" "${YELLOW}Setting up Zsh configuration...${RC}"
|
||||||
CONFIG_DIR="$HOME/.config/zsh"
|
CONFIG_DIR="$HOME/.config/zsh"
|
||||||
ZSHRC_FILE="$CONFIG_DIR/.zshrc"
|
ZSHRC_FILE="$CONFIG_DIR/.zshrc"
|
||||||
|
|
||||||
if [ ! -d "$CONFIG_DIR" ]; then
|
if [ ! -d "$CONFIG_DIR" ]; then
|
||||||
mkdir -p "$CONFIG_DIR"
|
mkdir -p "$CONFIG_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Write the configuration to .zshrc
|
# Write the configuration to .zshrc
|
||||||
cat <<EOL >"$ZSHRC_FILE"
|
cat <<EOL >"$ZSHRC_FILE"
|
||||||
HISTFILE=~/.config/zsh/.histfile
|
HISTFILE=~/.config/zsh/.histfile
|
||||||
HISTSIZE=5000
|
HISTSIZE=5000
|
||||||
SAVEHIST=100000
|
SAVEHIST=100000
|
||||||
|
@ -43,9 +43,9 @@ PROMPT='%F{32}%n%f%F{166}@%f%F{64}%m:%F{166}%~%f%F{15}$%f '
|
||||||
RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
|
RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
# Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory
|
# Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory
|
||||||
[ ! -f /etc/zsh/zshenv ] && "$ESCALATION_TOOL" mkdir -p /etc/zsh && "$ESCALATION_TOOL" touch /etc/zsh/zshenv
|
[ ! -f /etc/zsh/zshenv ] && "$ESCALATION_TOOL" mkdir -p /etc/zsh && "$ESCALATION_TOOL" touch /etc/zsh/zshenv
|
||||||
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
|
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -9,11 +9,11 @@ CYAN='\033[36m'
|
||||||
GREEN='\033[32m'
|
GREEN='\033[32m'
|
||||||
|
|
||||||
command_exists() {
|
command_exists() {
|
||||||
for cmd in "$@"; do
|
for cmd in "$@"; do
|
||||||
export PATH=/home/jeeva/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH
|
export PATH="/home/jeeva/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH"
|
||||||
command -v "$cmd" >/dev/null 2>&1 || return 1
|
command -v "$cmd" >/dev/null 2>&1 || return 1
|
||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFlatpak() {
|
checkFlatpak() {
|
||||||
|
@ -157,9 +157,10 @@ checkCurrentDirectoryWritable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDistro() {
|
checkDistro() {
|
||||||
DTYPE="unknown" # Default to unknown
|
DTYPE="unknown" # Default to unknown
|
||||||
# Use /etc/os-release for modern distro identification
|
# Use /etc/os-release for modern distro identification
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
|
# shellcheck disable=SC1091
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
DTYPE=$ID
|
DTYPE=$ID
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -41,7 +41,7 @@ print_menu() {
|
||||||
if [ $start -lt 0 ]; then start=0; fi
|
if [ $start -lt 0 ]; then start=0; fi
|
||||||
if [ $((start + max_display)) -gt $total ]; then start=$((total - max_display)); fi
|
if [ $((start + max_display)) -gt $total ]; then start=$((total - max_display)); fi
|
||||||
if [ $start -lt 0 ]; then start=0; fi
|
if [ $start -lt 0 ]; then start=0; fi
|
||||||
|
|
||||||
printf "%b\n" "Please select the Diablo II: Resurrected installation path:"
|
printf "%b\n" "Please select the Diablo II: Resurrected installation path:"
|
||||||
i=0
|
i=0
|
||||||
echo "$paths_string" | tr '|' '\n' | while IFS= read -r path; do
|
echo "$paths_string" | tr '|' '\n' | while IFS= read -r path; do
|
||||||
|
@ -129,4 +129,4 @@ printf "%b\n" "3. Click the gear icon next to the 'Play' button"
|
||||||
printf "%b\n" "4. Select 'Game Settings'"
|
printf "%b\n" "4. Select 'Game Settings'"
|
||||||
printf "%b\n" "5. In the 'Additional command line arguments' field, enter: -mod lootfilter -txt"
|
printf "%b\n" "5. In the 'Additional command line arguments' field, enter: -mod lootfilter -txt"
|
||||||
printf "%b\n" "6. Click 'Done' to save the changes"
|
printf "%b\n" "6. Click 'Done' to save the changes"
|
||||||
printf "%b\n" "After completing these steps, launch Diablo II: Resurrected through Battle.net to use the loot filter."
|
printf "%b\n" "After completing these steps, launch Diablo II: Resurrected through Battle.net to use the loot filter."
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
installPkg() {
|
installPkg() {
|
||||||
if ! command_exists ufw; then
|
if ! command_exists ufw; then
|
||||||
printf "%b\n" "${YELLOW}Installing UFW...${RC}"
|
printf "%b\n" "${YELLOW}Installing UFW...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
|
||||||
|
|
|
@ -86,7 +86,7 @@ select_option() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
last_selected=$selected
|
last_selected="$selected"
|
||||||
|
|
||||||
# Read user input
|
# Read user input
|
||||||
read -rsn1 key
|
read -rsn1 key
|
||||||
|
@ -96,13 +96,13 @@ select_option() {
|
||||||
case $key in
|
case $key in
|
||||||
'[A') # Up arrow
|
'[A') # Up arrow
|
||||||
((selected--))
|
((selected--))
|
||||||
if [ $selected -lt 0 ]; then
|
if [ "$selected" -lt 0 ]; then
|
||||||
selected=$((num_options - 1))
|
selected=$((num_options - 1))
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
'[B') # Down arrow
|
'[B') # Down arrow
|
||||||
((selected++))
|
((selected++))
|
||||||
if [ $selected -ge $num_options ]; then
|
if [ "$selected" -ge "$num_options" ]; then
|
||||||
selected=0
|
selected=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -119,9 +119,9 @@ select_option() {
|
||||||
|
|
||||||
# @description Displays ArchTitus logo
|
# @description Displays ArchTitus logo
|
||||||
# @noargs
|
# @noargs
|
||||||
logo () {
|
logo() {
|
||||||
# This will be shown on every set as user is progressing
|
# This will be shown on every set as user is progressing
|
||||||
echo -ne "
|
echo -ne "
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
|
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
|
||||||
██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝
|
██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝
|
||||||
|
@ -136,7 +136,7 @@ echo -ne "
|
||||||
}
|
}
|
||||||
# @description This function will handle file systems. At this movement we are handling only
|
# @description This function will handle file systems. At this movement we are handling only
|
||||||
# btrfs and ext4. Others will be added in future.
|
# btrfs and ext4. Others will be added in future.
|
||||||
filesystem () {
|
filesystem() {
|
||||||
echo -ne "
|
echo -ne "
|
||||||
Please Select your file system for both boot and root
|
Please Select your file system for both boot and root
|
||||||
"
|
"
|
||||||
|
@ -144,19 +144,22 @@ filesystem () {
|
||||||
select_option "${options[@]}"
|
select_option "${options[@]}"
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
0) export FS=btrfs;;
|
0) export FS=btrfs ;;
|
||||||
1) export FS=ext4;;
|
1) export FS=ext4 ;;
|
||||||
2)
|
2)
|
||||||
set_password "LUKS_PASSWORD"
|
set_password "LUKS_PASSWORD"
|
||||||
export FS=luks
|
export FS=luks
|
||||||
;;
|
;;
|
||||||
3) exit ;;
|
3) exit ;;
|
||||||
*) echo "Wrong option please select again"; filesystem;;
|
*)
|
||||||
|
echo "Wrong option please select again"
|
||||||
|
filesystem
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Detects and sets timezone.
|
# @description Detects and sets timezone.
|
||||||
timezone () {
|
timezone() {
|
||||||
# Added this from arch wiki https://wiki.archlinux.org/title/System_time
|
# Added this from arch wiki https://wiki.archlinux.org/title/System_time
|
||||||
time_zone="$(curl --fail https://ipapi.co/timezone)"
|
time_zone="$(curl --fail https://ipapi.co/timezone)"
|
||||||
echo -ne "
|
echo -ne "
|
||||||
|
@ -167,23 +170,28 @@ timezone () {
|
||||||
select_option "${options[@]}"
|
select_option "${options[@]}"
|
||||||
|
|
||||||
case ${options[$?]} in
|
case ${options[$?]} in
|
||||||
y|Y|yes|Yes|YES)
|
y | Y | yes | Yes | YES)
|
||||||
echo "${time_zone} set as timezone"
|
echo "${time_zone} set as timezone"
|
||||||
export TIMEZONE=$time_zone;;
|
export TIMEZONE=$time_zone
|
||||||
n|N|no|NO|No)
|
;;
|
||||||
echo "Please enter your desired timezone e.g. Europe/London :"
|
n | N | no | NO | No)
|
||||||
read -r new_timezone
|
echo "Please enter your desired timezone e.g. Europe/London :"
|
||||||
echo "${new_timezone} set as timezone"
|
read -r new_timezone
|
||||||
export TIMEZONE=$new_timezone;;
|
echo "${new_timezone} set as timezone"
|
||||||
*) echo "Wrong option. Try again";timezone;;
|
export TIMEZONE=$new_timezone
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Wrong option. Try again"
|
||||||
|
timezone
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
# @description Set user's keyboard mapping.
|
# @description Set user's keyboard mapping.
|
||||||
keymap () {
|
keymap() {
|
||||||
echo -ne "
|
echo -ne "
|
||||||
Please select key board layout from this list"
|
Please select key board layout from this list"
|
||||||
# These are default key maps as presented in official arch repo archinstall
|
# These are default key maps as presented in official arch repo archinstall
|
||||||
options=(us by ca cf cz de dk es et fa fi fr gr hu il it lt lv mk nl no pl ro ru se sg ua uk)
|
options=('us' 'by' 'ca' 'cf' 'cz' 'de' 'dk' 'es' 'et' 'fa' 'fi' 'fr' 'gr' 'hu' 'il' 'it' 'lt' 'lv' 'mk' 'nl' 'no' 'pl' 'ro' 'ru' 'se' 'sg' 'ua' 'uk')
|
||||||
|
|
||||||
select_option "${options[@]}"
|
select_option "${options[@]}"
|
||||||
keymap=${options[$?]}
|
keymap=${options[$?]}
|
||||||
|
@ -193,7 +201,7 @@ keymap () {
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Choose whether drive is SSD or not.
|
# @description Choose whether drive is SSD or not.
|
||||||
drivessd () {
|
drivessd() {
|
||||||
echo -ne "
|
echo -ne "
|
||||||
Is this an ssd? yes/no:
|
Is this an ssd? yes/no:
|
||||||
"
|
"
|
||||||
|
@ -202,17 +210,22 @@ drivessd () {
|
||||||
select_option "${options[@]}"
|
select_option "${options[@]}"
|
||||||
|
|
||||||
case ${options[$?]} in
|
case ${options[$?]} in
|
||||||
y|Y|yes|Yes|YES)
|
y | Y | yes | Yes | YES)
|
||||||
export MOUNT_OPTIONS="noatime,compress=zstd,ssd,commit=120";;
|
export MOUNT_OPTIONS="noatime,compress=zstd,ssd,commit=120"
|
||||||
n|N|no|NO|No)
|
;;
|
||||||
export MOUNT_OPTIONS="noatime,compress=zstd,commit=120";;
|
n | N | no | NO | No)
|
||||||
*) echo "Wrong option. Try again";drivessd;;
|
export MOUNT_OPTIONS="noatime,compress=zstd,commit=120"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Wrong option. Try again"
|
||||||
|
drivessd
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Disk selection for drive to be used with installation.
|
# @description Disk selection for drive to be used with installation.
|
||||||
diskpart () {
|
diskpart() {
|
||||||
echo -ne "
|
echo -ne "
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK
|
THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK
|
||||||
Please make sure you know what you are doing because
|
Please make sure you know what you are doing because
|
||||||
|
@ -225,33 +238,31 @@ echo -ne "
|
||||||
|
|
||||||
PS3='
|
PS3='
|
||||||
Select the disk to install on: '
|
Select the disk to install on: '
|
||||||
|
# shellcheck disable=SC2207
|
||||||
options=($(lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print "/dev/"$2"|"$3}'))
|
options=($(lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print "/dev/"$2"|"$3}'))
|
||||||
|
|
||||||
select_option "${options[@]}"
|
select_option "${options[@]}"
|
||||||
disk=${options[$?]%|*}
|
disk=${options[$?]%|*}
|
||||||
|
|
||||||
echo -e "\n${disk%|*} selected \n"
|
echo -e "\n${disk%|*} selected \n"
|
||||||
export DISK=${disk%|*}
|
export DISK=${disk%|*}
|
||||||
|
|
||||||
drivessd
|
drivessd
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Gather username and password to be used for installation.
|
# @description Gather username and password to be used for installation.
|
||||||
userinfo () {
|
userinfo() {
|
||||||
# Loop through user input until the user gives a valid username
|
# Loop through user input until the user gives a valid username
|
||||||
while true
|
while true; do
|
||||||
do
|
read -r -p "Please enter username: " username
|
||||||
read -r -p "Please enter username: " username
|
if [[ "${username,,}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]]; then
|
||||||
if [[ "${username,,}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]]
|
break
|
||||||
then
|
fi
|
||||||
break
|
echo "Incorrect username."
|
||||||
fi
|
|
||||||
echo "Incorrect username."
|
|
||||||
done
|
done
|
||||||
export USERNAME=$username
|
export USERNAME=$username
|
||||||
|
|
||||||
while true
|
while true; do
|
||||||
do
|
|
||||||
read -rs -p "Please enter password: " PASSWORD1
|
read -rs -p "Please enter password: " PASSWORD1
|
||||||
echo -ne "\n"
|
echo -ne "\n"
|
||||||
read -rs -p "Please re-enter password: " PASSWORD2
|
read -rs -p "Please re-enter password: " PASSWORD2
|
||||||
|
@ -264,21 +275,18 @@ userinfo () {
|
||||||
done
|
done
|
||||||
export PASSWORD=$PASSWORD1
|
export PASSWORD=$PASSWORD1
|
||||||
|
|
||||||
# Loop through user input until the user gives a valid hostname, but allow the user to force save
|
# Loop through user input until the user gives a valid hostname, but allow the user to force save
|
||||||
while true
|
while true; do
|
||||||
do
|
read -r -p "Please name your machine: " name_of_machine
|
||||||
read -r -p "Please name your machine: " name_of_machine
|
# hostname regex (!!couldn't find spec for computer name!!)
|
||||||
# hostname regex (!!couldn't find spec for computer name!!)
|
if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]]; then
|
||||||
if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]]
|
break
|
||||||
then
|
fi
|
||||||
break
|
# if validation fails allow the user to force saving of the hostname
|
||||||
fi
|
read -r -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force
|
||||||
# if validation fails allow the user to force saving of the hostname
|
if [[ "${force,,}" = "y" ]]; then
|
||||||
read -r -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force
|
break
|
||||||
if [[ "${force,,}" = "y" ]]
|
fi
|
||||||
then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
export NAME_OF_MACHINE=$name_of_machine
|
export NAME_OF_MACHINE=$name_of_machine
|
||||||
}
|
}
|
||||||
|
@ -333,14 +341,14 @@ echo -ne "
|
||||||
"
|
"
|
||||||
umount -A --recursive /mnt # make sure everything is unmounted before we start
|
umount -A --recursive /mnt # make sure everything is unmounted before we start
|
||||||
# disk prep
|
# disk prep
|
||||||
sgdisk -Z "${DISK}" # zap all on disk
|
sgdisk -Z "${DISK}" # zap all on disk
|
||||||
sgdisk -a 2048 -o "${DISK}" # new gpt disk 2048 alignment
|
sgdisk -a 2048 -o "${DISK}" # new gpt disk 2048 alignment
|
||||||
|
|
||||||
# create partitions
|
# create partitions
|
||||||
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:'BIOSBOOT' "${DISK}" # partition 1 (BIOS Boot Partition)
|
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:'BIOSBOOT' "${DISK}" # partition 1 (BIOS Boot Partition)
|
||||||
sgdisk -n 2::+1GiB --typecode=2:ef00 --change-name=2:'EFIBOOT' "${DISK}" # partition 2 (UEFI Boot Partition)
|
sgdisk -n 2::+1GiB --typecode=2:ef00 --change-name=2:'EFIBOOT' "${DISK}" # partition 2 (UEFI Boot Partition)
|
||||||
sgdisk -n 3::-0 --typecode=3:8300 --change-name=3:'ROOT' "${DISK}" # partition 3 (Root), default start, remaining
|
sgdisk -n 3::-0 --typecode=3:8300 --change-name=3:'ROOT' "${DISK}" # partition 3 (Root), default start, remaining
|
||||||
if [[ ! -d "/sys/firmware/efi" ]]; then # Checking for bios system
|
if [[ ! -d "/sys/firmware/efi" ]]; then # Checking for bios system
|
||||||
sgdisk -A 1:set:2 "${DISK}"
|
sgdisk -A 1:set:2 "${DISK}"
|
||||||
fi
|
fi
|
||||||
partprobe "${DISK}" # reread partition table to ensure it is correct
|
partprobe "${DISK}" # reread partition table to ensure it is correct
|
||||||
|
@ -352,27 +360,27 @@ echo -ne "
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
# @description Creates the btrfs subvolumes.
|
# @description Creates the btrfs subvolumes.
|
||||||
createsubvolumes () {
|
createsubvolumes() {
|
||||||
btrfs subvolume create /mnt/@
|
btrfs subvolume create /mnt/@
|
||||||
btrfs subvolume create /mnt/@home
|
btrfs subvolume create /mnt/@home
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Mount all btrfs subvolumes after root has been mounted.
|
# @description Mount all btrfs subvolumes after root has been mounted.
|
||||||
mountallsubvol () {
|
mountallsubvol() {
|
||||||
mount -o "${MOUNT_OPTIONS}",subvol=@home "${partition3}" /mnt/home
|
mount -o "${MOUNT_OPTIONS}",subvol=@home "${partition3}" /mnt/home
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description BTRFS subvolulme creation and mounting.
|
# @description BTRFS subvolulme creation and mounting.
|
||||||
subvolumesetup () {
|
subvolumesetup() {
|
||||||
# create nonroot subvolumes
|
# create nonroot subvolumes
|
||||||
createsubvolumes
|
createsubvolumes
|
||||||
# unmount root to remount with subvolume
|
# unmount root to remount with subvolume
|
||||||
umount /mnt
|
umount /mnt
|
||||||
# mount @ subvolume
|
# mount @ subvolume
|
||||||
mount -o "${MOUNT_OPTIONS}",subvol=@ "${partition3}" /mnt
|
mount -o "${MOUNT_OPTIONS}",subvol=@ "${partition3}" /mnt
|
||||||
# make directories home, .snapshots, var, tmp
|
# make directories home, .snapshots, var, tmp
|
||||||
mkdir -p /mnt/home
|
mkdir -p /mnt/home
|
||||||
# mount subvolumes
|
# mount subvolumes
|
||||||
mountallsubvol
|
mountallsubvol
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,13 +403,13 @@ elif [[ "${FS}" == "ext4" ]]; then
|
||||||
mount -t ext4 "${partition3}" /mnt
|
mount -t ext4 "${partition3}" /mnt
|
||||||
elif [[ "${FS}" == "luks" ]]; then
|
elif [[ "${FS}" == "luks" ]]; then
|
||||||
mkfs.vfat -F32 "${partition2}"
|
mkfs.vfat -F32 "${partition2}"
|
||||||
# enter luks password to cryptsetup and format root partition
|
# enter luks password to cryptsetup and format root partition
|
||||||
echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" -
|
echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" -
|
||||||
# open luks container and ROOT will be place holder
|
# open luks container and ROOT will be place holder
|
||||||
echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT -
|
echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT -
|
||||||
# now format that container
|
# now format that container
|
||||||
mkfs.btrfs "${partition3}"
|
mkfs.btrfs "${partition3}"
|
||||||
# create subvolumes for btrfs
|
# create subvolumes for btrfs
|
||||||
mount -t btrfs "${partition3}" /mnt
|
mount -t btrfs "${partition3}" /mnt
|
||||||
subvolumesetup
|
subvolumesetup
|
||||||
ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}")
|
ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}")
|
||||||
|
@ -435,10 +443,10 @@ if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
else
|
else
|
||||||
pacstrap /mnt base base-devel linux-lts linux-firmware efibootmgr --noconfirm --needed
|
pacstrap /mnt base base-devel linux-lts linux-firmware efibootmgr --noconfirm --needed
|
||||||
fi
|
fi
|
||||||
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
|
echo "keyserver hkp://keyserver.ubuntu.com" >>/mnt/etc/pacman.d/gnupg/gpg.conf
|
||||||
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
|
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
genfstab -U /mnt >> /mnt/etc/fstab
|
genfstab -U /mnt >>/mnt/etc/fstab
|
||||||
echo "
|
echo "
|
||||||
Generated /etc/fstab:
|
Generated /etc/fstab:
|
||||||
"
|
"
|
||||||
|
@ -456,8 +464,8 @@ echo -ne "
|
||||||
Checking for low memory systems <8G
|
Checking for low memory systems <8G
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
TOTAL_MEM=$(grep -i 'memtotal' /proc/meminfo | grep -o '[[:digit:]]*')
|
||||||
if [[ $TOTAL_MEM -lt 8000000 ]]; then
|
if [[ $TOTAL_MEM -lt 8000000 ]]; then
|
||||||
# Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything.
|
# Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything.
|
||||||
mkdir -p /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly.
|
mkdir -p /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly.
|
||||||
if findmnt -n -o FSTYPE /mnt | grep -q btrfs; then
|
if findmnt -n -o FSTYPE /mnt | grep -q btrfs; then
|
||||||
|
@ -469,11 +477,12 @@ if [[ $TOTAL_MEM -lt 8000000 ]]; then
|
||||||
mkswap /mnt/opt/swap/swapfile
|
mkswap /mnt/opt/swap/swapfile
|
||||||
swapon /mnt/opt/swap/swapfile
|
swapon /mnt/opt/swap/swapfile
|
||||||
# The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself.
|
# The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself.
|
||||||
echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
|
echo "/opt/swap/swapfile none swap sw 0 0" >>/mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gpu_type=$(lspci | grep -E "VGA|3D|Display")
|
gpu_type=$(lspci | grep -E "VGA|3D|Display")
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
arch-chroot /mnt /bin/bash -c "KEYMAP='${KEYMAP}' /bin/bash" <<EOF
|
arch-chroot /mnt /bin/bash -c "KEYMAP='${KEYMAP}' /bin/bash" <<EOF
|
||||||
|
|
||||||
echo -ne "
|
echo -ne "
|
||||||
|
@ -500,7 +509,7 @@ echo -ne "
|
||||||
changing the compression settings.
|
changing the compression settings.
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
TOTAL_MEM=$(grep -i 'memtotal' /proc/meminfo | grep -o '[[:digit:]]*')
|
||||||
if [[ $TOTAL_MEM -gt 8000000 ]]; then
|
if [[ $TOTAL_MEM -gt 8000000 ]]; then
|
||||||
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf
|
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf
|
||||||
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf
|
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
installDepend() {
|
installDepend() {
|
||||||
## Check for dependencies.
|
|
||||||
DEPENDENCIES='tar tree multitail tldr trash-cli unzip cmake make jq'
|
DEPENDENCIES='tar tree multitail tldr trash-cli unzip cmake make jq'
|
||||||
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
|
@ -17,7 +17,7 @@ installDepend() {
|
||||||
fi
|
fi
|
||||||
"$AUR_HELPER" -S --needed --noconfirm $DEPENDENCIES
|
"$AUR_HELPER" -S --needed --noconfirm $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
COMPILEDEPS='build-essential'
|
COMPILEDEPS='build-essential'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" dpkg --add-architecture i386
|
"$ESCALATION_TOOL" dpkg --add-architecture i386
|
||||||
|
@ -33,7 +33,7 @@ installDepend() {
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
COMPILEDEPS='patterns-devel-base-devel_basis'
|
COMPILEDEPS='patterns-devel-base-devel_basis'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
||||||
;;
|
;;
|
||||||
|
@ -46,4 +46,4 @@ installDepend() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkAURHelper
|
checkAURHelper
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installDepend
|
installDepend
|
||||||
|
|
|
@ -6,9 +6,9 @@ configureDNF() {
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
dnf)
|
dnf)
|
||||||
printf "%b\n" "${YELLOW}Configuring DNF...${RC}"
|
printf "%b\n" "${YELLOW}Configuring DNF...${RC}"
|
||||||
"$ESCALATION_TOOL" sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf
|
"$ESCALATION_TOOL" sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >>/etc/dnf/dnf.conf
|
||||||
echo "fastestmirror=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
|
echo "fastestmirror=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf >/dev/null
|
||||||
echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
|
echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf >/dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
|
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
|
||||||
printf "%b\n" "${GREEN}DNF Configured Successfully.${RC}"
|
printf "%b\n" "${GREEN}DNF Configured Successfully.${RC}"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -9,20 +9,20 @@ update() {
|
||||||
printf "%b\n" "${YELLOW}Make sure your system is fully updated; if not, update it first and reboot once.${RC}"
|
printf "%b\n" "${YELLOW}Make sure your system is fully updated; if not, update it first and reboot once.${RC}"
|
||||||
printf "%b\n" "${CYAN}Your current Fedora version is $current_version.${RC}"
|
printf "%b\n" "${CYAN}Your current Fedora version is $current_version.${RC}"
|
||||||
printf "%b\n" "${CYAN}The next available version is $next_version.${RC}"
|
printf "%b\n" "${CYAN}The next available version is $next_version.${RC}"
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Do you want to update to $next_version? (y/n): ${RC}"
|
printf "%b\n" "${YELLOW}Do you want to update to $next_version? (y/n): ${RC}"
|
||||||
read -r response
|
read -r response
|
||||||
|
|
||||||
case "$response" in
|
case "$response" in
|
||||||
y|Y)
|
y | Y)
|
||||||
printf "%b\n" "${CYAN}Preparing to update to $next_version...${RC}"
|
printf "%b\n" "${CYAN}Preparing to update to $next_version...${RC}"
|
||||||
|
|
||||||
if ! "$ESCALATION_TOOL" "$PACKAGER" install dnf-plugin-system-upgrade -y; then
|
if ! "$ESCALATION_TOOL" "$PACKAGER" install dnf-plugin-system-upgrade -y; then
|
||||||
printf "%b\n" "${RED}Failed to install dnf-plugin-system-upgrade.${RC}"
|
printf "%b\n" "${RED}Failed to install dnf-plugin-system-upgrade.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! "$ESCALATION_TOOL" "$PACKAGER" system-upgrade download --releasever="$next_version" -y ; then
|
if ! "$ESCALATION_TOOL" "$PACKAGER" system-upgrade download --releasever="$next_version" -y; then
|
||||||
printf "%b\n" "${RED}Failed to download the upgrade packages.${RC}"
|
printf "%b\n" "${RED}Failed to download the upgrade packages.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -31,7 +31,7 @@ update() {
|
||||||
read -r reboot_response
|
read -r reboot_response
|
||||||
|
|
||||||
case "$reboot_response" in
|
case "$reboot_response" in
|
||||||
y|Y)
|
y | Y)
|
||||||
printf "%b\n" "${YELLOW}Rebooting to apply the upgrade...${RC}"
|
printf "%b\n" "${YELLOW}Rebooting to apply the upgrade...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" system-upgrade reboot
|
"$ESCALATION_TOOL" "$PACKAGER" system-upgrade reboot
|
||||||
;;
|
;;
|
||||||
|
@ -48,10 +48,10 @@ update() {
|
||||||
|
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
printf "%b\n" "${YELLOW}Running post-upgrade tasks...${RC}"
|
printf "%b\n" "${YELLOW}Running post-upgrade tasks...${RC}"
|
||||||
|
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove
|
"$ESCALATION_TOOL" "$PACKAGER" autoremove
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" distro-sync -y
|
"$ESCALATION_TOOL" "$PACKAGER" distro-sync -y
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -23,4 +23,4 @@ multimedia() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
multimedia
|
multimedia
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
# This script allows user to download proprietary drivers for nvidia in fedora
|
# This script allows user to download proprietary drivers for nvidia in fedora
|
||||||
|
|
||||||
# It also disables nouveau nvidia drivers
|
# It also disables nouveau nvidia drivers
|
||||||
|
@ -10,84 +11,78 @@
|
||||||
# NOTE: Currently script only provides drivers for gpu 2014 and above (510+ and above)
|
# NOTE: Currently script only provides drivers for gpu 2014 and above (510+ and above)
|
||||||
|
|
||||||
checkRepo() {
|
checkRepo() {
|
||||||
REPO_ID="rpmfusion-nonfree-nvidia-driver"
|
REPO_ID="rpmfusion-nonfree-nvidia-driver"
|
||||||
|
|
||||||
if [ "$(dnf repolist enabled 2>/dev/null | grep -c "$REPO_ID")" -gt 0 ]; then
|
|
||||||
printf "%b\n" "${GREEN}Nvidia non-free repository is already enabled.${RC}"
|
|
||||||
else
|
|
||||||
printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}"
|
|
||||||
|
|
||||||
# Enable the repository
|
|
||||||
"$ESCALATION_TOOL" dnf config-manager --set-enabled "$REPO_ID"
|
|
||||||
|
|
||||||
# Refreshing repository list
|
|
||||||
"$ESCALATION_TOOL" dnf makecache
|
|
||||||
|
|
||||||
# Verify if the repository is enabled
|
|
||||||
if [ "$(dnf repolist enabled 2>/dev/null | grep -c "$REPO_ID")" -gt 0 ]; then
|
if [ "$(dnf repolist enabled 2>/dev/null | grep -c "$REPO_ID")" -gt 0 ]; then
|
||||||
printf "%b\n" "${GREEN}Nvidia non-free repository is now enabled...${RC}"
|
printf "%b\n" "${GREEN}Nvidia non-free repository is already enabled.${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Failed to enable nvidia non-free repository...${RC}"
|
printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}"
|
||||||
exit 1
|
|
||||||
|
"$ESCALATION_TOOL" dnf config-manager --set-enabled "$REPO_ID"
|
||||||
|
"$ESCALATION_TOOL" dnf makecache
|
||||||
|
|
||||||
|
if [ "$(dnf repolist enabled 2>/dev/null | grep -c "$REPO_ID")" -gt 0 ]; then
|
||||||
|
printf "%b\n" "${GREEN}Nvidia non-free repository is now enabled...${RC}"
|
||||||
|
else
|
||||||
|
printf "%b\n" "${RED}Failed to enable nvidia non-free repository...${RC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDriverInstallation() {
|
checkDriverInstallation() {
|
||||||
if modinfo -F version nvidia >/dev/null 2>&1; then
|
if modinfo -F version nvidia >/dev/null 2>&1; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
installDriver() {
|
installDriver() {
|
||||||
|
|
||||||
if checkDriverInstallation; then
|
|
||||||
printf "%b\n" "${GREEN}NVIDIA driver is already installed.${RC}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# NOTE:: Installing graphics driver.
|
|
||||||
"$ESCALATION_TOOL" dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
|
|
||||||
printf "%b\n" "${YELLOW}Building the drivers may take upto 5 minutes. Please don't kill the script!\n If the build failed try running the script again, select \"Remove Nvidia Drivers\" and reboot the system, then try installing drivers again.${RC}"
|
|
||||||
|
|
||||||
for i in $(seq 1 5); do
|
|
||||||
if checkDriverInstallation; then
|
if checkDriverInstallation; then
|
||||||
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
|
printf "%b\n" "${GREEN}NVIDIA driver is already installed.${RC}"
|
||||||
printf "%b\n" "${GREEN}Installed driver version $(modinfo -F version nvidia)${RC}"
|
exit 0
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "${YELLOW}Waiting for driver to be built..."
|
|
||||||
sleep 1m
|
|
||||||
done
|
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}Now you can reboot the system.${RC}"
|
"$ESCALATION_TOOL" dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
|
||||||
|
printf "%b\n" "${YELLOW}Building the drivers may take upto 5 minutes. Please don't kill the script!\n If the build failed try running the script again, select \"Remove Nvidia Drivers\" and reboot the system, then try installing drivers again.${RC}"
|
||||||
|
|
||||||
|
for _ in $(seq 1 5); do
|
||||||
|
if checkDriverInstallation; then
|
||||||
|
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
|
||||||
|
printf "%b\n" "${GREEN}Installed driver version $(modinfo -F version nvidia)${RC}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
printf "%b\n" "${YELLOW}Waiting for driver to be built..."
|
||||||
|
sleep 1m
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "%b\n" "${GREEN}Now you can reboot the system.${RC}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# NOTE: A confirmation option to proceed or not
|
|
||||||
userConfirmation() {
|
userConfirmation() {
|
||||||
printf "%b" "${YELLOW}Do you want to continue? (y/N): ${RC}"
|
printf "%b" "${YELLOW}Do you want to continue? (y/N): ${RC}"
|
||||||
read -r choice
|
read -r choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
y | Y)
|
y | Y)
|
||||||
checkRepo
|
checkRepo
|
||||||
installDriver
|
installDriver
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
n | N)
|
n | N)
|
||||||
printf "%b\n" "${RED} Exiting the Script ${RC}"
|
printf "%b\n" "${RED}Exiting the script.${RC}"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED} Invalid Option! ${RC}"
|
printf "%b\n" "${RED}Invalid Option!${RC}"
|
||||||
userConfirmation
|
userConfirmation
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Warning! This script will enable Nvidia non-free repository and only install drivers for GPUs from 2014 or later. It works on fedora 34 and above.\n It is recommended remove this driver while updating your kernel packages to newer version.${RC}"
|
printf "%b\n" "${YELLOW}Warning! This script will enable nvidia non-free repository and only install drivers for GPUs from 2014 or later. It works on fedora 34 and above.\n It is recommended remove this driver while updating your kernel packages to newer version.${RC}"
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
|
|
|
@ -26,4 +26,4 @@ installRPMFusion() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installRPMFusion
|
installRPMFusion
|
||||||
|
|
|
@ -7,7 +7,7 @@ configureVirtualization() {
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
dnf)
|
dnf)
|
||||||
printf "%b\n" "${YELLOW}Installing virtualization tools...${RC}"
|
printf "%b\n" "${YELLOW}Installing virtualization tools...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y @virtualization
|
"$ESCALATION_TOOL" "$PACKAGER" install -y @virtualization
|
||||||
printf "%b\n" "${GREEN}Installed virtualization tools...${RC}"
|
printf "%b\n" "${GREEN}Installed virtualization tools...${RC}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
installDepend() {
|
installDepend() {
|
||||||
# Check for dependencies
|
|
||||||
DEPENDENCIES='wine dbus'
|
DEPENDENCIES='wine dbus'
|
||||||
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
#Check for multilib
|
|
||||||
if ! grep -q "^\s*\[multilib\]" /etc/pacman.conf; then
|
if ! grep -q "^\s*\[multilib\]" /etc/pacman.conf; then
|
||||||
echo "[multilib]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
echo "[multilib]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
||||||
echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
||||||
|
@ -25,7 +25,7 @@ installDepend() {
|
||||||
|
|
||||||
$AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS
|
$AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"
|
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"
|
||||||
|
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
|
@ -36,7 +36,7 @@ installDepend() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $DISTRO_DEPS
|
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
if [ "$(rpm -E %fedora)" -le 41 ]; then
|
if [ "$(rpm -E %fedora)" -le 41 ]; then
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install ffmpeg ffmpeg-libs -y
|
"$ESCALATION_TOOL" "$PACKAGER" install ffmpeg ffmpeg-libs -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
||||||
else
|
else
|
||||||
|
@ -61,7 +61,7 @@ installAdditionalDepend() {
|
||||||
DISTRO_DEPS='steam lutris goverlay'
|
DISTRO_DEPS='steam lutris goverlay'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/lutris/lutris |
|
version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/lutris/lutris |
|
||||||
grep -v 'beta' |
|
grep -v 'beta' |
|
||||||
tail -n1 |
|
tail -n1 |
|
||||||
|
@ -69,7 +69,7 @@ installAdditionalDepend() {
|
||||||
|
|
||||||
version_no_v=$(echo "$version" | tr -d v)
|
version_no_v=$(echo "$version" | tr -d v)
|
||||||
curl -sSLo "lutris_${version_no_v}_all.deb" "https://github.com/lutris/lutris/releases/download/${version}/lutris_${version_no_v}_all.deb"
|
curl -sSLo "lutris_${version_no_v}_all.deb" "https://github.com/lutris/lutris/releases/download/${version}/lutris_${version_no_v}_all.deb"
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Installing Lutris...${RC}"
|
printf "%b\n" "${YELLOW}Installing Lutris...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install ./lutris_"${version_no_v}"_all.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install ./lutris_"${version_no_v}"_all.deb
|
||||||
|
|
||||||
|
@ -94,8 +94,7 @@ installAdditionalDepend() {
|
||||||
DISTRO_DEPS='lutris'
|
DISTRO_DEPS='lutris'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
*)
|
*) ;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
install_theme_tools() {
|
install_theme_tools() {
|
||||||
printf "%b\n" "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}"
|
printf "%b\n" "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
|
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
|
@ -47,7 +47,7 @@ applyTheming() {
|
||||||
configure_qt6ct() {
|
configure_qt6ct() {
|
||||||
printf "%b\n" "${YELLOW}Configuring qt6ct...${RC}"
|
printf "%b\n" "${YELLOW}Configuring qt6ct...${RC}"
|
||||||
mkdir -p "$HOME/.config/qt6ct"
|
mkdir -p "$HOME/.config/qt6ct"
|
||||||
cat <<EOF > "$HOME/.config/qt6ct/qt6ct.conf"
|
cat <<EOF >"$HOME/.config/qt6ct/qt6ct.conf"
|
||||||
[Appearance]
|
[Appearance]
|
||||||
style=kvantum
|
style=kvantum
|
||||||
color_scheme=default
|
color_scheme=default
|
||||||
|
@ -58,7 +58,7 @@ EOF
|
||||||
# Add QT_QPA_PLATFORMTHEME to /etc/environment
|
# Add QT_QPA_PLATFORMTHEME to /etc/environment
|
||||||
if ! grep -q "QT_QPA_PLATFORMTHEME=qt6ct" /etc/environment; then
|
if ! grep -q "QT_QPA_PLATFORMTHEME=qt6ct" /etc/environment; then
|
||||||
printf "%b\n" "${YELLOW}Adding QT_QPA_PLATFORMTHEME to /etc/environment...${RC}"
|
printf "%b\n" "${YELLOW}Adding QT_QPA_PLATFORMTHEME to /etc/environment...${RC}"
|
||||||
echo "QT_QPA_PLATFORMTHEME=qt6ct" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
|
echo "QT_QPA_PLATFORMTHEME=qt6ct" | "$ESCALATION_TOOL" tee -a /etc/environment >/dev/null
|
||||||
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME added to /etc/environment.${RC}"
|
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME added to /etc/environment.${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME already set in /etc/environment.${RC}"
|
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME already set in /etc/environment.${RC}"
|
||||||
|
@ -68,7 +68,7 @@ EOF
|
||||||
configure_kvantum() {
|
configure_kvantum() {
|
||||||
printf "%b\n" "${YELLOW}Configuring Kvantum...${RC}"
|
printf "%b\n" "${YELLOW}Configuring Kvantum...${RC}"
|
||||||
mkdir -p "$HOME/.config/Kvantum"
|
mkdir -p "$HOME/.config/Kvantum"
|
||||||
cat <<EOF > "$HOME/.config/Kvantum/kvantum.kvconfig"
|
cat <<EOF >"$HOME/.config/Kvantum/kvantum.kvconfig"
|
||||||
[General]
|
[General]
|
||||||
theme=KvArcDark
|
theme=KvArcDark
|
||||||
EOF
|
EOF
|
||||||
|
@ -85,4 +85,4 @@ applyTheming
|
||||||
install_theme_tools
|
install_theme_tools
|
||||||
configure_qt6ct
|
configure_qt6ct
|
||||||
configure_kvantum
|
configure_kvantum
|
||||||
successOutput
|
successOutput
|
||||||
|
|
|
@ -8,13 +8,13 @@ removeSnaps() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
||||||
if [ "$ID" = ubuntu ]; then
|
if [ "$ID" = ubuntu ]; then
|
||||||
"$ESCALATION_TOOL" apt-mark hold snapd
|
"$ESCALATION_TOOL" apt-mark hold snapd
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf|zypper)
|
dnf | zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
cleanup_system() {
|
cleanup_system() {
|
||||||
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
|
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" clean
|
"$ESCALATION_TOOL" "$PACKAGER" clean
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove -y
|
"$ESCALATION_TOOL" "$PACKAGER" autoremove -y
|
||||||
"$ESCALATION_TOOL" du -h /var/cache/apt
|
"$ESCALATION_TOOL" du -h /var/cache/apt
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
|
@ -21,7 +21,8 @@ cleanup_system() {
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
# shellcheck disable=SC2046
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
||||||
|
@ -46,7 +47,7 @@ clean_data() {
|
||||||
printf "%b" "${YELLOW}Clean up old cache files and empty the trash? (y/N): ${RC}"
|
printf "%b" "${YELLOW}Clean up old cache files and empty the trash? (y/N): ${RC}"
|
||||||
read -r clean_response
|
read -r clean_response
|
||||||
case $clean_response in
|
case $clean_response in
|
||||||
y|Y)
|
y | Y)
|
||||||
printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}"
|
printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}"
|
||||||
if [ -d "$HOME/.cache" ]; then
|
if [ -d "$HOME/.cache" ]; then
|
||||||
find "$HOME/.cache/" -type f -atime +5 -delete
|
find "$HOME/.cache/" -type f -atime +5 -delete
|
||||||
|
|
|
@ -20,17 +20,19 @@ fastUpdate() {
|
||||||
dtype_local="arch"
|
dtype_local="arch"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$ESCALATION_TOOL" rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${dtype_local}
|
if "$ESCALATION_TOOL" rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root "$dtype_local" || [ ! -s /etc/pacman.d/mirrorlist ]; then
|
||||||
if [ $? -ne 0 ] || [ ! -s /etc/pacman.d/mirrorlist ]; then
|
|
||||||
printf "%b\n" "${RED}Rate-mirrors failed, restoring backup.${RC}"
|
printf "%b\n" "${RED}Rate-mirrors failed, restoring backup.${RC}"
|
||||||
"$ESCALATION_TOOL" cp /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
|
"$ESCALATION_TOOL" cp /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" apt-get update
|
"$ESCALATION_TOOL" apt-get update
|
||||||
if ! command_exists nala; then
|
if ! command_exists nala; then
|
||||||
"$ESCALATION_TOOL" apt-get install -y nala || { printf "%b\n" "${YELLOW}Falling back to apt-get${RC}"; PACKAGER="apt-get"; }
|
"$ESCALATION_TOOL" apt-get install -y nala || {
|
||||||
|
printf "%b\n" "${YELLOW}Falling back to apt-get${RC}"
|
||||||
|
PACKAGER="apt-get"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PACKAGER" = "nala" ]; then
|
if [ "$PACKAGER" = "nala" ]; then
|
||||||
|
@ -49,7 +51,7 @@ fastUpdate() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -58,7 +60,7 @@ fastUpdate() {
|
||||||
updateSystem() {
|
updateSystem() {
|
||||||
printf "%b\n" "${GREEN}Updating system${RC}"
|
printf "%b\n" "${GREEN}Updating system${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" upgrade -y
|
"$ESCALATION_TOOL" "$PACKAGER" upgrade -y
|
||||||
;;
|
;;
|
||||||
|
@ -75,7 +77,7 @@ updateSystem() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
InstallTermiusFonts() {
|
InstallTermiusFonts() {
|
||||||
if [ ! -f "/usr/share/kbd/consolefonts/ter-c18b.psf.gz" ] &&
|
if [ ! -f "/usr/share/kbd/consolefonts/ter-c18b.psf.gz" ] &&
|
||||||
[ ! -f "/usr/share/consolefonts/Uni3-TerminusBold18x10.psf.gz" ] &&
|
[ ! -f "/usr/share/consolefonts/Uni3-TerminusBold18x10.psf.gz" ] &&
|
||||||
[ ! -f "/usr/lib/kbd/consolefonts/ter-p32n.psf.gz" ]; then
|
[ ! -f "/usr/lib/kbd/consolefonts/ter-p32n.psf.gz" ]; then
|
||||||
printf "%b\n" "${YELLOW}Installing Terminus Fonts...${RC}"
|
printf "%b\n" "${YELLOW}Installing Terminus Fonts...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm terminus-font
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm terminus-font
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fonts-terminus
|
"$ESCALATION_TOOL" "$PACKAGER" install -y fonts-terminus
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
|
@ -27,38 +27,38 @@ InstallTermiusFonts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SetTermiusFonts() {
|
SetTermiusFonts() {
|
||||||
case "$DTYPE" in
|
case "$DTYPE" in
|
||||||
arch)
|
arch)
|
||||||
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
|
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
|
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
|
||||||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
||||||
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
|
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "${GREEN}Terminus font set for TTY.${RC}"
|
printf "%b\n" "${GREEN}Terminus font set for TTY.${RC}"
|
||||||
;;
|
;;
|
||||||
debian)
|
debian)
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Updating console-setup configuration...${RC}"
|
printf "%b\n" "${YELLOW}Updating console-setup configuration...${RC}"
|
||||||
"$ESCALATION_TOOL" sed -i 's/^CODESET=.*/CODESET="guess"/' /etc/default/console-setup
|
"$ESCALATION_TOOL" sed -i 's/^CODESET=.*/CODESET="guess"/' /etc/default/console-setup
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup
|
"$ESCALATION_TOOL" sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONTSIZE=.*/FONTSIZE="16x32"/' /etc/default/console-setup
|
"$ESCALATION_TOOL" sed -i 's/^FONTSIZE=.*/FONTSIZE="16x32"/' /etc/default/console-setup
|
||||||
printf "%b\n" "${GREEN}Console-setup configuration updated for Terminus font.${RC}"
|
printf "%b\n" "${GREEN}Console-setup configuration updated for Terminus font.${RC}"
|
||||||
# Editing console-setup requires initramfs to be regenerated
|
# Editing console-setup requires initramfs to be regenerated
|
||||||
"$ESCALATION_TOOL" update-initramfs -u
|
"$ESCALATION_TOOL" update-initramfs -u
|
||||||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
||||||
"$ESCALATION_TOOL" setfont -C /dev/tty1 /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz
|
"$ESCALATION_TOOL" setfont -C /dev/tty1 /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
|
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora)
|
||||||
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
|
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
|
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
|
||||||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
||||||
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
|
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
|
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Function to list common session options
|
# Function to list common session options
|
||||||
list_sessions() {
|
list_sessions() {
|
||||||
|
@ -28,12 +28,14 @@ list_sessions() {
|
||||||
7) session="mate.desktop" ;;
|
7) session="mate.desktop" ;;
|
||||||
8) session="openbox.desktop" ;;
|
8) session="openbox.desktop" ;;
|
||||||
9) session="i3.desktop" ;;
|
9) session="i3.desktop" ;;
|
||||||
10)
|
10)
|
||||||
printf "%b" "Enter custom session name (e.g., mysession): "
|
printf "%b" "Enter custom session name (e.g., mysession): "
|
||||||
read -r session ;;
|
read -r session
|
||||||
*)
|
;;
|
||||||
|
*)
|
||||||
printf "%b\n" "Invalid option selected."
|
printf "%b\n" "Invalid option selected."
|
||||||
exit 1 ;;
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +86,7 @@ configure_sddm() {
|
||||||
printf "%b\n" "Configuring SDDM for autologin..."
|
printf "%b\n" "Configuring SDDM for autologin..."
|
||||||
printf "%b" "Enter username for SDDM autologin: "
|
printf "%b" "Enter username for SDDM autologin: "
|
||||||
read -r user
|
read -r user
|
||||||
list_sessions # Show session options
|
list_sessions # Show session options
|
||||||
|
|
||||||
printf "%b\n" '[Autologin]' | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
printf "%b\n" '[Autologin]' | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
||||||
printf "%s\n" "User=$user" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
printf "%s\n" "User=$user" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
||||||
|
@ -105,8 +107,8 @@ configure_lxdm() {
|
||||||
printf "%b\n" "Configuring LXDM for autologin..."
|
printf "%b\n" "Configuring LXDM for autologin..."
|
||||||
printf "%b" "Enter username for LXDM autologin: "
|
printf "%b" "Enter username for LXDM autologin: "
|
||||||
read -r user
|
read -r user
|
||||||
list_sessions # Show session options
|
list_sessions # Show session options
|
||||||
|
|
||||||
"$ESCALATION_TOOL" sed -i'' "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf
|
"$ESCALATION_TOOL" sed -i'' "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf
|
||||||
"$ESCALATION_TOOL" sed -i'' "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf
|
"$ESCALATION_TOOL" sed -i'' "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf
|
||||||
|
|
||||||
|
|
|
@ -58,21 +58,20 @@ update_fstab() {
|
||||||
fstab_entry="UUID=$UUID $mount_point $FSTYPE defaults 0 2"
|
fstab_entry="UUID=$UUID $mount_point $FSTYPE defaults 0 2"
|
||||||
|
|
||||||
# Append the comment and the entry to /etc/fstab
|
# Append the comment and the entry to /etc/fstab
|
||||||
printf "%b\n" "$comment" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
|
printf "%b\n" "$comment" | "$ESCALATION_TOOL" tee -a /etc/fstab >/dev/null
|
||||||
printf "%b\n" "$fstab_entry" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
|
printf "%b\n" "$fstab_entry" | "$ESCALATION_TOOL" tee -a /etc/fstab >/dev/null
|
||||||
printf "%b\n" "" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
|
printf "%b\n" "" | "$ESCALATION_TOOL" tee -a /etc/fstab >/dev/null
|
||||||
|
|
||||||
printf "%b\n" "Entry added to /etc/fstab:"
|
printf "%b\n" "Entry added to /etc/fstab:"
|
||||||
printf "%b\n" "$comment"
|
printf "%b\n" "$comment"
|
||||||
printf "%b\n" "$fstab_entry"
|
printf "%b\n" "$fstab_entry"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to mount the drive
|
# Function to mount the drive
|
||||||
mount_drive() {
|
mount_drive() {
|
||||||
printf "%b\n" "Mounting the drive..."
|
printf "%b\n" "Mounting the drive..."
|
||||||
"$ESCALATION_TOOL" mount -a
|
"$ESCALATION_TOOL" mount -a
|
||||||
if mount | grep "$mount_point" > /dev/null; then
|
if mount | grep "$mount_point" >/dev/null; then
|
||||||
printf "%b\n" "${GREEN}Drive mounted successfully at $mount_point${RC}."
|
printf "%b\n" "${GREEN}Drive mounted successfully at $mount_point${RC}."
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Failed to mount the drive.${RC}"
|
printf "%b\n" "${RED}Failed to mount the drive.${RC}"
|
||||||
|
|
|
@ -2,13 +2,12 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Function to check Bluez is installed
|
|
||||||
setupBluetooth() {
|
setupBluetooth() {
|
||||||
printf "%b\n" "${YELLOW}Installing Bluez...${RC}"
|
printf "%b\n" "${YELLOW}Installing Bluez...${RC}"
|
||||||
if ! command_exists bluetoothctl; then
|
if ! command_exists bluetoothctl; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils bluez
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
||||||
|
@ -18,18 +17,16 @@ setupBluetooth() {
|
||||||
printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
|
printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if bluetooth service is running
|
|
||||||
if ! systemctl is-active --quiet bluetooth; then
|
if ! systemctl is-active --quiet bluetooth; then
|
||||||
printf "%b\n" "${YELLOW}Bluetooth service is not running. Starting it now...${RC}"
|
printf "%b\n" "${YELLOW}Bluetooth service is not running. Starting it now...${RC}"
|
||||||
"$ESCALATION_TOOL" systemctl start bluetooth
|
"$ESCALATION_TOOL" systemctl start bluetooth
|
||||||
|
|
||||||
if systemctl is-active --quiet bluetooth; then
|
if systemctl is-active --quiet bluetooth; then
|
||||||
printf "%b\n" "${GREEN}Bluetooth service started successfully.${RC}"
|
printf "%b\n" "${GREEN}Bluetooth service started successfully.${RC}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to display the main menu
|
|
||||||
main_menu() {
|
main_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear
|
||||||
|
@ -56,7 +53,6 @@ main_menu() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to scan for devices
|
|
||||||
scan_devices() {
|
scan_devices() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}Scanning for devices...${RC}"
|
printf "%b\n" "${YELLOW}Scanning for devices...${RC}"
|
||||||
|
@ -69,16 +65,14 @@ scan_devices() {
|
||||||
printf "%b\n" "$devices"
|
printf "%b\n" "$devices"
|
||||||
fi
|
fi
|
||||||
printf "%b" "Press any key to return to the main menu..."
|
printf "%b" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt for MAC address using numbers
|
|
||||||
prompt_for_mac() {
|
prompt_for_mac() {
|
||||||
action=$1
|
command=$1
|
||||||
command=$2
|
prompt_msg=$2
|
||||||
prompt_msg=$3
|
success_msg=$3
|
||||||
success_msg=$4
|
failure_msg=$4
|
||||||
failure_msg=$5
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear
|
||||||
|
@ -86,7 +80,7 @@ prompt_for_mac() {
|
||||||
if [ -z "$devices" ]; then
|
if [ -z "$devices" ]; then
|
||||||
printf "%b\n" "${RED}No devices available. Please scan for devices first.${RC}"
|
printf "%b\n" "${RED}No devices available. Please scan for devices first.${RC}"
|
||||||
printf "%b" "Press any key to return to the main menu..."
|
printf "%b" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -95,23 +89,24 @@ prompt_for_mac() {
|
||||||
i=1
|
i=1
|
||||||
echo "$device_list" | while IFS= read -r device; do
|
echo "$device_list" | while IFS= read -r device; do
|
||||||
printf "%d. %s\n" "$i" "$device"
|
printf "%d. %s\n" "$i" "$device"
|
||||||
|
#shellcheck disable=SC2030
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
done
|
done
|
||||||
printf "%b\n" "0. Exit to main menu"
|
printf "%b\n" "0. Exit to main menu"
|
||||||
printf "%b\n" "$prompt_msg"
|
printf "%b\n" "$prompt_msg"
|
||||||
read -r choice
|
read -r choice
|
||||||
|
|
||||||
# Validate the choice
|
# shellcheck disable=SC2031
|
||||||
if echo "$choice" | grep -qE '^[0-9]+$' && [ "$choice" -le "$((i - 1))" ] && [ "$choice" -gt 0 ]; then
|
if echo "$choice" | grep -qE '^[0-9]+$' && [ "$choice" -le "$((i - 1))" ] && [ "$choice" -gt 0 ]; then
|
||||||
device=$(echo "$device_list" | sed -n "${choice}p")
|
device=$(echo "$device_list" | sed -n "${choice}p")
|
||||||
mac=$(echo "$device" | awk '{print $2}')
|
mac=$(echo "$device" | awk '{print $2}')
|
||||||
if bluetoothctl info "$mac" > /dev/null 2>&1; then
|
if bluetoothctl info "$mac" >/dev/null 2>&1; then
|
||||||
bluetoothctl "$command" "$mac" && {
|
if bluetoothctl "$command" "$mac"; then
|
||||||
printf "%b\n" "${GREEN}$success_msg${RC}"
|
printf "%b\n" "${GREEN}$success_msg${RC}"
|
||||||
break
|
break
|
||||||
} || {
|
else
|
||||||
printf "%b\n" "${RED}$failure_msg${RC}"
|
printf "%b\n" "${RED}$failure_msg${RC}"
|
||||||
}
|
fi
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Invalid MAC address. Please try again.${RC}"
|
printf "%b\n" "${RED}Invalid MAC address. Please try again.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -122,30 +117,25 @@ prompt_for_mac() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
printf "%b" "Press any key to return to the main menu..."
|
printf "%b" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to pair with a device
|
|
||||||
pair_device() {
|
pair_device() {
|
||||||
prompt_for_mac "pair" "pair" "Enter the number of the device to pair: " "Pairing with device completed." "Failed to pair with device."
|
prompt_for_mac "pair" "Enter the number of the device to pair: " "Pairing with device completed." "Failed to pair with device."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to connect to a device
|
|
||||||
connect_device() {
|
connect_device() {
|
||||||
prompt_for_mac "connect" "connect" "Enter the number of the device to connect: " "Connecting to device completed." "Failed to connect to device."
|
prompt_for_mac "connect" "Enter the number of the device to connect: " "Connecting to device completed." "Failed to connect to device."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to disconnect from a device
|
|
||||||
disconnect_device() {
|
disconnect_device() {
|
||||||
prompt_for_mac "disconnect" "disconnect" "Enter the number of the device to disconnect: " "Disconnecting from device completed." "Failed to disconnect from device."
|
prompt_for_mac "disconnect" "Enter the number of the device to disconnect: " "Disconnecting from device completed." "Failed to disconnect from device."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove a device
|
|
||||||
remove_device() {
|
remove_device() {
|
||||||
prompt_for_mac "remove" "remove" "Enter the number of the device to remove: " "Removing device completed." "Failed to remove device."
|
prompt_for_mac "remove" "Enter the number of the device to remove: " "Removing device completed." "Failed to remove device."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
setupBluetooth
|
setupBluetooth
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
CONFIGURATION_URL="https://github.com/quickemu-project/quickget_configs/releases/download/daily/quickget_data.json"
|
CONFIGURATION_URL="https://github.com/quickemu-project/quickget_configs/releases/download/daily/quickget_data.json"
|
||||||
|
|
||||||
# Function to display all available block devices
|
|
||||||
list_devices() {
|
list_devices() {
|
||||||
printf "%b\n" "${YELLOW} Available devices and partitions: ${RC}"
|
printf "%b\n" "${YELLOW} Available devices and partitions: ${RC}"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
@ -12,17 +11,21 @@ list_devices() {
|
||||||
printf "\n"
|
printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
installDependencies() {
|
installDependencies() {
|
||||||
DEPENDENCIES="xz gzip bzip2 jq"
|
DEPENDENCIES="xz gzip bzip2 jq"
|
||||||
if ! command_exists ${DEPENDENCIES}; then
|
if ! command_exists ${DEPENDENCIES}; then
|
||||||
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
|
||||||
case "${PACKAGER}" in
|
case "${PACKAGER}" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"${ESCALATION_TOOL}" "${PACKAGER}" install -y xz-utils gzip bzip2 jq;;
|
"${ESCALATION_TOOL}" "${PACKAGER}" install -y xz-utils gzip bzip2 jq
|
||||||
dnf|zypper)
|
;;
|
||||||
"${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};;
|
dnf | zypper)
|
||||||
|
"${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES}
|
||||||
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};;
|
"${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES}
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -31,7 +34,6 @@ installDependencies() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to ask whether to use local or online ISO
|
|
||||||
choose_iso_source() {
|
choose_iso_source() {
|
||||||
printf "%b\n" "${YELLOW} Do you want to use a local ISO or download online? ${RC}"
|
printf "%b\n" "${YELLOW} Do you want to use a local ISO or download online? ${RC}"
|
||||||
printf "1) Download online\n"
|
printf "1) Download online\n"
|
||||||
|
@ -64,14 +66,17 @@ decompress_iso() {
|
||||||
case "${ISO_ARCHIVE_FORMAT}" in
|
case "${ISO_ARCHIVE_FORMAT}" in
|
||||||
xz)
|
xz)
|
||||||
xz -d "${ISO_PATH}"
|
xz -d "${ISO_PATH}"
|
||||||
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.xz//')";;
|
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.xz//')"
|
||||||
|
;;
|
||||||
gz)
|
gz)
|
||||||
gzip -d "${ISO_PATH}"
|
gzip -d "${ISO_PATH}"
|
||||||
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.gz//')";;
|
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.gz//')"
|
||||||
|
;;
|
||||||
bz2)
|
bz2)
|
||||||
bzip2 -d "${ISO_PATH}"
|
bzip2 -d "${ISO_PATH}"
|
||||||
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.bz2//')";;
|
ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.bz2//')"
|
||||||
*)
|
;;
|
||||||
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported archive format. Try manually decompressing the ISO and choosing it as a local file instead.${RC}"
|
printf "%b\n" "${RED}Unsupported archive format. Try manually decompressing the ISO and choosing it as a local file instead.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
@ -82,12 +87,14 @@ decompress_iso() {
|
||||||
|
|
||||||
check_hash() {
|
check_hash() {
|
||||||
case "${#ISO_CHECKSUM}" in
|
case "${#ISO_CHECKSUM}" in
|
||||||
32) HASH_ALGO="md5sum";;
|
32) HASH_ALGO="md5sum" ;;
|
||||||
40) HASH_ALGO="sha1sum";;
|
40) HASH_ALGO="sha1sum" ;;
|
||||||
64) HASH_ALGO="sha256sum";;
|
64) HASH_ALGO="sha256sum" ;;
|
||||||
128) HASH_ALGO="sha512sum";;
|
128) HASH_ALGO="sha512sum" ;;
|
||||||
*) printf "%b\n" "${RED}Invalid checksum length. Skipping checksum verification.${RC}"
|
*)
|
||||||
return;;
|
printf "%b\n" "${RED}Invalid checksum length. Skipping checksum verification.${RC}"
|
||||||
|
return
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
printf "%b\n" "Checking ISO integrity using ${HASH_ALGO}..."
|
printf "%b\n" "Checking ISO integrity using ${HASH_ALGO}..."
|
||||||
if ! echo "${ISO_CHECKSUM} ${ISO_PATH}" | "${HASH_ALGO}" --check --status; then
|
if ! echo "${ISO_CHECKSUM} ${ISO_PATH}" | "${HASH_ALGO}" --check --status; then
|
||||||
|
@ -115,9 +122,9 @@ get_architecture() {
|
||||||
printf "%b" "Select an option (1-3): "
|
printf "%b" "Select an option (1-3): "
|
||||||
read -r ARCH
|
read -r ARCH
|
||||||
case "${ARCH}" in
|
case "${ARCH}" in
|
||||||
1) ARCH="x86_64";;
|
1) ARCH="x86_64" ;;
|
||||||
2) ARCH="aarch64";;
|
2) ARCH="aarch64" ;;
|
||||||
3) ARCH="riscv64";;
|
3) ARCH="riscv64" ;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Invalid architecture selected. ${RC}"
|
printf "%b\n" "${RED}Invalid architecture selected. ${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -209,27 +216,21 @@ get_online_iso() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
write_iso(){
|
write_iso() {
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# Ask whether to use a local or online ISO
|
|
||||||
choose_iso_source
|
choose_iso_source
|
||||||
|
|
||||||
clear
|
clear
|
||||||
# Display all available devices
|
|
||||||
list_devices
|
list_devices
|
||||||
|
|
||||||
# Prompt user for USB device
|
|
||||||
printf "%b" "Enter the USB device (e.g. /dev/sdX): "
|
printf "%b" "Enter the USB device (e.g. /dev/sdX): "
|
||||||
read -r USB_DEVICE
|
read -r USB_DEVICE
|
||||||
|
|
||||||
# Verify that the USB device exists
|
|
||||||
if [ ! -b "$USB_DEVICE" ]; then
|
if [ ! -b "$USB_DEVICE" ]; then
|
||||||
printf "%b\n" "${RED}USB device not found: $USB_DEVICE${RC}"
|
printf "%b\n" "${RED}USB device not found: $USB_DEVICE${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Confirm the device selection with the user
|
|
||||||
printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}"
|
printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}"
|
||||||
read -r CONFIRMATION
|
read -r CONFIRMATION
|
||||||
|
|
||||||
|
@ -238,22 +239,19 @@ write_iso(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display progress and create the bootable USB drive
|
|
||||||
printf "%b\n" "${YELLOW}Creating bootable USB drive...${RC}"
|
printf "%b\n" "${YELLOW}Creating bootable USB drive...${RC}"
|
||||||
if ! "$ESCALATION_TOOL" dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then
|
if ! "$ESCALATION_TOOL" dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then
|
||||||
printf "%b\n" "${RED}Failed to create bootable USB drive${RC}"
|
printf "%b\n" "${RED}Failed to create bootable USB drive${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sync to ensure all data is written
|
|
||||||
if ! "$ESCALATION_TOOL" sync; then
|
if ! "$ESCALATION_TOOL" sync; then
|
||||||
printf "%b\n" "${RED}Failed to sync data${RC}"
|
printf "%b\n" "${RED}Failed to sync data${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}Bootable USB drive created successfully!${RC}"
|
printf "%b\n" "${GREEN}Bootable USB drive created successfully!${RC}"
|
||||||
|
|
||||||
# Eject the USB device
|
|
||||||
printf "%b\n" "${YELLOW}Ejecting ${USB_DEVICE}...${RC}"
|
printf "%b\n" "${YELLOW}Ejecting ${USB_DEVICE}...${RC}"
|
||||||
if ! "$ESCALATION_TOOL" umount "${USB_DEVICE}"* 2>/dev/null; then
|
if ! "$ESCALATION_TOOL" umount "${USB_DEVICE}"* 2>/dev/null; then
|
||||||
printf "%b\n" "${RED}Failed to unmount ${USB_DEVICE}${RC}"
|
printf "%b\n" "${RED}Failed to unmount ${USB_DEVICE}${RC}"
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC2181
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
# Function to display the menu
|
|
||||||
printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}"
|
printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}"
|
||||||
|
|
||||||
# Install OpenSSL
|
|
||||||
if ! command_exists openssl; then
|
if ! command_exists openssl; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm --needed openssl
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm --needed openssl
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y openssl
|
"$ESCALATION_TOOL" "$PACKAGER" install -y openssl
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
|
@ -40,7 +41,6 @@ show_menu() {
|
||||||
printf "%b\n" "========================================================"
|
printf "%b\n" "========================================================"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to encrypt a file
|
|
||||||
encrypt_file() {
|
encrypt_file() {
|
||||||
printf "%b" "Enter the path to the file or directory to encrypt: "
|
printf "%b" "Enter the path to the file or directory to encrypt: "
|
||||||
read -r INPUT_PATH
|
read -r INPUT_PATH
|
||||||
|
@ -49,7 +49,7 @@ encrypt_file() {
|
||||||
printf "%b\n" "Path does not exist!"
|
printf "%b\n" "Path does not exist!"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b" "Enter the path for the encrypted file or directory: "
|
printf "%b" "Enter the path for the encrypted file or directory: "
|
||||||
read -r OUTPUT_PATH
|
read -r OUTPUT_PATH
|
||||||
|
|
||||||
|
@ -59,15 +59,12 @@ encrypt_file() {
|
||||||
if [ -d "$INPUT_PATH" ]; then
|
if [ -d "$INPUT_PATH" ]; then
|
||||||
# Encrypt each file in the directory
|
# Encrypt each file in the directory
|
||||||
find "$INPUT_PATH" -type f | while read -r FILE; do
|
find "$INPUT_PATH" -type f | while read -r FILE; do
|
||||||
REL_PATH="${FILE#$INPUT_PATH/}"
|
REL_PATH="${FILE#"$INPUT_PATH"/}"
|
||||||
OUTPUT_FILE="$OUTPUT_PATH/$REL_PATH.enc"
|
OUTPUT_FILE="$OUTPUT_PATH/$REL_PATH.enc"
|
||||||
mkdir -p "$(dirname "$OUTPUT_FILE")"
|
mkdir -p "$(dirname "$OUTPUT_FILE")"
|
||||||
openssl enc -aes-256-cbc -salt -pbkdf2 -in "$FILE" -out "$OUTPUT_FILE" -k "$PASSWORD"
|
openssl enc -aes-256-cbc -salt -pbkdf2 -in "$FILE" -out "$OUTPUT_FILE" -k "$PASSWORD"
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "%b\n" "Encrypted: $OUTPUT_FILE"
|
printf "%b\n" "Encrypted: $OUTPUT_FILE"
|
||||||
else
|
|
||||||
printf "%b\n" "Failed to encrypt: $FILE"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# Encrypt a single file
|
# Encrypt a single file
|
||||||
|
@ -77,15 +74,11 @@ encrypt_file() {
|
||||||
fi
|
fi
|
||||||
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
||||||
openssl enc -aes-256-cbc -salt -pbkdf2 -in "$INPUT_PATH" -out "$OUTPUT_PATH" -k "$PASSWORD"
|
openssl enc -aes-256-cbc -salt -pbkdf2 -in "$INPUT_PATH" -out "$OUTPUT_PATH" -k "$PASSWORD"
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "%b\n" "Encrypted: $OUTPUT_PATH"
|
printf "%b\n" "Encrypted: $OUTPUT_PATH"
|
||||||
else
|
|
||||||
printf "%b\n" "Failed to encrypt: $INPUT_PATH"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to decrypt a file
|
|
||||||
decrypt_file() {
|
decrypt_file() {
|
||||||
printf "%b" "Enter the path to the file or directory to decrypt: "
|
printf "%b" "Enter the path to the file or directory to decrypt: "
|
||||||
read -r INPUT_PATH
|
read -r INPUT_PATH
|
||||||
|
@ -104,15 +97,12 @@ decrypt_file() {
|
||||||
if [ -d "$INPUT_PATH" ]; then
|
if [ -d "$INPUT_PATH" ]; then
|
||||||
# Decrypt each file in the directory
|
# Decrypt each file in the directory
|
||||||
find "$INPUT_PATH" -type f -name '*.enc' | while read -r FILE; do
|
find "$INPUT_PATH" -type f -name '*.enc' | while read -r FILE; do
|
||||||
REL_PATH="${FILE#$INPUT_PATH/}"
|
REL_PATH="${FILE#"$INPUT_PATH"/}"
|
||||||
OUTPUT_FILE="$OUTPUT_PATH/${REL_PATH%.enc}"
|
OUTPUT_FILE="$OUTPUT_PATH/${REL_PATH%.enc}"
|
||||||
mkdir -p "$(dirname "$OUTPUT_FILE")"
|
mkdir -p "$(dirname "$OUTPUT_FILE")"
|
||||||
openssl enc -aes-256-cbc -d -pbkdf2 -in "$FILE" -out "$OUTPUT_FILE" -k "$PASSWORD"
|
openssl enc -aes-256-cbc -d -pbkdf2 -in "$FILE" -out "$OUTPUT_FILE" -k "$PASSWORD"
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "%b\n" "Decrypted: $OUTPUT_FILE"
|
printf "%b\n" "Decrypted: $OUTPUT_FILE"
|
||||||
else
|
|
||||||
printf "%b\n" "Failed to decrypt: $FILE"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# Decrypt a single file
|
# Decrypt a single file
|
||||||
|
@ -122,15 +112,12 @@ decrypt_file() {
|
||||||
fi
|
fi
|
||||||
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
||||||
openssl enc -aes-256-cbc -d -pbkdf2 -in "$INPUT_PATH" -out "$OUTPUT_PATH" -k "$PASSWORD"
|
openssl enc -aes-256-cbc -d -pbkdf2 -in "$INPUT_PATH" -out "$OUTPUT_PATH" -k "$PASSWORD"
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "%b\n" "Decrypted: $OUTPUT_PATH"
|
printf "%b\n" "Decrypted: $OUTPUT_PATH"
|
||||||
else
|
|
||||||
printf "%b\n" "Failed to decrypt: $INPUT_PATH"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main(){
|
main() {
|
||||||
clear
|
clear
|
||||||
while true; do
|
while true; do
|
||||||
show_menu
|
show_menu
|
||||||
|
@ -140,15 +127,18 @@ main(){
|
||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
1) encrypt_file ;;
|
1) encrypt_file ;;
|
||||||
2) decrypt_file ;;
|
2) decrypt_file ;;
|
||||||
3) printf "%b\n" "Exiting..."; exit 0 ;;
|
3)
|
||||||
|
printf "%b\n" "Exiting..."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%b\n" "Press [Enter] to continue..."
|
printf "%b\n" "Press [Enter] to continue..."
|
||||||
read -r dummy
|
read -r _
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
main
|
main
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
auto_detect_displays() {
|
auto_detect_displays() {
|
||||||
if confirm_action "Auto-detect displays and set common resolution?"; then
|
if confirm_action "Auto-detect displays and set common resolution?"; then
|
||||||
execute_command "xrandr --auto"
|
execute_command "xrandr --auto"
|
||||||
|
|
||||||
monitors=$(detect_connected_monitors)
|
monitors=$(detect_connected_monitors)
|
||||||
first_monitor=$(echo "$monitors" | head -n 1)
|
first_monitor=$(echo "$monitors" | head -n 1)
|
||||||
common_resolutions=$(get_unique_resolutions "$first_monitor")
|
common_resolutions=$(get_unique_resolutions "$first_monitor")
|
||||||
|
@ -18,14 +18,14 @@ auto_detect_displays() {
|
||||||
temp_common_resolutions=$(mktemp)
|
temp_common_resolutions=$(mktemp)
|
||||||
temp_resolutions=$(mktemp)
|
temp_resolutions=$(mktemp)
|
||||||
|
|
||||||
printf "%b\n" "$common_resolutions" > "$temp_common_resolutions"
|
printf "%b\n" "$common_resolutions" >"$temp_common_resolutions"
|
||||||
printf "%b\n" "$resolutions" > "$temp_resolutions"
|
printf "%b\n" "$resolutions" >"$temp_resolutions"
|
||||||
|
|
||||||
common_resolutions=$(comm -12 "$temp_common_resolutions" "$temp_resolutions")
|
common_resolutions=$(comm -12 "$temp_common_resolutions" "$temp_resolutions")
|
||||||
|
|
||||||
rm -f "$temp_common_resolutions" "$temp_resolutions"
|
rm -f "$temp_common_resolutions" "$temp_resolutions"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$common_resolutions" ]; then
|
if [ -z "$common_resolutions" ]; then
|
||||||
printf "%b\n" "${RED}No common resolution found among connected monitors.${RC}"
|
printf "%b\n" "${RED}No common resolution found among connected monitors.${RC}"
|
||||||
return
|
return
|
||||||
|
|
|
@ -47,7 +47,10 @@ change_orientation() {
|
||||||
2) orientation="left" ;;
|
2) orientation="left" ;;
|
||||||
3) orientation="right" ;;
|
3) orientation="right" ;;
|
||||||
4) orientation="inverted" ;;
|
4) orientation="inverted" ;;
|
||||||
*) printf "%b\n" "${RED}Invalid selection.${RC}"; return ;;
|
*)
|
||||||
|
printf "%b\n" "${RED}Invalid selection.${RC}"
|
||||||
|
return
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if confirm_action "Change orientation of $monitor_name to $orientation?"; then
|
if confirm_action "Change orientation of $monitor_name to $orientation?"; then
|
||||||
|
|
|
@ -31,7 +31,7 @@ disable_monitor() {
|
||||||
monitor_name=$(echo "$monitor_array" | cut -d' ' -f"$monitor_choice")
|
monitor_name=$(echo "$monitor_array" | cut -d' ' -f"$monitor_choice")
|
||||||
|
|
||||||
printf "%b\n" "${RED}Warning: Disabling the monitor will turn it off and may affect your display setup.${RC}"
|
printf "%b\n" "${RED}Warning: Disabling the monitor will turn it off and may affect your display setup.${RC}"
|
||||||
|
|
||||||
if confirm_action "Do you really want to disable ${GREEN}$monitor_name${RC}?"; then
|
if confirm_action "Do you really want to disable ${GREEN}$monitor_name${RC}?"; then
|
||||||
printf "%b\n" "${GREEN}Disabling $monitor_name${RC}"
|
printf "%b\n" "${GREEN}Disabling $monitor_name${RC}"
|
||||||
execute_command "xrandr --output $monitor_name --off"
|
execute_command "xrandr --output $monitor_name --off"
|
||||||
|
|
|
@ -14,7 +14,7 @@ enable_monitor() {
|
||||||
printf "%b\n" "${YELLOW} Enable Monitor${RC}"
|
printf "%b\n" "${YELLOW} Enable Monitor${RC}"
|
||||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||||
printf "%b\n" "${YELLOW}Choose a monitor to enable: ${RC}"
|
printf "%b\n" "${YELLOW}Choose a monitor to enable: ${RC}"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for monitor in $monitor_array; do
|
for monitor in $monitor_array; do
|
||||||
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
||||||
|
|
|
@ -11,7 +11,7 @@ extend_displays() {
|
||||||
i=1
|
i=1
|
||||||
for monitor in $monitor_array; do
|
for monitor in $monitor_array; do
|
||||||
if [ "$i" -gt 1 ]; then
|
if [ "$i" -gt 1 ]; then
|
||||||
prev_monitor=$(echo "$monitor_array" | cut -d' ' -f$((i-1)))
|
prev_monitor=$(echo "$monitor_array" | cut -d' ' -f$((i - 1)))
|
||||||
if confirm_action "Extend $monitor to the right of $prev_monitor?"; then
|
if confirm_action "Extend $monitor to the right of $prev_monitor?"; then
|
||||||
printf "%b\n" "${GREEN}Extending $monitor to the right of $prev_monitor${RC}"
|
printf "%b\n" "${GREEN}Extending $monitor to the right of $prev_monitor${RC}"
|
||||||
execute_command "xrandr --output $monitor --right-of $prev_monitor"
|
execute_command "xrandr --output $monitor --right-of $prev_monitor"
|
||||||
|
|
|
@ -45,7 +45,10 @@ manage_arrangement() {
|
||||||
2) position="--right-of" ;;
|
2) position="--right-of" ;;
|
||||||
3) position="--above" ;;
|
3) position="--above" ;;
|
||||||
4) position="--below" ;;
|
4) position="--below" ;;
|
||||||
*) printf "%b\n" "${RED}Invalid selection.${RC}"; return ;;
|
*)
|
||||||
|
printf "%b\n" "${RED}Invalid selection.${RC}"
|
||||||
|
return
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Choose the reference monitor:${RC}"
|
printf "%b\n" "${YELLOW}Choose the reference monitor:${RC}"
|
||||||
|
|
|
@ -29,7 +29,7 @@ adjust_monitor_brightness() {
|
||||||
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$'; then
|
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$'; then
|
||||||
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
||||||
printf "Press [Enter] to continue..."
|
printf "Press [Enter] to continue..."
|
||||||
read -r dummy
|
read -r _
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ adjust_monitor_brightness() {
|
||||||
if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$monitor_count" ]; then
|
if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$monitor_count" ]; then
|
||||||
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
||||||
printf "Press [Enter] to continue..."
|
printf "Press [Enter] to continue..."
|
||||||
read -r dummy
|
read -r _
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
# Function to set resolutions
|
|
||||||
set_resolutions() {
|
set_resolutions() {
|
||||||
monitor_list=$(detect_connected_monitors)
|
monitor_list=$(detect_connected_monitors)
|
||||||
monitor_array=$(echo "$monitor_list" | tr '\n' ' ')
|
monitor_array=$(echo "$monitor_list" | tr '\n' ' ')
|
||||||
|
@ -33,7 +32,7 @@ set_resolutions() {
|
||||||
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then
|
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then
|
||||||
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
|
||||||
printf "%b\n" "Press [Enter] to continue..."
|
printf "%b\n" "Press [Enter] to continue..."
|
||||||
read -r dummy
|
read -r _
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -41,13 +40,13 @@ set_resolutions() {
|
||||||
resolutions=$(get_unique_resolutions "$monitor_name" | sort -rn -t'x' -k1,1 -k2,2)
|
resolutions=$(get_unique_resolutions "$monitor_name" | sort -rn -t'x' -k1,1 -k2,2)
|
||||||
|
|
||||||
temp_res_file=$(mktemp)
|
temp_res_file=$(mktemp)
|
||||||
printf "%b\n" "$resolutions" | awk '{print NR " " $0}' > "$temp_res_file"
|
printf "%b\n" "$resolutions" | awk '{print NR " " $0}' >"$temp_res_file"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
while read -r resolution; do
|
while read -r resolution; do
|
||||||
echo "$resolution" >> "$temp_res_file"
|
echo "$resolution" >>"$temp_res_file"
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
done < "$temp_res_file"
|
done <"$temp_res_file"
|
||||||
|
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
# Create a script to toggle numlock
|
# Create a script to toggle numlock
|
||||||
|
|
||||||
create_file() {
|
create_file() {
|
||||||
printf "%b\n" "Creating script..."
|
printf "%b\n" "Creating script..."
|
||||||
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
for tty in /dev/tty{1..6}
|
for tty in /dev/tty{1..6}
|
||||||
|
@ -18,13 +18,13 @@ do
|
||||||
done
|
done
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a systemd service to run the script on boot
|
# Create a systemd service to run the script on boot
|
||||||
create_service() {
|
create_service() {
|
||||||
printf "%b\n" "Creating service..."
|
printf "%b\n" "Creating service..."
|
||||||
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=numlock
|
Description=numlock
|
||||||
|
|
||||||
|
@ -39,24 +39,23 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
numlockSetup() {
|
numlockSetup() {
|
||||||
# Check if the script and service files exists
|
if [ ! -f "/usr/local/bin/numlock" ]; then
|
||||||
if [ ! -f "/usr/local/bin/numlock" ]; then
|
create_file
|
||||||
create_file
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
||||||
create_service
|
create_service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
||||||
read -r confirm
|
read -r confirm
|
||||||
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
||||||
"$ESCALATION_TOOL" systemctl enable numlock.service --quiet
|
"$ESCALATION_TOOL" systemctl enable numlock.service --quiet
|
||||||
printf "%b\n" "Numlock will be enabled on boot"
|
printf "%b\n" "Numlock will be enabled on boot"
|
||||||
else
|
else
|
||||||
"$ESCALATION_TOOL" systemctl disable numlock.service --quiet
|
"$ESCALATION_TOOL" systemctl disable numlock.service --quiet
|
||||||
printf "%b\n" "Numlock will not be enabled on boot"
|
printf "%b\n" "Numlock will not be enabled on boot"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -11,7 +11,7 @@ installollama() {
|
||||||
else
|
else
|
||||||
printf "%b\n" "${YELLOW}Installing ollama...${RC}"
|
printf "%b\n" "${YELLOW}Installing ollama...${RC}"
|
||||||
curl -fsSL https://ollama.com/install.sh | sh
|
curl -fsSL https://ollama.com/install.sh | sh
|
||||||
"$ESCALATION_TOOL" systemctl start ollama
|
"$ESCALATION_TOOL" systemctl start ollama
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,27 +52,26 @@ display_models() {
|
||||||
printf "%b\n" "16. Solar - 10.7B (6.1GB)"
|
printf "%b\n" "16. Solar - 10.7B (6.1GB)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to select model based on user input
|
|
||||||
select_model() {
|
select_model() {
|
||||||
choice="$1"
|
choice="$1"
|
||||||
case $choice in
|
case $choice in
|
||||||
1) printf "%b\n" "llama3.1";;
|
1) printf "%b\n" "llama3.1" ;;
|
||||||
2) printf "%b\n" "llama3.1:70b";;
|
2) printf "%b\n" "llama3.1:70b" ;;
|
||||||
3) printf "%b\n" "llama3.1:405b";;
|
3) printf "%b\n" "llama3.1:405b" ;;
|
||||||
4) printf "%b\n" "phi3";;
|
4) printf "%b\n" "phi3" ;;
|
||||||
5) printf "%b\n" "phi3:medium";;
|
5) printf "%b\n" "phi3:medium" ;;
|
||||||
6) printf "%b\n" "gemma2:2b";;
|
6) printf "%b\n" "gemma2:2b" ;;
|
||||||
7) printf "%b\n" "gemma2";;
|
7) printf "%b\n" "gemma2" ;;
|
||||||
8) printf "%b\n" "gemma2:27b";;
|
8) printf "%b\n" "gemma2:27b" ;;
|
||||||
9) printf "%b\n" "mistral";;
|
9) printf "%b\n" "mistral" ;;
|
||||||
10) printf "%b\n" "moondream";;
|
10) printf "%b\n" "moondream" ;;
|
||||||
11) printf "%b\n" "neural-chat";;
|
11) printf "%b\n" "neural-chat" ;;
|
||||||
12) printf "%b\n" "starling-lm";;
|
12) printf "%b\n" "starling-lm" ;;
|
||||||
13) printf "%b\n" "codellama";;
|
13) printf "%b\n" "codellama" ;;
|
||||||
14) printf "%b\n" "llama2-uncensored";;
|
14) printf "%b\n" "llama2-uncensored" ;;
|
||||||
15) printf "%b\n" "llava";;
|
15) printf "%b\n" "llava" ;;
|
||||||
16) printf "%b\n" "solar";;
|
16) printf "%b\n" "solar" ;;
|
||||||
*) printf "%b\n" "$choice";;
|
*) printf "%b\n" "$choice" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,10 +81,11 @@ run_model() {
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}Installed Models${RC}"
|
printf "%b\n" "${GREEN}Installed Models${RC}"
|
||||||
installed_models=$(ollama list)
|
installed_models=$(ollama list)
|
||||||
printf "%b\n" "${installed_models}"
|
printf "%b\n" "$installed_models"
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Custom Models${RC}"
|
printf "%b\n" "${YELLOW}Custom Models${RC}"
|
||||||
custom_models=$(ollama list | grep 'custom-model-prefix')
|
custom_models=$(ollama list | grep 'custom-model-prefix')
|
||||||
|
printf "%b\n" "$custom_models"
|
||||||
|
|
||||||
printf "%b" "Select a model to run: "
|
printf "%b" "Select a model to run: "
|
||||||
printf "%b" "Enter the number corresponding to the model or enter the name of a custom model: "
|
printf "%b" "Enter the number corresponding to the model or enter the name of a custom model: "
|
||||||
|
@ -103,7 +103,6 @@ create_model() {
|
||||||
printf "%b\n" "${YELLOW}Let's create a new model in Ollama!${RC}"
|
printf "%b\n" "${YELLOW}Let's create a new model in Ollama!${RC}"
|
||||||
display_models
|
display_models
|
||||||
|
|
||||||
# Prompt for base model
|
|
||||||
printf "%b" "Enter the base model (e.g. '13' for codellama): "
|
printf "%b" "Enter the base model (e.g. '13' for codellama): "
|
||||||
read -r base_model
|
read -r base_model
|
||||||
|
|
||||||
|
@ -112,11 +111,9 @@ create_model() {
|
||||||
printf "%b\n" "${YELLOW}Running the model: $model...${RC}"
|
printf "%b\n" "${YELLOW}Running the model: $model...${RC}"
|
||||||
ollama pull "$model"
|
ollama pull "$model"
|
||||||
|
|
||||||
# Prompt for custom model name
|
|
||||||
printf "%b" "Enter a name for the new customized model: "
|
printf "%b" "Enter a name for the new customized model: "
|
||||||
read -r custom_model_name
|
read -r custom_model_name
|
||||||
|
|
||||||
# Prompt for temperature setting
|
|
||||||
printf "%b" "Enter the desired temperature (higher values are more creative, lower values are more coherent, e.g., 1): "
|
printf "%b" "Enter the desired temperature (higher values are more creative, lower values are more coherent, e.g., 1): "
|
||||||
read -r temperature
|
read -r temperature
|
||||||
|
|
||||||
|
@ -124,13 +121,11 @@ create_model() {
|
||||||
temperature=${temperature:-1}
|
temperature=${temperature:-1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prompt for system message
|
|
||||||
printf "%b" "Enter the system message for the model customization (e.g., 'You are Mario from Super Mario Bros. Answer as Mario, the assistant, only.'): "
|
printf "%b" "Enter the system message for the model customization (e.g., 'You are Mario from Super Mario Bros. Answer as Mario, the assistant, only.'): "
|
||||||
read -r system_message
|
read -r system_message
|
||||||
|
|
||||||
# Create the Modelfile
|
|
||||||
printf "%b\n" "${YELLOW}Creating the Modelfile...${RC}"
|
printf "%b\n" "${YELLOW}Creating the Modelfile...${RC}"
|
||||||
cat << EOF > Modelfile
|
cat <<EOF >Modelfile
|
||||||
FROM $base_model
|
FROM $base_model
|
||||||
|
|
||||||
# set the temperature to $temperature
|
# set the temperature to $temperature
|
||||||
|
@ -142,13 +137,11 @@ $system_message
|
||||||
"""
|
"""
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create the model in Ollama
|
|
||||||
printf "%b\n" "${YELLOW}Creating the model in Ollama...${RC}"
|
printf "%b\n" "${YELLOW}Creating the model in Ollama...${RC}"
|
||||||
ollama create "$custom_model_name" -f Modelfile
|
ollama create "$custom_model_name" -f Modelfile
|
||||||
printf "%b\n" "${GREEN}Model '$custom_model_name' created successfully.${RC}"
|
printf "%b\n" "${GREEN}Model '$custom_model_name' created successfully.${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove a model
|
|
||||||
remove_model() {
|
remove_model() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${GREEN}Installed Models${RC}"
|
printf "%b\n" "${GREEN}Installed Models${RC}"
|
||||||
|
@ -189,13 +182,16 @@ menu() {
|
||||||
2) show_model_info ;;
|
2) show_model_info ;;
|
||||||
3) create_model ;;
|
3) create_model ;;
|
||||||
4) run_model ;;
|
4) run_model ;;
|
||||||
5) remove_model;;
|
5) remove_model ;;
|
||||||
6) printf "%b\n" "${GREEN}Exiting...${RC}"; exit 0 ;;
|
6)
|
||||||
|
printf "%b\n" "${GREEN}Exiting...${RC}"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*) printf "%b\n" "${RED}Invalid choice. Please try again.${RC}" ;;
|
*) printf "%b\n" "${RED}Invalid choice. Please try again.${RC}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Press Enter to continue...${RC}"
|
printf "%b\n" "${YELLOW}Press Enter to continue...${RC}"
|
||||||
read -r dummy
|
read -r _
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,4 +199,3 @@ checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installollama
|
installollama
|
||||||
menu
|
menu
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ installAutoCpufreq() {
|
||||||
cd auto-cpufreq
|
cd auto-cpufreq
|
||||||
printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}"
|
printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}"
|
||||||
"$ESCALATION_TOOL" ./auto-cpufreq-installer
|
"$ESCALATION_TOOL" ./auto-cpufreq-installer
|
||||||
"$ESCALATION_TOOL" auto-cpufreq --install
|
"$ESCALATION_TOOL" auto-cpufreq --install
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# Load common script functions
|
# Load common script functions
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Function to install packages based on the package manager
|
# Function to install packages based on the package manager
|
||||||
install_package() {
|
install_package() {
|
||||||
PACKAGE=$1
|
package=$1
|
||||||
if ! command_exists "$PACKAGE"; then
|
if ! command_exists "$package"; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$package"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
|
"$ESCALATION_TOOL" "$PACKAGER" install -y "$package"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo "$PACKAGE is already installed."
|
echo "$package is already installed."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup and configure SSH
|
# Function to setup and configure SSH
|
||||||
setup_ssh() {
|
setup_ssh() {
|
||||||
|
@ -26,18 +26,18 @@ setup_ssh() {
|
||||||
|
|
||||||
# Detect package manager and install appropriate SSH package
|
# Detect package manager and install appropriate SSH package
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
install_package openssh-server
|
install_package openssh-server
|
||||||
SSH_SERVICE="ssh"
|
SSH_SERVICE="ssh"
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
install_package openssh
|
install_package openssh
|
||||||
SSH_SERVICE="sshd"
|
SSH_SERVICE="sshd"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
install_package openssh-server
|
install_package openssh-server
|
||||||
SSH_SERVICE="sshd"
|
SSH_SERVICE="sshd"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Enable and start the appropriate SSH service
|
# Enable and start the appropriate SSH service
|
||||||
|
@ -60,7 +60,7 @@ setup_ssh() {
|
||||||
# Function to setup and configure Samba
|
# Function to setup and configure Samba
|
||||||
setup_samba() {
|
setup_samba() {
|
||||||
printf "%b\n" "${YELLOW}Setting up Samba...${RC}"
|
printf "%b\n" "${YELLOW}Setting up Samba...${RC}"
|
||||||
|
|
||||||
# Install Samba if not installed
|
# Install Samba if not installed
|
||||||
install_package samba
|
install_package samba
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ setup_samba() {
|
||||||
"$ESCALATION_TOOL" smbpasswd -a "$SAMBA_USER"
|
"$ESCALATION_TOOL" smbpasswd -a "$SAMBA_USER"
|
||||||
|
|
||||||
# Configure Samba settings
|
# Configure Samba settings
|
||||||
"$ESCALATION_TOOL" tee "$SAMBA_CONFIG" > /dev/null <<EOL
|
"$ESCALATION_TOOL" tee "$SAMBA_CONFIG" >/dev/null <<EOL
|
||||||
[global]
|
[global]
|
||||||
workgroup = WORKGROUP
|
workgroup = WORKGROUP
|
||||||
server string = Samba Server
|
server string = Samba Server
|
||||||
|
@ -157,7 +157,7 @@ configure_firewall() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssh_samba(){
|
setup_ssh_samba() {
|
||||||
printf "%b\n" "Samba and SSH Setup Script"
|
printf "%b\n" "Samba and SSH Setup Script"
|
||||||
printf "%b\n" "--------------------------"
|
printf "%b\n" "--------------------------"
|
||||||
clear
|
clear
|
||||||
|
@ -171,7 +171,7 @@ setup_ssh_samba(){
|
||||||
printf "%b\n" "5. Exit"
|
printf "%b\n" "5. Exit"
|
||||||
|
|
||||||
printf "%b" "Enter your choice (1-5): "
|
printf "%b" "Enter your choice (1-5): "
|
||||||
read CHOICE
|
read -r CHOICE
|
||||||
|
|
||||||
case "$CHOICE" in
|
case "$CHOICE" in
|
||||||
1)
|
1)
|
||||||
|
@ -203,4 +203,4 @@ setup_ssh_samba(){
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
setup_ssh_samba
|
setup_ssh_samba
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# Load common script functions
|
# Load common script functions
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
#external services directory
|
#external services directory
|
||||||
SCRIPT_DIR="./services"
|
SCRIPT_DIR="./services"
|
||||||
|
|
||||||
# Function to show the main menu
|
# Function to show the main menu
|
||||||
|
@ -78,7 +78,7 @@ add_service() {
|
||||||
|
|
||||||
# Create the service unit file
|
# Create the service unit file
|
||||||
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
|
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
|
||||||
|
|
||||||
# Create the service file with conditionals for optional fields
|
# Create the service file with conditionals for optional fields
|
||||||
{
|
{
|
||||||
printf "%b\n" "[Unit]"
|
printf "%b\n" "[Unit]"
|
||||||
|
@ -87,12 +87,12 @@ add_service() {
|
||||||
printf "%b\n" "[Service]"
|
printf "%b\n" "[Service]"
|
||||||
printf "%b\n" "ExecStart=$EXEC_START"
|
printf "%b\n" "ExecStart=$EXEC_START"
|
||||||
[ -n "$SERVICE_USER" ] && printf "%b\n" "User=$SERVICE_USER"
|
[ -n "$SERVICE_USER" ] && printf "%b\n" "User=$SERVICE_USER"
|
||||||
[ -n "$WORKING_DIRECTORY" ] && printf "%b\n" "WorkingDirectory=$WORKING_DIRECTORY"
|
[ -n "$WORKING_DIRECTORY" ] && printf "%b\n" "WorkingDirectory=$WORKING_DIRECTORY"
|
||||||
[ -n "$RESTART_POLICY" ] && printf "%b\n" "Restart=$RESTART_POLICY"
|
[ -n "$RESTART_POLICY" ] && printf "%b\n" "Restart=$RESTART_POLICY"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "%b\n" "[Install]"
|
printf "%b\n" "[Install]"
|
||||||
printf "%b\n" "WantedBy=multi-user.target"
|
printf "%b\n" "WantedBy=multi-user.target"
|
||||||
} | "$ESCALATION_TOOL" tee "$SERVICE_FILE" > /dev/null
|
} | "$ESCALATION_TOOL" tee "$SERVICE_FILE" >/dev/null
|
||||||
|
|
||||||
# Set permissions and reload systemd
|
# Set permissions and reload systemd
|
||||||
"$ESCALATION_TOOL" chmod 644 "$SERVICE_FILE"
|
"$ESCALATION_TOOL" chmod 644 "$SERVICE_FILE"
|
||||||
|
@ -260,17 +260,20 @@ main() {
|
||||||
6) start_service ;;
|
6) start_service ;;
|
||||||
7) stop_service ;;
|
7) stop_service ;;
|
||||||
8) enable_service ;;
|
8) enable_service ;;
|
||||||
9) disable_service ;;
|
9) disable_service ;;
|
||||||
10) create_service_from_external ;;
|
10) create_service_from_external ;;
|
||||||
11) printf "%b\n" "Exiting..."; exit 0 ;;
|
11)
|
||||||
|
printf "%b\n" "Exiting..."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%b\n" "Press [Enter] to continue..."
|
printf "%b\n" "Press [Enter] to continue..."
|
||||||
read -r dummy
|
read -r _
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
main
|
main
|
||||||
|
|
|
@ -2,28 +2,25 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Check if ~/.ssh/config exists, if not, create it
|
|
||||||
if [ ! -f ~/.ssh/config ]; then
|
if [ ! -f ~/.ssh/config ]; then
|
||||||
mkdir -p "$HOME/.ssh"
|
mkdir -p "$HOME/.ssh"
|
||||||
touch "$HOME/.ssh/config"
|
touch "$HOME/.ssh/config"
|
||||||
chmod 600 "$HOME/.ssh/config"
|
chmod 600 "$HOME/.ssh/config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to show available hosts from ~/.ssh/config
|
|
||||||
show_available_hosts() {
|
show_available_hosts() {
|
||||||
printf "%b\n" "Available Systems:"
|
printf "%b\n" "Available Systems:"
|
||||||
grep -E "^Host " "$HOME/.ssh/config" | awk '{print $2}'
|
grep -E "^Host " "$HOME/.ssh/config" | awk '{print $2}'
|
||||||
printf "%b\n" "-------------------"
|
printf "%b\n" "-------------------"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to ask for host details
|
|
||||||
ask_for_host_details() {
|
ask_for_host_details() {
|
||||||
printf "%b" "Enter Host Alias: "
|
printf "%b" "Enter Host Alias: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter Remote Host (hostname or IP): "
|
printf "%b" "Enter Remote Host (hostname or IP): "
|
||||||
read -r host
|
read -r host
|
||||||
printf "%b" "Enter Remote User: "
|
printf "%b" "Enter Remote User: "
|
||||||
read -r user
|
read -r user
|
||||||
{
|
{
|
||||||
printf "%b\n" "Host $host_alias"
|
printf "%b\n" "Host $host_alias"
|
||||||
printf "%b\n" " HostName $host"
|
printf "%b\n" " HostName $host"
|
||||||
|
@ -31,11 +28,10 @@ ask_for_host_details() {
|
||||||
printf "%b\n" " IdentityFile ~/.ssh/id_rsa"
|
printf "%b\n" " IdentityFile ~/.ssh/id_rsa"
|
||||||
printf "%b\n" " StrictHostKeyChecking no"
|
printf "%b\n" " StrictHostKeyChecking no"
|
||||||
printf "%b\n" " UserKnownHostsFile=/dev/null"
|
printf "%b\n" " UserKnownHostsFile=/dev/null"
|
||||||
} >> ~/.ssh/config
|
} >>~/.ssh/config
|
||||||
printf "%b\n" "Host $host_alias added successfully."
|
printf "%b\n" "Host $host_alias added successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to generate SSH key if not exists
|
|
||||||
generate_ssh_key() {
|
generate_ssh_key() {
|
||||||
if [ ! -f ~/.ssh/id_rsa ]; then
|
if [ ! -f ~/.ssh/id_rsa ]; then
|
||||||
printf "%b\n" "SSH key not found, generating one..."
|
printf "%b\n" "SSH key not found, generating one..."
|
||||||
|
@ -45,28 +41,26 @@ generate_ssh_key() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to share the SSH public key with the remote host
|
|
||||||
share_ssh_key() {
|
share_ssh_key() {
|
||||||
printf "%b" "Enter the alias of the host to copy the key to: "
|
printf "%b" "Enter the alias of the host to copy the key to: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b\n" "Copying SSH key to $host_alias..."
|
printf "%b\n" "Copying SSH key to $host_alias..."
|
||||||
ssh-copy-id "$host_alias"
|
ssh-copy-id "$host_alias"
|
||||||
printf "%b\n" "SSH key copied to $host_alias successfully."
|
printf "%b\n" "SSH key copied to $host_alias successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to disable password authentication and allow only SSH keys
|
|
||||||
#repeated twice as changes should take place when in commented state or modified state.
|
|
||||||
disable_password_auth() {
|
disable_password_auth() {
|
||||||
printf "%b\n" "Disabling SSH password authentication and enabling key-only login..."
|
printf "%b\n" "Disabling SSH password authentication and enabling key-only login..."
|
||||||
printf "%b\n" "Enter the alias of the host: "
|
printf "%b\n" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
# shellcheck disable=SC2029
|
||||||
ssh "$host_alias" "
|
ssh "$host_alias" "
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^#PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S systemctl restart sshd
|
$ESCALATION_TOOL -S systemctl restart sshd
|
||||||
"
|
"
|
||||||
printf "%b\n" "PasswordAuthentication set to no and PubkeyAuthentication set to yes."
|
printf "%b\n" "PasswordAuthentication set to no and PubkeyAuthentication set to yes."
|
||||||
}
|
}
|
||||||
|
@ -76,12 +70,13 @@ enable_password_auth() {
|
||||||
printf "%b\n" "Enter the alias of the host: "
|
printf "%b\n" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
# shellcheck disable=SC2029
|
||||||
ssh "$host_alias" "
|
ssh "$host_alias" "
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
|
$ESCALATION_TOOL -S sed -i 's/^PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S systemctl restart sshd
|
$ESCALATION_TOOL -S systemctl restart sshd
|
||||||
"
|
"
|
||||||
printf "%b\n" "PasswordAuthentication set to yes and PubkeyAuthentication set to no."
|
printf "%b\n" "PasswordAuthentication set to yes and PubkeyAuthentication set to no."
|
||||||
}
|
}
|
||||||
|
@ -95,18 +90,19 @@ check_password_auth() {
|
||||||
|
|
||||||
# Function to run a command on a remote server
|
# Function to run a command on a remote server
|
||||||
run_remote_command() {
|
run_remote_command() {
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the command to run: "
|
printf "%b" "Enter the command to run: "
|
||||||
read -r remote_command
|
read -r remote_command
|
||||||
|
# shellcheck disable=SC2029
|
||||||
ssh "$host_alias" "$remote_command"
|
ssh "$host_alias" "$remote_command"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to copy a file to a remote server
|
# Function to copy a file to a remote server
|
||||||
copy_file_to_remote() {
|
copy_file_to_remote() {
|
||||||
printf "%b" "Enter the local file path: "
|
printf "%b" "Enter the local file path: "
|
||||||
read -r local_file
|
read -r local_file
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the remote destination path: "
|
printf "%b" "Enter the remote destination path: "
|
||||||
read -r remote_path
|
read -r remote_path
|
||||||
|
@ -116,31 +112,30 @@ copy_file_to_remote() {
|
||||||
# Function to copy a directory to a remote server
|
# Function to copy a directory to a remote server
|
||||||
copy_directory_to_remote() {
|
copy_directory_to_remote() {
|
||||||
printf "%b" "Enter the local directory path: "
|
printf "%b" "Enter the local directory path: "
|
||||||
read -r local_dir
|
read -r local_dir
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the remote destination path: "
|
printf "%b" "Enter the remote destination path: "
|
||||||
read -r remote_path
|
read -r remote_path
|
||||||
scp -r "$local_dir" "$host_alias:$remote_path"
|
scp -r "$local_dir" "$host_alias:$remote_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to move a file to a remote server (copy and delete local)
|
# Function to move a file to a remote server (copy and delete local)
|
||||||
move_file_to_remote() {
|
move_file_to_remote() {
|
||||||
printf "%b" "Enter the local file path: "
|
printf "%b" "Enter the local file path: "
|
||||||
read -r local_file
|
read -r local_file
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the remote destination path: "
|
printf "%b" "Enter the remote destination path: "
|
||||||
read -r remote_path
|
read -r remote_path
|
||||||
scp "$local_file" "$host_alias:$remote_path" && rm "$local_file"
|
scp "$local_file" "$host_alias:$remote_path" && rm "$local_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to move a directory to a remote server (copy and delete local)
|
# Function to move a directory to a remote server (copy and delete local)
|
||||||
move_directory_to_remote() {
|
move_directory_to_remote() {
|
||||||
printf "%b" "Enter the local directory path: "
|
printf "%b" "Enter the local directory path: "
|
||||||
read -r local_dir
|
read -r local_dir
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the remote destination path: "
|
printf "%b" "Enter the remote destination path: "
|
||||||
read -r remote_path
|
read -r remote_path
|
||||||
|
@ -158,7 +153,7 @@ remove_system() {
|
||||||
# Function to view SSH configuration
|
# Function to view SSH configuration
|
||||||
view_ssh_config() {
|
view_ssh_config() {
|
||||||
printf "%b\n" "Enter the alias of the host to view (or press Enter to view all): "
|
printf "%b\n" "Enter the alias of the host to view (or press Enter to view all): "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
if [ -z "$host_alias" ]; then
|
if [ -z "$host_alias" ]; then
|
||||||
cat ~/.ssh/config
|
cat ~/.ssh/config
|
||||||
else
|
else
|
||||||
|
@ -179,11 +174,11 @@ backup_files() {
|
||||||
|
|
||||||
# Function to sync directories with remote host
|
# Function to sync directories with remote host
|
||||||
sync_directories() {
|
sync_directories() {
|
||||||
printf "%b" "Enter the local directory path: "
|
printf "%b" "Enter the local directory path: "
|
||||||
read -r local_dir
|
read -r local_dir
|
||||||
printf "%b" "Enter the alias of the host: "
|
printf "%b" "Enter the alias of the host: "
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "%b" "Enter the remote directory path: "
|
printf "%b" "Enter the remote directory path: "
|
||||||
read -r remote_dir
|
read -r remote_dir
|
||||||
rsync -avz "$local_dir" "$host_alias:$remote_dir"
|
rsync -avz "$local_dir" "$host_alias:$remote_dir"
|
||||||
}
|
}
|
||||||
|
@ -222,32 +217,35 @@ show_menu() {
|
||||||
# Function to execute the selected SSH operation
|
# Function to execute the selected SSH operation
|
||||||
main() {
|
main() {
|
||||||
while true; do
|
while true; do
|
||||||
show_menu
|
show_menu
|
||||||
read -r choice
|
read -r choice
|
||||||
case $choice in
|
case $choice in
|
||||||
1) ask_for_host_details ;;
|
1) ask_for_host_details ;;
|
||||||
2) show_available_hosts && printf "%b" "Enter the alias of the host to connect to: " && read -r host_alias; ssh "$host_alias" ;;
|
2)
|
||||||
3) generate_ssh_key ;;
|
show_available_hosts && printf "%b" "Enter the alias of the host to connect to: " && read -r host_alias
|
||||||
4) share_ssh_key ;;
|
ssh "$host_alias"
|
||||||
5) disable_password_auth ;;
|
;;
|
||||||
6) enable_password_auth ;;
|
3) generate_ssh_key ;;
|
||||||
7) check_password_auth ;;
|
4) share_ssh_key ;;
|
||||||
8) check_ssh_key_authentication ;;
|
5) disable_password_auth ;;
|
||||||
9) run_remote_command ;;
|
6) enable_password_auth ;;
|
||||||
10) copy_file_to_remote ;;
|
7) check_password_auth ;;
|
||||||
11) copy_directory_to_remote ;;
|
8) check_ssh_key_authentication ;;
|
||||||
12) move_file_to_remote ;;
|
9) run_remote_command ;;
|
||||||
13) move_directory_to_remote ;;
|
10) copy_file_to_remote ;;
|
||||||
14) remove_system ;;
|
11) copy_directory_to_remote ;;
|
||||||
15) view_ssh_config ;;
|
12) move_file_to_remote ;;
|
||||||
16) backup_files ;;
|
13) move_directory_to_remote ;;
|
||||||
17) sync_directories ;;
|
14) remove_system ;;
|
||||||
18) exit ;;
|
15) view_ssh_config ;;
|
||||||
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
16) backup_files ;;
|
||||||
esac
|
17) sync_directories ;;
|
||||||
done
|
18) exit ;;
|
||||||
|
*) printf "%b\n" "Invalid choice. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
main
|
main
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Function to install Timeshift
|
|
||||||
install_timeshift() {
|
install_timeshift() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}Checking if Timeshift is installed...${RC}"
|
printf "%b\n" "${YELLOW}Checking if Timeshift is installed...${RC}"
|
||||||
|
@ -21,7 +20,6 @@ install_timeshift() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to display the menu
|
|
||||||
display_menu() {
|
display_menu() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${CYAN}Timeshift CLI Automation${RC}"
|
printf "%b\n" "${CYAN}Timeshift CLI Automation${RC}"
|
||||||
|
@ -34,19 +32,16 @@ display_menu() {
|
||||||
printf "%b\n" "${CYAN}7) Exit${RC}"
|
printf "%b\n" "${CYAN}7) Exit${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to list snapshots
|
|
||||||
list_snapshots() {
|
list_snapshots() {
|
||||||
printf "%b\n" "${CYAN}Listing snapshots...${RC}"
|
printf "%b\n" "${CYAN}Listing snapshots...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --list-snapshots
|
"$ESCALATION_TOOL" timeshift --list-snapshots
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to list devices
|
|
||||||
list_devices() {
|
list_devices() {
|
||||||
printf "%b\n" "${CYAN}Listing available devices...${RC}"
|
printf "%b\n" "${CYAN}Listing available devices...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --list-devices
|
"$ESCALATION_TOOL" timeshift --list-devices
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to create a new snapshot
|
|
||||||
create_snapshot() {
|
create_snapshot() {
|
||||||
printf "%b" "${CYAN}Enter a comment for the snapshot (optional): ${RC}"
|
printf "%b" "${CYAN}Enter a comment for the snapshot (optional): ${RC}"
|
||||||
read -r COMMENT
|
read -r COMMENT
|
||||||
|
@ -64,14 +59,9 @@ create_snapshot() {
|
||||||
"$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" --tags "$TAG"
|
"$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" --tags "$TAG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
printf "%b\n" "${GREEN}Snapshot created successfully.${RC}"
|
||||||
printf "%b\n" "${GREEN}Snapshot created successfully.${RC}"
|
|
||||||
else
|
|
||||||
printf "%b\n" "${RED}Snapshot creation failed.${RC}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to restore a snapshot
|
|
||||||
restore_snapshot() {
|
restore_snapshot() {
|
||||||
list_snapshots
|
list_snapshots
|
||||||
|
|
||||||
|
@ -90,14 +80,9 @@ restore_snapshot() {
|
||||||
"$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes
|
"$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
printf "%b\n" "${GREEN}Snapshot restored successfully.${RC}"
|
||||||
printf "%b\n" "${GREEN}Snapshot restored successfully.${RC}"
|
|
||||||
else
|
|
||||||
printf "%b\n" "${RED}Snapshot restore failed.${RC}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to delete a snapshot
|
|
||||||
delete_snapshot() {
|
delete_snapshot() {
|
||||||
list_snapshots
|
list_snapshots
|
||||||
|
|
||||||
|
@ -107,14 +92,9 @@ delete_snapshot() {
|
||||||
printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}"
|
printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --delete --snapshot "$SNAPSHOT" --yes
|
"$ESCALATION_TOOL" timeshift --delete --snapshot "$SNAPSHOT" --yes
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}"
|
||||||
printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}"
|
|
||||||
else
|
|
||||||
printf "%b\n" "${RED}Snapshot deletion failed.${RC}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to delete all snapshots
|
|
||||||
delete_all_snapshots() {
|
delete_all_snapshots() {
|
||||||
printf "%b\n" "${RED}WARNING: This will delete all snapshots!${RC}"
|
printf "%b\n" "${RED}WARNING: This will delete all snapshots!${RC}"
|
||||||
printf "%b" "${CYAN}Are you sure? (y/N): ${RC}"
|
printf "%b" "${CYAN}Are you sure? (y/N): ${RC}"
|
||||||
|
@ -123,11 +103,7 @@ delete_all_snapshots() {
|
||||||
if [ "$CONFIRMATION" = "y" ] || [ "$CONFIRMATION" = "Y" ]; then
|
if [ "$CONFIRMATION" = "y" ] || [ "$CONFIRMATION" = "Y" ]; then
|
||||||
printf "%b\n" "${CYAN}Deleting all snapshots...${RC}"
|
printf "%b\n" "${CYAN}Deleting all snapshots...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --delete-all --yes
|
"$ESCALATION_TOOL" timeshift --delete-all --yes
|
||||||
if [ $? -eq 0 ]; then
|
printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}"
|
||||||
printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}"
|
|
||||||
else
|
|
||||||
printf "%b\n" "${RED}Failed to delete snapshots.${RC}"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Operation cancelled.${RC}"
|
printf "%b\n" "${RED}Operation cancelled.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -146,15 +122,18 @@ main_menu() {
|
||||||
4) restore_snapshot ;;
|
4) restore_snapshot ;;
|
||||||
5) delete_snapshot ;;
|
5) delete_snapshot ;;
|
||||||
6) delete_all_snapshots ;;
|
6) delete_all_snapshots ;;
|
||||||
7) printf "%b\n" "${GREEN}Exiting...${RC}"; exit 0 ;;
|
7)
|
||||||
|
printf "%b\n" "${GREEN}Exiting...${RC}"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*) printf "%b\n" "${RED}Invalid option. Please try again.${RC}" ;;
|
*) printf "%b\n" "${RED}Invalid option. Please try again.${RC}" ;;
|
||||||
esac
|
esac
|
||||||
printf "%b\n" "${CYAN}Press Enter to continue...${RC}"
|
printf "%b\n" "${CYAN}Press Enter to continue...${RC}"
|
||||||
read -r dummy
|
read -r _
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
install_timeshift
|
install_timeshift
|
||||||
main_menu
|
main_menu
|
||||||
|
|
|
@ -33,7 +33,7 @@ addToGroup() {
|
||||||
groups_to_add=$(echo "$groups" | tr ' ' ',')
|
groups_to_add=$(echo "$groups" | tr ' ' ',')
|
||||||
|
|
||||||
printf "%b" "${YELLOW}Are you sure you want to add user $username to $groups_to_add? [Y/n]: ${RC}"
|
printf "%b" "${YELLOW}Are you sure you want to add user $username to $groups_to_add? [Y/n]: ${RC}"
|
||||||
read -r confirm
|
read -r _
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
"$ESCALATION_TOOL" usermod -aG "$groups_to_add" "$username"
|
"$ESCALATION_TOOL" usermod -aG "$groups_to_add" "$username"
|
||||||
|
@ -44,4 +44,4 @@ addToGroup() {
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkGroups
|
checkGroups
|
||||||
addToGroup
|
addToGroup
|
||||||
|
|
|
@ -11,7 +11,7 @@ createUser() {
|
||||||
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
||||||
read -r username
|
read -r username
|
||||||
|
|
||||||
if ! echo "$username" | grep '^[a-zA-Z]*$' > /dev/null; then
|
if ! echo "$username" | grep '^[a-zA-Z]*$' >/dev/null; then
|
||||||
printf "%b\n" "${RED}Username must only contain letters and cannot contain spaces.${RC}"
|
printf "%b\n" "${RED}Username must only contain letters and cannot contain spaces.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -12,12 +12,12 @@ changePassword() {
|
||||||
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
||||||
read -r username
|
read -r username
|
||||||
|
|
||||||
if id "$username" > /dev/null 2>&1; then
|
if id "$username" >/dev/null 2>&1; then
|
||||||
printf "%b" "${YELLOW}Enter new password: ${RC}"
|
printf "%b" "${YELLOW}Enter new password: ${RC}"
|
||||||
read -r password
|
read -r password
|
||||||
|
|
||||||
printf "%b" "${YELLOW}Are you sure you want to change password for ""$username""? [Y/n]: ${RC}"
|
printf "%b" "${YELLOW}Are you sure you want to change password for ""$username""? [Y/n]: ${RC}"
|
||||||
read -r confirm
|
read -r _
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
|
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
|
||||||
|
@ -30,4 +30,4 @@ changePassword() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
changePassword
|
changePassword
|
||||||
|
|
|
@ -12,12 +12,12 @@ deleteUser() {
|
||||||
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
||||||
read -r username
|
read -r username
|
||||||
|
|
||||||
if id "$username" > /dev/null 2>&1; then
|
if id "$username" >/dev/null 2>&1; then
|
||||||
printf "%b" "${YELLOW}Are you sure you want to delete user ""$username""? [Y/n]: ${RC}"
|
printf "%b" "${YELLOW}Are you sure you want to delete user ""$username""? [Y/n]: ${RC}"
|
||||||
read -r confirm
|
read -r _
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
$ESCALATION_TOOL userdel --remove "$username" 2>/dev/null
|
"$ESCALATION_TOOL" userdel --remove "$username" 2>/dev/null
|
||||||
printf "%b\n" "${GREEN}User $username deleted successfully${RC}"
|
printf "%b\n" "${GREEN}User $username deleted successfully${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
||||||
|
@ -27,4 +27,4 @@ deleteUser() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
deleteUser
|
deleteUser
|
||||||
|
|
|
@ -12,7 +12,7 @@ removeFromGroup() {
|
||||||
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
printf "%b" "${YELLOW}Enter the username: ${RC}"
|
||||||
read -r username
|
read -r username
|
||||||
|
|
||||||
if ! id "$username" > /dev/null 2>&1; then
|
if ! id "$username" >/dev/null 2>&1; then
|
||||||
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -34,14 +34,15 @@ removeFromGroup() {
|
||||||
groups_to_remove=$(echo "$groups" | tr ' ' ',')
|
groups_to_remove=$(echo "$groups" | tr ' ' ',')
|
||||||
|
|
||||||
printf "%b" "${YELLOW}Are you sure you want to remove user $username from $groups_to_remove? [Y/n]: ${RC}"
|
printf "%b" "${YELLOW}Are you sure you want to remove user $username from $groups_to_remove? [Y/n]: ${RC}"
|
||||||
read -r confirm
|
read -r _
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
$ESCALATION_TOOL usermod -rG $groups_to_remove "$username"
|
# shellcheck disable=SC2086
|
||||||
|
"$ESCALATION_TOOL" usermod -rG $groups_to_remove "$username"
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}User successfully removed from $groups_to_remove${RC}"
|
printf "%b\n" "${GREEN}User successfully removed from $groups_to_remove${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
removeFromGroup
|
removeFromGroup
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
# Function to check xrandr is installed
|
|
||||||
setup_xrandr() {
|
setup_xrandr() {
|
||||||
printf "%b\n" "${YELLOW}Installing xrandr...${RC}"
|
printf "%b\n" "${YELLOW}Installing xrandr...${RC}"
|
||||||
if ! command_exists xrandr; then
|
if ! command_exists xrandr; then
|
||||||
|
@ -10,7 +9,7 @@ setup_xrandr() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm xorg-xrandr
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm xorg-xrandr
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get | nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -22,56 +21,52 @@ setup_xrandr() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to execute xrandr commands and handle errors
|
|
||||||
execute_command() {
|
execute_command() {
|
||||||
command="$1"
|
command="$1"
|
||||||
printf "Executing: %s\n" "$command"
|
printf "Executing: %s\n" "$command"
|
||||||
eval "$command" 2>&1 | tee /tmp/xrandr.log | tail -n 20
|
eval "$command" 2>&1 | tee /tmp/xrandr.log | tail -n 20
|
||||||
|
#shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
printf "%b\n" "${RED}An error occurred while executing the command. Check /tmp/xrandr.log for details.${RC}"
|
printf "%b\n" "${RED}An error occurred while executing the command. Check /tmp/xrandr.log for details.${RC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to detect connected monitors
|
|
||||||
detect_connected_monitors() {
|
detect_connected_monitors() {
|
||||||
xrandr_output=$(xrandr)
|
xrandr_output=$(xrandr)
|
||||||
printf "%b\n" "$xrandr_output" | grep " connected" | awk '{print $1}'
|
printf "%b\n" "$xrandr_output" | grep " connected" | awk '{print $1}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get the current brightness for a monitor
|
|
||||||
get_current_brightness() {
|
get_current_brightness() {
|
||||||
monitor="$1"
|
monitor="$1"
|
||||||
xrandr --verbose | grep -A 10 "^$monitor connected" | grep "Brightness:" | awk '{print $2}'
|
xrandr --verbose | grep -A 10 "^$monitor connected" | grep "Brightness:" | awk '{print $2}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get resolutions for a monitor
|
|
||||||
get_unique_resolutions() {
|
get_unique_resolutions() {
|
||||||
monitor="$1"
|
monitor="$1"
|
||||||
xrandr_output=$(xrandr)
|
xrandr_output=$(xrandr)
|
||||||
available_resolutions=$(printf "%s" "$xrandr_output" | sed -n "/$monitor connected/,/^[^ ]/p" | grep -oP '\d+x\d+' | sort -u)
|
available_resolutions=$(printf "%s" "$xrandr_output" | sed -n "/$monitor connected/,/^[^ ]/p" | grep -oP '\d+x\d+' | sort -u)
|
||||||
|
|
||||||
standard_resolutions="1920x1080 1280x720 1600x900 2560x1440 3840x2160"
|
standard_resolutions="1920x1080 1280x720 1600x900 2560x1440 3840x2160"
|
||||||
|
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
printf "%s" "$available_resolutions" > "$temp_file"
|
printf "%s" "$available_resolutions" >"$temp_file"
|
||||||
|
|
||||||
filtered_standard_resolutions=$(printf "%s" "$standard_resolutions" | tr ' ' '\n' | grep -xF -f "$temp_file")
|
filtered_standard_resolutions=$(printf "%s" "$standard_resolutions" | tr ' ' '\n' | grep -xF -f "$temp_file")
|
||||||
|
|
||||||
rm "$temp_file"
|
rm "$temp_file"
|
||||||
|
|
||||||
available_res_file=$(mktemp)
|
available_res_file=$(mktemp)
|
||||||
filtered_standard_res_file=$(mktemp)
|
filtered_standard_res_file=$(mktemp)
|
||||||
printf "%s" "$available_resolutions" | sort > "$available_res_file"
|
printf "%s" "$available_resolutions" | sort >"$available_res_file"
|
||||||
printf "%s" "$filtered_standard_resolutions" | sort > "$filtered_standard_res_file"
|
printf "%s" "$filtered_standard_resolutions" | sort >"$filtered_standard_res_file"
|
||||||
|
|
||||||
remaining_resolutions=$(comm -23 "$available_res_file" "$filtered_standard_res_file")
|
remaining_resolutions=$(comm -23 "$available_res_file" "$filtered_standard_res_file")
|
||||||
|
|
||||||
rm "$available_res_file" "$filtered_standard_res_file"
|
rm "$available_res_file" "$filtered_standard_res_file"
|
||||||
|
|
||||||
printf "%b\n" "$filtered_standard_resolutions\n$remaining_resolutions" | head -n 10
|
printf "%b\n" "$filtered_standard_resolutions\n$remaining_resolutions" | head -n 10
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt for confirmation
|
|
||||||
confirm_action() {
|
confirm_action() {
|
||||||
action="$1"
|
action="$1"
|
||||||
printf "%b\n" "${CYAN}$action${RC}"
|
printf "%b\n" "${CYAN}$action${RC}"
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
# Function to check if NetworkManager is installed
|
|
||||||
setupNetworkManager() {
|
setupNetworkManager() {
|
||||||
printf "%b\n" "${YELLOW}Installing NetworkManager...${RC}"
|
printf "%b\n" "${YELLOW}Installing NetworkManager...${RC}"
|
||||||
if ! command_exists nmcli; then
|
if ! command_exists nmcli; then
|
||||||
|
@ -20,19 +19,17 @@ setupNetworkManager() {
|
||||||
else
|
else
|
||||||
printf "%b\n" "${YELLOW}NetworkManager is already installed.${RC}"
|
printf "%b\n" "${YELLOW}NetworkManager is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if NetworkManager service is running
|
|
||||||
if ! systemctl is-active --quiet NetworkManager; then
|
if ! systemctl is-active --quiet NetworkManager; then
|
||||||
printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}"
|
printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}"
|
||||||
"$ESCALATION_TOOL" systemctl start NetworkManager
|
"$ESCALATION_TOOL" systemctl start NetworkManager
|
||||||
|
|
||||||
if systemctl is-active --quiet NetworkManager; then
|
if systemctl is-active --quiet NetworkManager; then
|
||||||
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to display the main menu
|
|
||||||
main_menu() {
|
main_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear
|
||||||
|
@ -61,7 +58,6 @@ main_menu() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to scan for WiFi networks
|
|
||||||
scan_networks() {
|
scan_networks() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}Scanning for WiFi networks...${RC}"
|
printf "%b\n" "${YELLOW}Scanning for WiFi networks...${RC}"
|
||||||
|
@ -73,36 +69,33 @@ scan_networks() {
|
||||||
echo "$networks" | awk -F: '{printf("%d. SSID: %-25s \n", NR, $1)}'
|
echo "$networks" | awk -F: '{printf("%d. SSID: %-25s \n", NR, $1)}'
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "Press any key to return to the main menu..."
|
printf "%b\n" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to turn WiFi on
|
|
||||||
wifi_on() {
|
wifi_on() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}Turning WiFi on...${RC}"
|
printf "%b\n" "${YELLOW}Turning WiFi on...${RC}"
|
||||||
nmcli radio wifi on && {
|
if nmcli radio wifi on; then
|
||||||
printf "%b\n" "${GREEN}WiFi is now turned on.${RC}"
|
printf "%b\n" "${GREEN}WiFi is now turned on.${RC}"
|
||||||
} || {
|
else
|
||||||
printf "%b\n" "${RED}Failed to turn on WiFi.${RC}"
|
printf "%b\n" "${RED}Failed to turn on WiFi.${RC}"
|
||||||
}
|
fi
|
||||||
printf "%b\n" "Press any key to return to the main menu..."
|
printf "%b\n" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to turn WiFi off
|
|
||||||
wifi_off() {
|
wifi_off() {
|
||||||
clear
|
clear
|
||||||
printf "%b\n" "${YELLOW}Turning WiFi off...${RC}"
|
printf "%b\n" "${YELLOW}Turning WiFi off...${RC}"
|
||||||
nmcli radio wifi off && {
|
if nmcli radio wifi off; then
|
||||||
printf "%b\n" "${GREEN}WiFi is now turned off.${RC}"
|
printf "%b\n" "${GREEN}WiFi is now turned off.${RC}"
|
||||||
} || {
|
else
|
||||||
printf "%b\n" "${RED}Failed to turn off WiFi.${RC}"
|
printf "%b\n" "${RED}Failed to turn off WiFi.${RC}"
|
||||||
}
|
fi
|
||||||
printf "%b\n" "Press any key to return to the main menu..."
|
printf "%b\n" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt for WiFi network selection
|
|
||||||
prompt_for_network() {
|
prompt_for_network() {
|
||||||
action=$1
|
action=$1
|
||||||
prompt_msg=$2
|
prompt_msg=$2
|
||||||
|
@ -116,19 +109,19 @@ prompt_for_network() {
|
||||||
if [ -z "$networks" ]; then
|
if [ -z "$networks" ]; then
|
||||||
printf "%b\n" "${RED}No networks available. Please scan for networks first.${RC}"
|
printf "%b\n" "${RED}No networks available. Please scan for networks first.${RC}"
|
||||||
printf "%b\n" "Press any key to return to the main menu..."
|
printf "%b\n" "Press any key to return to the main menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
rm -f "$temp_file"
|
rm -f "$temp_file"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$networks" > "$temp_file"
|
echo "$networks" >"$temp_file"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
while IFS= read -r network; do
|
while IFS= read -r network; do
|
||||||
ssid=$(echo "$network" | awk -F: '{print $1}')
|
ssid=$(echo "$network" | awk -F: '{print $1}')
|
||||||
printf "%b\n" "$i. SSID: " "$ssid"
|
printf "%b\n" "$i. SSID: " "$ssid"
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
done < "$temp_file"
|
done <"$temp_file"
|
||||||
|
|
||||||
printf "%b\n" "0. Exit to main menu"
|
printf "%b\n" "0. Exit to main menu"
|
||||||
printf "%b" "$prompt_msg"
|
printf "%b" "$prompt_msg"
|
||||||
|
@ -140,40 +133,36 @@ prompt_for_network() {
|
||||||
printf "%b" "Enter password for SSID: " "$ssid"
|
printf "%b" "Enter password for SSID: " "$ssid"
|
||||||
read -r password
|
read -r password
|
||||||
printf "\n"
|
printf "\n"
|
||||||
nmcli dev wifi connect "$ssid" password "$password" && {
|
if nmcli dev wifi connect "$ssid" password "$password"; then
|
||||||
printf "%b\n" "${GREEN}$success_msg${RC}"
|
printf "%b\n" "${GREEN}${success_msg}${RC}"
|
||||||
} || {
|
else
|
||||||
printf "%b\n" "${RED}$failure_msg${RC}"
|
printf "%b\n" "${RED}${failure_msg}${RC}"
|
||||||
}
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Invalid choice. Please try again.${RC}"
|
printf "%b\n" "${RED}Invalid choice. Please try again.${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b\n" "Press any key to return to the selection menu..."
|
printf "%b\n" "Press any key to return to the selection menu..."
|
||||||
read -r dummy
|
read -r _
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f "$temp_file"
|
rm -f "$temp_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to connect to a WiFi network
|
|
||||||
connect_network() {
|
connect_network() {
|
||||||
prompt_for_network "connect" "Enter the number of the network to connect: " "Connected to the network successfully." "Failed to connect to the network."
|
prompt_for_network "connect" "Enter the number of the network to connect: " "Connected to the network successfully." "Failed to connect to the network."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to disconnect from a WiFi network
|
|
||||||
disconnect_network() {
|
disconnect_network() {
|
||||||
prompt_for_network "disconnect" "Enter the number of the network to disconnect: " "Disconnected from the network successfully." "Failed to disconnect from the network."
|
prompt_for_network "disconnect" "Enter the number of the network to disconnect: " "Disconnected from the network successfully." "Failed to disconnect from the network."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove a WiFi connection
|
|
||||||
remove_network() {
|
remove_network() {
|
||||||
prompt_for_network "remove" "Enter the number of the network to remove: " "Network removed successfully." "Failed to remove the network."
|
prompt_for_network "remove" "Enter the number of the network to remove: " "Network removed successfully." "Failed to remove the network."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
setupNetworkManager
|
setupNetworkManager
|
||||||
main_menu
|
main_menu
|
||||||
|
|
72
start.sh
72
start.sh
|
@ -2,50 +2,50 @@
|
||||||
|
|
||||||
# Prevent execution if this script was only partially downloaded
|
# Prevent execution if this script was only partially downloaded
|
||||||
{
|
{
|
||||||
rc='\033[0m'
|
rc='\033[0m'
|
||||||
red='\033[0;31m'
|
red='\033[0;31m'
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
exit_code=$1
|
exit_code=$1
|
||||||
message=$2
|
message=$2
|
||||||
|
|
||||||
if [ "$exit_code" -ne 0 ]; then
|
if [ "$exit_code" -ne 0 ]; then
|
||||||
printf '%sERROR: %s%s\n' "$red" "$message" "$rc"
|
printf '%sERROR: %s%s\n' "$red" "$message" "$rc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset exit_code
|
unset exit_code
|
||||||
unset message
|
unset message
|
||||||
}
|
}
|
||||||
|
|
||||||
findArch() {
|
findArch() {
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
x86_64|amd64) arch="x86_64" ;;
|
x86_64 | amd64) arch="x86_64" ;;
|
||||||
aarch64|arm64) arch="aarch64" ;;
|
aarch64 | arm64) arch="aarch64" ;;
|
||||||
*) check 1 "Unsupported architecture"
|
*) check 1 "Unsupported architecture" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
getUrl() {
|
getUrl() {
|
||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
x86_64) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil";;
|
x86_64) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil" ;;
|
||||||
*) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil-${arch}";;
|
*) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil-${arch}" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
findArch
|
findArch
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
check $? "Creating the temporary file"
|
check $? "Creating the temporary file"
|
||||||
|
|
||||||
curl -fsL "$(getUrl)" -o "$temp_file"
|
curl -fsL "$(getUrl)" -o "$temp_file"
|
||||||
check $? "Downloading linutil"
|
check $? "Downloading linutil"
|
||||||
|
|
||||||
chmod +x "$temp_file"
|
chmod +x "$temp_file"
|
||||||
check $? "Making linutil executable"
|
check $? "Making linutil executable"
|
||||||
|
|
||||||
"$temp_file"
|
"$temp_file"
|
||||||
check $? "Executing linutil"
|
check $? "Executing linutil"
|
||||||
|
|
||||||
rm -f "$temp_file"
|
rm -f "$temp_file"
|
||||||
check $? "Deleting the temporary file"
|
check $? "Deleting the temporary file"
|
||||||
} # End of wrapping
|
} # End of wrapping
|
||||||
|
|
120
startdev.sh
120
startdev.sh
|
@ -2,76 +2,76 @@
|
||||||
|
|
||||||
# Prevent execution if this script was only partially downloaded
|
# Prevent execution if this script was only partially downloaded
|
||||||
{
|
{
|
||||||
RC='\033[0m'
|
RC='\033[0m'
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
|
|
||||||
# Function to fetch the latest release tag from the GitHub API
|
# Function to fetch the latest release tag from the GitHub API
|
||||||
get_latest_release() {
|
get_latest_release() {
|
||||||
latest_release=$(curl -s https://api.github.com/repos/ChrisTitusTech/linutil/releases |
|
latest_release=$(curl -s https://api.github.com/repos/ChrisTitusTech/linutil/releases |
|
||||||
grep -oP '"tag_name": "\K[^"]*' |
|
grep -oP '"tag_name": "\K[^"]*' |
|
||||||
head -n 1)
|
head -n 1)
|
||||||
if [ -z "$latest_release" ]; then
|
if [ -z "$latest_release" ]; then
|
||||||
printf "%b\n" "Error fetching release data" >&2
|
printf "%b\n" "Error fetching release data" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
printf "%b\n" "$latest_release"
|
printf "%b\n" "$latest_release"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to redirect to the latest pre-release version
|
# Function to redirect to the latest pre-release version
|
||||||
redirect_to_latest_pre_release() {
|
redirect_to_latest_pre_release() {
|
||||||
latest_release=$(get_latest_release)
|
latest_release=$(get_latest_release)
|
||||||
if [ -n "$latest_release" ]; then
|
if [ -n "$latest_release" ]; then
|
||||||
url="https://github.com/ChrisTitusTech/linutil/releases/download/$latest_release/linutil"
|
url="https://github.com/ChrisTitusTech/linutil/releases/download/$latest_release/linutil"
|
||||||
else
|
else
|
||||||
printf "%b\n" 'Unable to determine latest pre-release version.' >&2
|
printf "%b\n" 'Unable to determine latest pre-release version.' >&2
|
||||||
printf "%b\n" "Using latest Full Release"
|
printf "%b\n" "Using latest Full Release"
|
||||||
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
||||||
fi
|
fi
|
||||||
addArch
|
addArch
|
||||||
printf "%b\n" "Using URL: $url"
|
printf "%b\n" "Using URL: $url"
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
exit_code=$1
|
exit_code=$1
|
||||||
message=$2
|
message=$2
|
||||||
|
|
||||||
if [ "$exit_code" -ne 0 ]; then
|
if [ "$exit_code" -ne 0 ]; then
|
||||||
printf "%b\n" "${RED}ERROR: $message${RC}"
|
printf "%b\n" "${RED}ERROR: $message${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
addArch() {
|
addArch() {
|
||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
x86_64);;
|
x86_64) ;;
|
||||||
*) url="${url}-${arch}";;
|
*) url="${url}-${arch}" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
findArch() {
|
findArch() {
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
x86_64|amd64) arch="x86_64" ;;
|
x86_64 | amd64) arch="x86_64" ;;
|
||||||
aarch64|arm64) arch="aarch64" ;;
|
aarch64 | arm64) arch="aarch64" ;;
|
||||||
*) check 1 "Unsupported architecture"
|
*) check 1 "Unsupported architecture" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
findArch
|
findArch
|
||||||
redirect_to_latest_pre_release
|
redirect_to_latest_pre_release
|
||||||
|
|
||||||
TMPFILE=$(mktemp)
|
TMPFILE=$(mktemp)
|
||||||
check $? "Creating the temporary file"
|
check $? "Creating the temporary file"
|
||||||
|
|
||||||
printf "%b\n" "Downloading linutil from $url"
|
printf "%b\n" "Downloading linutil from $url"
|
||||||
curl -fsL "$url" -o "$TMPFILE"
|
curl -fsL "$url" -o "$TMPFILE"
|
||||||
check $? "Downloading linutil"
|
check $? "Downloading linutil"
|
||||||
|
|
||||||
chmod +x "$TMPFILE"
|
chmod +x "$TMPFILE"
|
||||||
check $? "Making linutil executable"
|
check $? "Making linutil executable"
|
||||||
|
|
||||||
"$TMPFILE"
|
"$TMPFILE"
|
||||||
check $? "Executing linutil"
|
check $? "Executing linutil"
|
||||||
|
|
||||||
rm -f "$TMPFILE"
|
rm -f "$TMPFILE"
|
||||||
check $? "Deleting the temporary file"
|
check $? "Deleting the temporary file"
|
||||||
} # End of wrapping
|
} # End of wrapping
|
||||||
|
|
Loading…
Reference in New Issue
Block a user