mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
Merge e8ceb48734
into 696110eae5
This commit is contained in:
commit
1233e9a4ab
21
Cargo.lock
generated
21
Cargo.lock
generated
|
@ -178,6 +178,12 @@ version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg_aliases"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.38"
|
version = "0.4.38"
|
||||||
|
@ -506,6 +512,7 @@ dependencies = [
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"ego-tree",
|
"ego-tree",
|
||||||
"linutil_core",
|
"linutil_core",
|
||||||
|
"nix 0.29.0",
|
||||||
"oneshot",
|
"oneshot",
|
||||||
"portable-pty",
|
"portable-pty",
|
||||||
"rand",
|
"rand",
|
||||||
|
@ -597,6 +604,18 @@ dependencies = [
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nix"
|
||||||
|
version = "0.29.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.6.0",
|
||||||
|
"cfg-if",
|
||||||
|
"cfg_aliases",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.3"
|
version = "7.1.3"
|
||||||
|
@ -676,7 +695,7 @@ dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"nix",
|
"nix 0.25.1",
|
||||||
"serial",
|
"serial",
|
||||||
"shared_library",
|
"shared_library",
|
||||||
"shell-words",
|
"shell-words",
|
||||||
|
|
|
@ -7,24 +7,24 @@ installGithubDesktop() {
|
||||||
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 | elevated_execution tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
|
||||||
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main\n' | "$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' | elevated_execution tee /etc/apt/sources.list.d/shiftkey-packages.list > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
|
elevated_execution "$PACKAGER" install -y github-desktop
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
elevated_execution rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
||||||
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | "$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' | elevated_execution tee /etc/zypp/repos.d/shiftkey-packages.repo > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install github-desktop
|
elevated_execution "$PACKAGER" --non-interactive install github-desktop
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm github-desktop-bin
|
"$AUR_HELPER" -S --needed --noconfirm github-desktop-bin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
elevated_execution rpm --import https://rpm.packages.shiftkey.dev/gpg.key
|
||||||
printf "%b\n" '[shiftkey-packages]\nname=GitHub Desktop\nbaseurl=https://rpm.packages.shiftkey.dev/rpm/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://rpm.packages.shiftkey.dev/gpg.key\n' | "$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' | elevated_execution tee /etc/yum.repos.d/shiftkey-packages.repo > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y github-desktop
|
elevated_execution "$PACKAGER" install -y github-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,10 +7,10 @@ installMeld() {
|
||||||
printf "%b\n" "${YELLOW}Installing Meld...${RC}"
|
printf "%b\n" "${YELLOW}Installing Meld...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm meld
|
elevated_execution "$PACKAGER" -S --needed --noconfirm meld
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
elevated_execution "$PACKAGER" -y install meld
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
. ../setup-flatpak.sh
|
. ../setup-flatpak.sh
|
||||||
|
|
|
@ -18,16 +18,16 @@ installNeovim() {
|
||||||
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
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y ripgrep fd-find python3-venv luarocks golang-go shellcheck git
|
||||||
curl -sSLo /tmp/nvim.appimage https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
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
|
elevated_execution 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
|
elevated_execution "$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}"
|
||||||
|
|
|
@ -5,7 +5,13 @@
|
||||||
installNgrok() {
|
installNgrok() {
|
||||||
if ! command_exists ngrok; then
|
if ! command_exists ngrok; then
|
||||||
printf "%b\n" "${YELLOW}Installing Ngrok...${RC}"
|
printf "%b\n" "${YELLOW}Installing Ngrok...${RC}"
|
||||||
curl -sSLO https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz | "$ESCALATION_TOOL" tar -xz -C /usr/local/bin
|
curl -sSLO https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
|
||||||
|
if [ -f "ngrok-v3-stable-linux-amd64.tgz" ]; then
|
||||||
|
elevated_execution tar -xz -f ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin
|
||||||
|
else
|
||||||
|
printf "%b\n" "${RED}Error occurred when downloading.${RC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Ngrok is already installed.${RC}"
|
printf "%b\n" "${GREEN}Ngrok is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -13,4 +19,4 @@ installNgrok() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
installNgrok
|
installNgrok
|
||||||
|
|
|
@ -7,24 +7,24 @@ installSublime() {
|
||||||
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 | elevated_execution 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/" | elevated_execution tee /etc/apt/sources.list.d/sublime-text.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
|
elevated_execution "$PACKAGER" install -y sublime-text
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
|
elevated_execution rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo
|
elevated_execution "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install sublime-text
|
elevated_execution "$PACKAGER" --non-interactive install sublime-text
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm sublime-text-4
|
"$AUR_HELPER" -S --needed --noconfirm sublime-text-4
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
|
elevated_execution rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
|
elevated_execution "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
|
elevated_execution "$PACKAGER" install -y sublime-text
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -8,25 +8,25 @@ installVsCode() {
|
||||||
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
|
elevated_execution install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
|
||||||
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | "$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" | elevated_execution tee /etc/apt/sources.list.d/vscode.list > /dev/null
|
||||||
rm -f packages.microsoft.gpg
|
rm -f packages.microsoft.gpg
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y apt-transport-https code
|
elevated_execution "$PACKAGER" install -y apt-transport-https code
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
elevated_execution rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||||
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$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' | elevated_execution tee /etc/zypp/repos.d/vscode.repo > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install code
|
elevated_execution "$PACKAGER" --non-interactive install code
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm visual-studio-code-bin
|
"$AUR_HELPER" -S --needed --noconfirm visual-studio-code-bin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
elevated_execution rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||||
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$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' | elevated_execution tee /etc/yum.repos.d/vscode.repo > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y code
|
elevated_execution "$PACKAGER" install -y code
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,24 +7,24 @@ installVsCodium() {
|
||||||
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 | elevated_execution dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
|
||||||
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | "$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' | elevated_execution tee /etc/apt/sources.list.d/vscodium.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
|
elevated_execution "$PACKAGER" install -y codium
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
|
elevated_execution rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
|
||||||
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/zypp/repos.d/vscodium.repo
|
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | elevated_execution tee -a /etc/zypp/repos.d/vscodium.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install codium
|
elevated_execution "$PACKAGER" --non-interactive install codium
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --noconfirm vscodium-bin
|
"$AUR_HELPER" -S --noconfirm vscodium-bin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
|
elevated_execution rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
|
||||||
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
|
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | elevated_execution tee -a /etc/yum.repos.d/vscodium.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
|
elevated_execution "$PACKAGER" install -y codium
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,10 +7,10 @@ installAlacritty() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm alacritty
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
elevated_execution "$PACKAGER" install -y alacritty
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,13 +7,13 @@ install_adb() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y android-sdk-platform-tools
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm android-tools
|
elevated_execution "$PACKAGER" -S --noconfirm android-tools
|
||||||
;;
|
;;
|
||||||
dnf|zypper)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
elevated_execution "$PACKAGER" install -y android-tools
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
|
@ -29,8 +29,8 @@ install_universal_android_debloater() {
|
||||||
if ! command_exists uad; then
|
if ! command_exists uad; then
|
||||||
printf "%b\n" "${YELLOW}Installing Universal Android Debloater...${RC}."
|
printf "%b\n" "${YELLOW}Installing Universal Android Debloater...${RC}."
|
||||||
curl -sSLo "${HOME}/uad" "https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/releases/download/v1.1.0/uad-ng-linux"
|
curl -sSLo "${HOME}/uad" "https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/releases/download/v1.1.0/uad-ng-linux"
|
||||||
"$ESCALATION_TOOL" chmod +x "${HOME}/uad"
|
elevated_execution chmod +x "${HOME}/uad"
|
||||||
"$ESCALATION_TOOL" mv "${HOME}/uad" /usr/local/bin/uad
|
elevated_execution mv "${HOME}/uad" /usr/local/bin/uad
|
||||||
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
|
||||||
|
|
|
@ -7,27 +7,27 @@ installBrave() {
|
||||||
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
|
elevated_execution "$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
|
elevated_execution 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" | elevated_execution tee /etc/apt/sources.list.d/brave-browser-release.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
|
elevated_execution "$PACKAGER" install -y brave-browser
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
elevated_execution "$PACKAGER" install -y curl
|
||||||
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
elevated_execution rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
elevated_execution "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser
|
elevated_execution "$PACKAGER" --non-interactive install brave-browser
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm brave-bin
|
"$AUR_HELPER" -S --needed --noconfirm brave-bin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core
|
elevated_execution "$PACKAGER" install -y dnf-plugins-core
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
elevated_execution "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
||||||
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
elevated_execution rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
|
elevated_execution "$PACKAGER" install -y brave-browser
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,10 +7,10 @@ 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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm chromium
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
elevated_execution "$PACKAGER" install -y chromium
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,16 +7,16 @@ installFirefox() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y firefox-esr
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox
|
elevated_execution "$PACKAGER" --non-interactive install MozillaFirefox
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm firefox
|
elevated_execution "$PACKAGER" -S --needed --noconfirm firefox
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
|
elevated_execution "$PACKAGER" install -y firefox
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -8,20 +8,20 @@ installChrome() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome
|
elevated_execution "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install google-chrome-stable
|
elevated_execution "$PACKAGER" --non-interactive install google-chrome-stable
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm google-chrome
|
"$AUR_HELPER" -S --needed --noconfirm google-chrome
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories
|
elevated_execution "$PACKAGER" install -y fedora-workstation-repositories
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome
|
elevated_execution "$PACKAGER" config-manager --set-enabled google-chrome
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable
|
elevated_execution "$PACKAGER" install -y google-chrome-stable
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,27 +7,27 @@ installLibreWolf() {
|
||||||
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
|
elevated_execution "$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 | elevated_execution 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" | elevated_execution tee /etc/apt/sources.list.d/librewolf.sources > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y librewolf
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y librewolf
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" rpm --import https://rpm.librewolf.net/pubkey.gpg
|
elevated_execution rpm --import https://rpm.librewolf.net/pubkey.gpg
|
||||||
"$ESCALATION_TOOL" zypper ar -ef https://rpm.librewolf.net librewolf
|
elevated_execution zypper ar -ef https://rpm.librewolf.net librewolf
|
||||||
"$ESCALATION_TOOL" zypper refresh
|
elevated_execution zypper refresh
|
||||||
"$ESCALATION_TOOL" zypper --non-interactive install librewolf
|
elevated_execution zypper --non-interactive install librewolf
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin
|
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin
|
||||||
|
|
|
@ -7,10 +7,10 @@ installLynx() {
|
||||||
printf "%b\n" "${YELLOW}Installing Lynx...${RC}"
|
printf "%b\n" "${YELLOW}Installing Lynx...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
|
elevated_execution "$PACKAGER" -S --needed --noconfirm lynx
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
|
elevated_execution "$PACKAGER" install -y lynx
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,15 +7,15 @@ installThrorium() {
|
||||||
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
|
elevated_execution 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
|
elevated_execution curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin
|
"$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin
|
||||||
|
|
|
@ -7,10 +7,10 @@ installLynx() {
|
||||||
printf "%b\n" "${YELLOW}Installing Lynx...${RC}"
|
printf "%b\n" "${YELLOW}Installing Lynx...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
|
elevated_execution "$PACKAGER" -S --needed --noconfirm lynx
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
|
elevated_execution "$PACKAGER" install -y lynx
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -8,17 +8,17 @@ installDiscord() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y discord.deb
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install discord
|
elevated_execution "$PACKAGER" --non-interactive install discord
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm discord
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y discord
|
elevated_execution "$PACKAGER" install -y discord
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,19 +7,19 @@ installJitsi() {
|
||||||
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 | elevated_execution 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/' | elevated_execution tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install jitsi-meet
|
elevated_execution "$PACKAGER" -y install jitsi-meet
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install jitsi
|
elevated_execution "$PACKAGER" --non-interactive install jitsi
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm jitsi-meet-bin
|
"$AUR_HELPER" -S --needed --noconfirm jitsi-meet-bin
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet
|
elevated_execution "$PACKAGER" install -y jitsi-meet
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -8,20 +8,20 @@ installSignal() {
|
||||||
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 > signal-desktop-keyring.gpg
|
||||||
cat signal-desktop-keyring.gpg | "$ESCALATION_TOOL" tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
|
cat signal-desktop-keyring.gpg | elevated_execution 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' | elevated_execution tee /etc/apt/sources.list.d/signal-xenial.list
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install signal-desktop
|
elevated_execution "$PACKAGER" -y install signal-desktop
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install signal-desktop
|
elevated_execution "$PACKAGER" --non-interactive install signal-desktop
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm signal-desktop
|
elevated_execution "$PACKAGER" -S --noconfirm signal-desktop
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop
|
elevated_execution "$PACKAGER" copr enable luminoso/Signal-Desktop
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop
|
elevated_execution "$PACKAGER" install -y signal-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
elevated_execution "$PACKAGER" install -y telegram-desktop
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,10 +7,10 @@ installThunderBird() {
|
||||||
printf "%b\n" "${YELLOW}Installing Thunderbird...${RC}"
|
printf "%b\n" "${YELLOW}Installing Thunderbird...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
elevated_execution "$PACKAGER" -S --needed --noconfirm thunderbird
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
elevated_execution "$PACKAGER" install -y thunderbird
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -27,14 +27,14 @@ install_docker() {
|
||||||
curl -fsSL https://get.docker.com | sh
|
curl -fsSL https://get.docker.com | sh
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
|
elevated_execution "$PACKAGER" --non-interactive install docker
|
||||||
"$ESCALATION_TOOL" systemctl enable docker
|
elevated_execution systemctl enable docker
|
||||||
"$ESCALATION_TOOL" systemctl start docker
|
elevated_execution systemctl start docker
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker
|
elevated_execution "$PACKAGER" -S --noconfirm docker
|
||||||
"$ESCALATION_TOOL" systemctl enable docker
|
elevated_execution systemctl enable docker
|
||||||
"$ESCALATION_TOOL" systemctl start docker
|
elevated_execution systemctl start docker
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
@ -47,13 +47,13 @@ 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
|
elevated_execution "$PACKAGER" install -y docker-compose-plugin
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose
|
elevated_execution "$PACKAGER" --non-interactive install docker-compose
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
elevated_execution "$PACKAGER" -S --needed --noconfirm docker-compose
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -6,14 +6,14 @@ setupDWM() {
|
||||||
printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}"
|
printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}"
|
||||||
case "$PACKAGER" in # Install pre-Requisites
|
case "$PACKAGER" in # Install pre-Requisites
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit
|
elevated_execution "$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
|
elevated_execution "$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)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" groupinstall -y "Development Tools"
|
elevated_execution "$PACKAGER" groupinstall -y "Development Tools"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh mate-polkit # no need to include git here as it should be already installed via "Development Tools"
|
elevated_execution "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh mate-polkit # no need to include git here as it should be already installed via "Development Tools"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
@ -26,7 +26,7 @@ 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
|
elevated_execution make clean install # Run make clean install
|
||||||
}
|
}
|
||||||
|
|
||||||
install_nerd_font() {
|
install_nerd_font() {
|
||||||
|
@ -119,7 +119,7 @@ picom_animations() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install the built binary
|
# Install the built binary
|
||||||
if ! "$ESCALATION_TOOL" ninja -C build install; then
|
if ! elevated_execution ninja -C build install; then
|
||||||
printf "%b\n" "${RED}Failed to install the built binary${RC}"
|
printf "%b\n" "${RED}Failed to install the built binary${RC}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -183,13 +183,13 @@ setupDisplayManager() {
|
||||||
printf "%b\n" "${YELLOW}Setting up Xorg${RC}"
|
printf "%b\n" "${YELLOW}Setting up Xorg${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm xorg-xinit xorg-server
|
elevated_execution "$PACKAGER" -S --needed --noconfirm xorg-xinit xorg-server
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg xinit
|
elevated_execution "$PACKAGER" install -y xorg xinit
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg
|
elevated_execution "$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}"
|
||||||
|
@ -217,13 +217,13 @@ setupDisplayManager() {
|
||||||
read -r DM
|
read -r DM
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"
|
elevated_execution "$PACKAGER" -S --needed --noconfirm "$DM"
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
elevated_execution "$PACKAGER" install -y "$DM"
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
|
elevated_execution "$PACKAGER" install -y "$DM"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
|
@ -242,7 +242,7 @@ install_slstatus() {
|
||||||
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 elevated_execution make clean install; then
|
||||||
printf "%b\n" "${GREEN}slstatus installed successfully${RC}"
|
printf "%b\n" "${GREEN}slstatus installed successfully${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Failed to install slstatus${RC}"
|
printf "%b\n" "${RED}Failed to install slstatus${RC}"
|
||||||
|
|
|
@ -7,15 +7,15 @@ installFastfetch() {
|
||||||
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
|
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y /tmp/fastfetch.deb
|
||||||
rm /tmp/fastfetch.deb
|
rm /tmp/fastfetch.deb
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
|
elevated_execution "$PACKAGER" install -y fastfetch
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -10,7 +10,7 @@ themeinstall(){
|
||||||
fi
|
fi
|
||||||
git clone "https://github.com/ChrisTitusTech/Top-5-Bootloader-Themes"
|
git clone "https://github.com/ChrisTitusTech/Top-5-Bootloader-Themes"
|
||||||
cd "Top-5-Bootloader-Themes"
|
cd "Top-5-Bootloader-Themes"
|
||||||
"$ESCALATION_TOOL" ./install.sh
|
elevated_execution ./install.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -7,10 +7,10 @@ installKitty() {
|
||||||
printf "%b\n" "${YELLOW}Installing Kitty...${RC}"
|
printf "%b\n" "${YELLOW}Installing Kitty...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty
|
elevated_execution "$PACKAGER" -S --needed --noconfirm kitty
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty
|
elevated_execution "$PACKAGER" install -y kitty
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -35,13 +35,13 @@ installLinutil() {
|
||||||
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 curl rustup man-db
|
elevated_execution "$PACKAGER" -S --needed --noconfirm curl rustup man-db
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
|
elevated_execution "$PACKAGER" install -y curl rustup man-pages man-db man
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
elevated_execution "$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
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -12,15 +12,15 @@ updateLinutil() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm rustup
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install -y rustup
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,10 +9,10 @@ installDepend() {
|
||||||
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
|
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
|
elevated_execution "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
|
elevated_execution "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -62,7 +62,7 @@ installStarshipAndFzf() {
|
||||||
printf "%b\n" "${GREEN}Fzf already installed${RC}"
|
printf "%b\n" "${GREEN}Fzf already installed${RC}"
|
||||||
else
|
else
|
||||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||||
"$ESCALATION_TOOL" ~/.fzf/install
|
elevated_execution ~/.fzf/install
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,19 +8,19 @@ installFreeOffice() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y ./softmaker-freeoffice-2024_1218-01_amd64.deb
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker
|
elevated_execution "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys refresh
|
elevated_execution "$PACKAGER" --gpg-auto-import-keys refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024
|
elevated_execution "$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
|
elevated_execution curl -O -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024
|
elevated_execution "$PACKAGER" install -y softmaker-freeoffice-2024
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -7,14 +7,14 @@ installLibreOffice() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y libreoffice-core
|
||||||
;;
|
;;
|
||||||
zypper|dnf)
|
zypper|dnf)
|
||||||
. ./setup-flatpak.sh
|
. ./setup-flatpak.sh
|
||||||
flatpak install -y flathub org.libreoffice.LibreOffice
|
flatpak install -y flathub org.libreoffice.LibreOffice
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
elevated_execution "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -8,7 +8,7 @@ installOnlyOffice() {
|
||||||
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
|
elevated_execution "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb
|
||||||
;;
|
;;
|
||||||
zypper|dnf)
|
zypper|dnf)
|
||||||
. ./setup-flatpak.sh
|
. ./setup-flatpak.sh
|
||||||
|
|
|
@ -7,10 +7,10 @@ installEvince() {
|
||||||
printf "%b\n" "${YELLOW}Installing Evince...${RC}"
|
printf "%b\n" "${YELLOW}Installing Evince...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince
|
elevated_execution "$PACKAGER" -S --needed --noconfirm evince
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y evince
|
elevated_execution "$PACKAGER" install -y evince
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,10 +7,10 @@ installOkular() {
|
||||||
printf "%b\n" "${YELLOW}Installing Okular...${RC}"
|
printf "%b\n" "${YELLOW}Installing Okular...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular
|
elevated_execution "$PACKAGER" -S --needed --noconfirm okular
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y okular
|
elevated_execution "$PACKAGER" install -y okular
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,7 +6,7 @@ installPdfstudio() {
|
||||||
if ! command_exists pdfstudio2024; then
|
if ! command_exists pdfstudio2024; then
|
||||||
printf "%b\n" "${YELLOW}Installing PDF Studio...${RC}"
|
printf "%b\n" "${YELLOW}Installing PDF Studio...${RC}"
|
||||||
curl -O https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh
|
curl -O https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh
|
||||||
"$ESCALATION_TOOL" chmod +x PDFStudio_linux64.sh
|
elevated_execution chmod +x PDFStudio_linux64.sh
|
||||||
if sh PDFStudio_linux64.sh; then
|
if sh PDFStudio_linux64.sh; then
|
||||||
printf "%b\n" "${GREEN}PDF Studio installed successfully!${RC}"
|
printf "%b\n" "${GREEN}PDF Studio installed successfully!${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,7 +6,7 @@ installPdfstudioviewer() {
|
||||||
if ! command_exists pdfstudioviewer2024; then
|
if ! command_exists pdfstudioviewer2024; then
|
||||||
printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}"
|
printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}"
|
||||||
curl -O https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.sh
|
curl -O https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.sh
|
||||||
"$ESCALATION_TOOL" chmod +x PDFStudioViewer_linux64.sh
|
elevated_execution chmod +x PDFStudioViewer_linux64.sh
|
||||||
if sh PDFStudioViewer_linux64.sh; then
|
if sh PDFStudioViewer_linux64.sh; then
|
||||||
printf "%b\n" "${GREEN}PDF Studio Viewer installed successfully!${RC}"
|
printf "%b\n" "${GREEN}PDF Studio Viewer installed successfully!${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,10 +7,10 @@ installRofi() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm rofi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi
|
elevated_execution "$PACKAGER" install -y rofi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -23,14 +23,14 @@ setup_flatpak() {
|
||||||
printf "%b\n" "${YELLOW}Installing Flatpak...${RC}"
|
printf "%b\n" "${YELLOW}Installing Flatpak...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
|
elevated_execution "$PACKAGER" -S --needed --noconfirm flatpak
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
|
elevated_execution "$PACKAGER" install -y flatpak
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
printf "%b\n" "Adding Flathub remote..."
|
printf "%b\n" "Adding Flathub remote..."
|
||||||
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
elevated_execution flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
else
|
else
|
||||||
if command_exists flatpak; then
|
if command_exists flatpak; then
|
||||||
if ! flatpak remotes | grep -q "flathub"; then
|
if ! flatpak remotes | grep -q "flathub"; then
|
||||||
|
@ -39,7 +39,7 @@ setup_flatpak() {
|
||||||
case "$add_remote" in
|
case "$add_remote" in
|
||||||
[Yy]*)
|
[Yy]*)
|
||||||
printf "%b\n" "Adding Flathub remote..."
|
printf "%b\n" "Adding Flathub remote..."
|
||||||
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
elevated_execution flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -57,14 +57,14 @@ setup_flatpak() {
|
||||||
printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}"
|
printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}"
|
||||||
read -r install_gnome
|
read -r install_gnome
|
||||||
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
|
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y gnome-software-plugin-flatpak
|
elevated_execution "$PACKAGER" install -y gnome-software-plugin-flatpak
|
||||||
fi
|
fi
|
||||||
# Useful for Debian KDE spin as well
|
# Useful for Debian KDE spin as well
|
||||||
elif [ "$DE" = "KDE" ]; then
|
elif [ "$DE" = "KDE" ]; then
|
||||||
printf "%b" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/N): ${RC}"
|
printf "%b" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/N): ${RC}"
|
||||||
read -r install_kde
|
read -r install_kde
|
||||||
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
|
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y plasma-discover-backend-flatpak
|
elevated_execution "$PACKAGER" install -y plasma-discover-backend-flatpak
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,38 +17,38 @@ installWaydroid() {
|
||||||
"$AUR_HELPER" -S --needed --noconfirm waydroid
|
"$AUR_HELPER" -S --needed --noconfirm waydroid
|
||||||
if command_exists dkms; then
|
if command_exists dkms; then
|
||||||
"$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
|
elevated_execution modprobe binder-linux device=binder,hwbinder,vndbinder
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
curl https://repo.waydro.id | "$ESCALATION_TOOL" sh
|
curl https://repo.waydro.id | elevated_execution sh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y waydroid
|
elevated_execution "$PACKAGER" install -y waydroid
|
||||||
if command_exists dkms; then
|
if command_exists dkms; then
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
elevated_execution "$PACKAGER" install -y git
|
||||||
mkdir -p "$HOME/.local/share/" # only create it if it doesnt exist
|
mkdir -p "$HOME/.local/share/" # only create it if it doesnt exist
|
||||||
git clone https://github.com/choff/anbox-modules.git "$HOME/.local/share/anbox-modules"
|
git clone https://github.com/choff/anbox-modules.git "$HOME/.local/share/anbox-modules"
|
||||||
cd "$HOME/.local/share/anbox-modules"
|
cd "$HOME/.local/share/anbox-modules"
|
||||||
"$ESCALATION_TOOL" cp anbox.conf /etc/modules-load.d/
|
elevated_execution cp anbox.conf /etc/modules-load.d/
|
||||||
"$ESCALATION_TOOL" cp 99-anbox.rules /lib/udev/rules.d/
|
elevated_execution cp 99-anbox.rules /lib/udev/rules.d/
|
||||||
"$ESCALATION_TOOL" cp -rT ashmem /usr/src/anbox-ashmem-1
|
elevated_execution cp -rT ashmem /usr/src/anbox-ashmem-1
|
||||||
"$ESCALATION_TOOL" cp -rT binder /usr/src/anbox-binder-1
|
elevated_execution cp -rT binder /usr/src/anbox-binder-1
|
||||||
"$ESCALATION_TOOL" dkms install anbox-ashmem/1
|
elevated_execution dkms install anbox-ashmem/1
|
||||||
"$ESCALATION_TOOL" dkms install anbox-binder/1
|
elevated_execution dkms install anbox-binder/1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y waydroid
|
elevated_execution "$PACKAGER" install -y waydroid
|
||||||
if command_exists dkms; then
|
if command_exists dkms; then
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
elevated_execution "$PACKAGER" install -y git
|
||||||
mkdir -p "$HOME/.local/share/" # only create it if it doesnt exist
|
mkdir -p "$HOME/.local/share/" # only create it if it doesnt exist
|
||||||
git clone https://github.com/choff/anbox-modules.git "$HOME/.local/share/anbox-modules"
|
git clone https://github.com/choff/anbox-modules.git "$HOME/.local/share/anbox-modules"
|
||||||
cd "$HOME/.local/share/anbox-modules"
|
cd "$HOME/.local/share/anbox-modules"
|
||||||
"$ESCALATION_TOOL" cp anbox.conf /etc/modules-load.d/
|
elevated_execution cp anbox.conf /etc/modules-load.d/
|
||||||
"$ESCALATION_TOOL" cp 99-anbox.rules /lib/udev/rules.d/
|
elevated_execution cp 99-anbox.rules /lib/udev/rules.d/
|
||||||
"$ESCALATION_TOOL" cp -rT ashmem /usr/src/anbox-ashmem-1
|
elevated_execution cp -rT ashmem /usr/src/anbox-ashmem-1
|
||||||
"$ESCALATION_TOOL" cp -rT binder /usr/src/anbox-binder-1
|
elevated_execution cp -rT binder /usr/src/anbox-binder-1
|
||||||
"$ESCALATION_TOOL" dkms install anbox-ashmem/1
|
elevated_execution dkms install anbox-ashmem/1
|
||||||
"$ESCALATION_TOOL" dkms install anbox-binder/1
|
elevated_execution dkms install anbox-binder/1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -63,8 +63,8 @@ installWaydroid() {
|
||||||
|
|
||||||
setupWaydroid() {
|
setupWaydroid() {
|
||||||
printf "%b\n" "${YELLOW}Setting up Waydroid...${RC}"
|
printf "%b\n" "${YELLOW}Setting up Waydroid...${RC}"
|
||||||
"$ESCALATION_TOOL" systemctl enable --now waydroid-container
|
elevated_execution systemctl enable --now waydroid-container
|
||||||
"$ESCALATION_TOOL" waydroid init
|
elevated_execution waydroid init
|
||||||
printf "%b\n" "${GREEN}Waydroid setup complete.${RC}"
|
printf "%b\n" "${GREEN}Waydroid setup complete.${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ installZsh() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm zsh
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
elevated_execution "$PACKAGER" install -y zsh
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -44,8 +44,8 @@ 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 ] && elevated_execution mkdir -p /etc/zsh && elevated_execution touch /etc/zsh/zshenv
|
||||||
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
|
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | elevated_execution tee -a /etc/zsh/zshenv
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -12,6 +12,14 @@ command_exists() {
|
||||||
command -v "$1" >/dev/null 2>&1
|
command -v "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elevated_execution() {
|
||||||
|
if [ -z "$ESCALATION_TOOL" ]; then
|
||||||
|
"$@"
|
||||||
|
else
|
||||||
|
"$ESCALATION_TOOL" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
checkAURHelper() {
|
checkAURHelper() {
|
||||||
## Check & Install AUR helper
|
## Check & Install AUR helper
|
||||||
if [ "$PACKAGER" = "pacman" ]; then
|
if [ "$PACKAGER" = "pacman" ]; then
|
||||||
|
@ -43,7 +51,12 @@ checkAURHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEscalationTool() {
|
checkEscalationTool() {
|
||||||
## Check for escalation tools.
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
printf "%b\n" "${CYAN}Running as root. Skipping escalation tool check.${RC}"
|
||||||
|
ESCALATION_TOOL_CHECKED=true
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$ESCALATION_TOOL_CHECKED" ]; then
|
if [ -z "$ESCALATION_TOOL_CHECKED" ]; then
|
||||||
ESCALATION_TOOLS='sudo doas'
|
ESCALATION_TOOLS='sudo doas'
|
||||||
for tool in ${ESCALATION_TOOLS}; do
|
for tool in ${ESCALATION_TOOLS}; do
|
||||||
|
|
|
@ -7,10 +7,10 @@ installPkg() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm ufw
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw
|
elevated_execution "$PACKAGER" install -y ufw
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -22,24 +22,24 @@ configureUFW() {
|
||||||
printf "%b\n" "${YELLOW}Using Chris Titus Recommended Firewall Rules${RC}"
|
printf "%b\n" "${YELLOW}Using Chris Titus Recommended Firewall Rules${RC}"
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Disabling UFW${RC}"
|
printf "%b\n" "${YELLOW}Disabling UFW${RC}"
|
||||||
"$ESCALATION_TOOL" ufw disable
|
elevated_execution ufw disable
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Limiting port 22/tcp (UFW)${RC}"
|
printf "%b\n" "${YELLOW}Limiting port 22/tcp (UFW)${RC}"
|
||||||
"$ESCALATION_TOOL" ufw limit 22/tcp
|
elevated_execution ufw limit 22/tcp
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Allowing port 80/tcp (UFW)${RC}"
|
printf "%b\n" "${YELLOW}Allowing port 80/tcp (UFW)${RC}"
|
||||||
"$ESCALATION_TOOL" ufw allow 80/tcp
|
elevated_execution ufw allow 80/tcp
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Allowing port 443/tcp (UFW)${RC}"
|
printf "%b\n" "${YELLOW}Allowing port 443/tcp (UFW)${RC}"
|
||||||
"$ESCALATION_TOOL" ufw allow 443/tcp
|
elevated_execution ufw allow 443/tcp
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Denying Incoming Packets by Default(UFW)${RC}"
|
printf "%b\n" "${YELLOW}Denying Incoming Packets by Default(UFW)${RC}"
|
||||||
"$ESCALATION_TOOL" ufw default deny incoming
|
elevated_execution ufw default deny incoming
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Allowing Outcoming Packets by Default(UFW)${RC}"
|
printf "%b\n" "${YELLOW}Allowing Outcoming Packets by Default(UFW)${RC}"
|
||||||
"$ESCALATION_TOOL" ufw default allow outgoing
|
elevated_execution ufw default allow outgoing
|
||||||
|
|
||||||
"$ESCALATION_TOOL" ufw enable
|
elevated_execution ufw enable
|
||||||
printf "%b\n" "${GREEN}Enabled Firewall with Baselines!${RC}"
|
printf "%b\n" "${GREEN}Enabled Firewall with Baselines!${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ installDepend() {
|
||||||
pacman)
|
pacman)
|
||||||
if ! command_exists paru; then
|
if ! command_exists paru; then
|
||||||
printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}"
|
printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git
|
elevated_execution "$PACKAGER" -S --needed --noconfirm base-devel git
|
||||||
cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru
|
cd /opt && elevated_execution git clone https://aur.archlinux.org/paru.git && elevated_execution chown -R "$USER": ./paru
|
||||||
cd paru && makepkg --noconfirm -si
|
cd paru && makepkg --noconfirm -si
|
||||||
printf "%b\n" "${GREEN}Paru installed${RC}"
|
printf "%b\n" "${GREEN}Paru installed${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,8 +7,8 @@ installDepend() {
|
||||||
pacman)
|
pacman)
|
||||||
if ! command_exists yay; then
|
if ! command_exists yay; then
|
||||||
printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}"
|
printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git
|
elevated_execution "$PACKAGER" -S --needed --noconfirm base-devel git
|
||||||
cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/yay-bin.git && "$ESCALATION_TOOL" chown -R "$USER": ./yay-bin
|
cd /opt && elevated_execution git clone https://aur.archlinux.org/yay-bin.git && elevated_execution chown -R "$USER": ./yay-bin
|
||||||
cd yay-bin && makepkg --noconfirm -si
|
cd yay-bin && makepkg --noconfirm -si
|
||||||
printf "%b\n" "${GREEN}Yay installed${RC}"
|
printf "%b\n" "${GREEN}Yay installed${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,9 +9,9 @@ installDepend() {
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
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]" | elevated_execution tee -a /etc/pacman.conf
|
||||||
echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
echo "Include = /etc/pacman.d/mirrorlist" | elevated_execution tee -a /etc/pacman.conf
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Syu
|
elevated_execution "$PACKAGER" -Syu
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
|
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -19,26 +19,26 @@ installDepend() {
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
COMPILEDEPS='build-essential'
|
COMPILEDEPS='build-essential'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" dpkg --add-architecture i386
|
elevated_execution dpkg --add-architecture i386
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
COMPILEDEPS='@development-tools'
|
COMPILEDEPS='@development-tools'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled powertools
|
elevated_execution "$PACKAGER" config-manager --set-enabled powertools
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y glibc-devel.i686 libgcc.i686
|
elevated_execution "$PACKAGER" install -y glibc-devel.i686 libgcc.i686
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
COMPILEDEPS='patterns-devel-base-devel_basis'
|
COMPILEDEPS='patterns-devel-base-devel_basis'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" refresh
|
elevated_execution "$PACKAGER" refresh
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
elevated_execution "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
elevated_execution "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@ 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
|
elevated_execution 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" | elevated_execution tee -a /etc/dnf/dnf.conf > /dev/null
|
||||||
echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
|
echo "defaultyes=True" | elevated_execution tee -a /etc/dnf/dnf.conf > /dev/null
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
|
elevated_execution "$PACKAGER" -y install dnf-plugins-core
|
||||||
printf "%b\n" "${GREEN}DNF Configured Successfully.${RC}"
|
printf "%b\n" "${GREEN}DNF Configured Successfully.${RC}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -7,9 +7,9 @@ multimedia() {
|
||||||
dnf)
|
dnf)
|
||||||
if [ -e /etc/yum.repos.d/rpmfusion-free.repo ] && [ -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
|
if [ -e /etc/yum.repos.d/rpmfusion-free.repo ] && [ -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
|
||||||
printf "%b\n" "${YELLOW}Installing Multimedia Codecs...${RC}"
|
printf "%b\n" "${YELLOW}Installing Multimedia Codecs...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" swap ffmpeg-free ffmpeg --allowerasing -y
|
elevated_execution "$PACKAGER" swap ffmpeg-free ffmpeg --allowerasing -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y
|
elevated_execution "$PACKAGER" update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update @sound-and-video -y
|
elevated_execution "$PACKAGER" update @sound-and-video -y
|
||||||
printf "%b\n" "${GREEN}Multimedia Codecs Installed...${RC}"
|
printf "%b\n" "${GREEN}Multimedia Codecs Installed...${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}RPM Fusion repositories not found. Please set up RPM Fusion first!${RC}"
|
printf "%b\n" "${RED}RPM Fusion repositories not found. Please set up RPM Fusion first!${RC}"
|
||||||
|
|
|
@ -18,10 +18,10 @@ checkRepo() {
|
||||||
printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}"
|
printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}"
|
||||||
|
|
||||||
# Enable the repository
|
# Enable the repository
|
||||||
"$ESCALATION_TOOL" dnf config-manager --set-enabled "$REPO_ID"
|
elevated_execution dnf config-manager --set-enabled "$REPO_ID"
|
||||||
|
|
||||||
# Refreshing repository list
|
# Refreshing repository list
|
||||||
"$ESCALATION_TOOL" dnf makecache
|
elevated_execution dnf makecache
|
||||||
|
|
||||||
# Verify if the repository is enabled
|
# 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
|
||||||
|
@ -49,7 +49,7 @@ installDriver() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE:: Installing graphics driver.
|
# NOTE:: Installing graphics driver.
|
||||||
"$ESCALATION_TOOL" dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
|
elevated_execution 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}"
|
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
|
for i in $(seq 1 5); do
|
||||||
|
|
|
@ -9,10 +9,10 @@ installRPMFusion() {
|
||||||
dnf)
|
dnf)
|
||||||
if [ ! -e /etc/yum.repos.d/rpmfusion-free.repo ] || [ ! -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
|
if [ ! -e /etc/yum.repos.d/rpmfusion-free.repo ] || [ ! -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
|
||||||
printf "%b\n" "${YELLOW}Installing RPM Fusion...${RC}"
|
printf "%b\n" "${YELLOW}Installing RPM Fusion...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm
|
elevated_execution "$PACKAGER" install "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264
|
elevated_execution "$PACKAGER" config-manager --enable fedora-cisco-openh264
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled rpmfusion-nonfree-updates
|
elevated_execution "$PACKAGER" config-manager --set-enabled rpmfusion-nonfree-updates
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled rpmfusion-free-updates
|
elevated_execution "$PACKAGER" config-manager --set-enabled rpmfusion-free-updates
|
||||||
printf "%b\n" "${GREEN}RPM Fusion installed and enabled${RC}"
|
printf "%b\n" "${GREEN}RPM Fusion installed and enabled${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
|
printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
|
||||||
|
|
|
@ -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
|
elevated_execution "$PACKAGER" install -y @virtualization
|
||||||
printf "%b\n" "${GREEN}Installed virtualization tools...${RC}"
|
printf "%b\n" "${GREEN}Installed virtualization tools...${RC}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -10,9 +10,9 @@ installDepend() {
|
||||||
pacman)
|
pacman)
|
||||||
#Check for multilib
|
#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]" | elevated_execution tee -a /etc/pacman.conf
|
||||||
echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
echo "Include = /etc/pacman.d/mirrorlist" | elevated_execution tee -a /etc/pacman.conf
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Syu
|
elevated_execution "$PACKAGER" -Syu
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
|
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -28,29 +28,29 @@ installDepend() {
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"
|
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"
|
||||||
|
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" dpkg --add-architecture i386
|
elevated_execution dpkg --add-architecture i386
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y software-properties-common
|
elevated_execution "$PACKAGER" install -y software-properties-common
|
||||||
"$ESCALATION_TOOL" apt-add-repository contrib -y
|
elevated_execution apt-add-repository contrib -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $DISTRO_DEPS
|
elevated_execution "$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
|
elevated_execution "$PACKAGER" install ffmpeg ffmpeg-libs -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES
|
||||||
else
|
else
|
||||||
printf "%b\n" "${CYAN}Fedora < 41 detected. Installing rpmfusion repos.${RC}"
|
printf "%b\n" "${CYAN}Fedora < 41 detected. Installing rpmfusion repos.${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm -y
|
elevated_execution "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y
|
elevated_execution "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
|
elevated_execution "$PACKAGER" -n install $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
elevated_execution "$PACKAGER" install -y $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ installAdditionalDepend() {
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
DISTRO_DEPS='steam lutris goverlay'
|
DISTRO_DEPS='steam lutris goverlay'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS
|
elevated_execution "$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 |
|
||||||
|
@ -71,7 +71,7 @@ installAdditionalDepend() {
|
||||||
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
|
elevated_execution "$PACKAGER" install ./lutris_"${version_no_v}"_all.deb
|
||||||
|
|
||||||
rm lutris_"${version_no_v}"_all.deb
|
rm lutris_"${version_no_v}"_all.deb
|
||||||
|
|
||||||
|
@ -79,20 +79,20 @@ installAdditionalDepend() {
|
||||||
printf "%b\n" "${YELLOW}Installing steam...${RC}"
|
printf "%b\n" "${YELLOW}Installing steam...${RC}"
|
||||||
|
|
||||||
if lsb_release -i | grep -qi Debian; then
|
if lsb_release -i | grep -qi Debian; then
|
||||||
"$ESCALATION_TOOL" apt-add-repository non-free -y
|
elevated_execution apt-add-repository non-free -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install steam-installer -y
|
elevated_execution "$PACKAGER" install steam-installer -y
|
||||||
else
|
else
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y steam
|
elevated_execution "$PACKAGER" install -y steam
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
DISTRO_DEPS='steam lutris'
|
DISTRO_DEPS='steam lutris'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DISTRO_DEPS
|
elevated_execution "$PACKAGER" install -y $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
# Flatpak
|
# Flatpak
|
||||||
DISTRO_DEPS='lutris'
|
DISTRO_DEPS='lutris'
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
elevated_execution "$PACKAGER" -n install $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -6,16 +6,16 @@ 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
|
elevated_execution "$PACKAGER" install -y qt6ct kvantum
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install qt6ct kvantum
|
elevated_execution "$PACKAGER" --non-interactive install qt6ct kvantum
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
|
elevated_execution "$PACKAGER" install -y qt6ct kvantum
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum
|
elevated_execution "$PACKAGER" -S --needed --noconfirm qt6ct kvantum
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
@ -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" | elevated_execution 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}"
|
||||||
|
|
|
@ -6,16 +6,16 @@ removeSnaps() {
|
||||||
if command_exists snap; then
|
if command_exists snap; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
elevated_execution "$PACKAGER" -Rns snapd
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
elevated_execution "$PACKAGER" autoremove --purge snapd
|
||||||
if [ "$ID" = ubuntu ]; then
|
if [ "$ID" = ubuntu ]; then
|
||||||
"$ESCALATION_TOOL" apt-mark hold snapd
|
elevated_execution apt-mark hold snapd
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf|zypper)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
elevated_execution "$PACKAGER" remove snapd
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -6,24 +6,24 @@ 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
|
elevated_execution "$PACKAGER" clean
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove -y
|
elevated_execution "$PACKAGER" autoremove -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoclean
|
elevated_execution "$PACKAGER" autoclean
|
||||||
"$ESCALATION_TOOL" du -h /var/cache/apt
|
elevated_execution du -h /var/cache/apt
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" clean
|
elevated_execution "$PACKAGER" clean
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" clean -a
|
elevated_execution "$PACKAGER" clean -a
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" tidy
|
elevated_execution "$PACKAGER" tidy
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" cc -a
|
elevated_execution "$PACKAGER" cc -a
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" clean all
|
elevated_execution "$PACKAGER" clean all
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove -y
|
elevated_execution "$PACKAGER" autoremove -y
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
elevated_execution "$PACKAGER" -Sc --noconfirm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
elevated_execution "$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}"
|
||||||
|
@ -33,15 +33,15 @@ cleanup_system() {
|
||||||
|
|
||||||
common_cleanup() {
|
common_cleanup() {
|
||||||
if [ -d /var/tmp ]; then
|
if [ -d /var/tmp ]; then
|
||||||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
|
elevated_execution find /var/tmp -type f -atime +5 -delete
|
||||||
fi
|
fi
|
||||||
if [ -d /tmp ]; then
|
if [ -d /tmp ]; then
|
||||||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
|
elevated_execution find /tmp -type f -atime +5 -delete
|
||||||
fi
|
fi
|
||||||
if [ -d /var/log ]; then
|
if [ -d /var/log ]; then
|
||||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
elevated_execution find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||||
fi
|
fi
|
||||||
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
elevated_execution journalctl --vacuum-time=3d
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_data() {
|
clean_data() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ fastUpdate() {
|
||||||
printf "%b\n" "${YELLOW}Generating a new list of mirrors using rate-mirrors. This process may take a few seconds...${RC}"
|
printf "%b\n" "${YELLOW}Generating a new list of mirrors using rate-mirrors. This process may take a few seconds...${RC}"
|
||||||
|
|
||||||
if [ -s /etc/pacman.d/mirrorlist ]; then
|
if [ -s /etc/pacman.d/mirrorlist ]; then
|
||||||
"$ESCALATION_TOOL" cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
elevated_execution cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If for some reason DTYPE is still unknown use always arch so the rate-mirrors does not fail
|
# If for some reason DTYPE is still unknown use always arch so the rate-mirrors does not fail
|
||||||
|
@ -20,33 +20,33 @@ 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}
|
elevated_execution rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${dtype_local}
|
||||||
if [ $? -ne 0 ] || [ ! -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
|
elevated_execution cp /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" apt-get update
|
elevated_execution 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"; }
|
elevated_execution 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
|
||||||
"$ESCALATION_TOOL" cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
elevated_execution cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||||
"$ESCALATION_TOOL" nala update
|
elevated_execution nala update
|
||||||
PACKAGER="nala"
|
PACKAGER="nala"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" upgrade -y
|
elevated_execution "$PACKAGER" upgrade -y
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update -y
|
elevated_execution "$PACKAGER" update -y
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
elevated_execution "$PACKAGER" ref
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
elevated_execution "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
|
@ -59,20 +59,20 @@ 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
|
elevated_execution "$PACKAGER" update
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" upgrade -y
|
elevated_execution "$PACKAGER" upgrade -y
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" update -y
|
elevated_execution "$PACKAGER" update -y
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" upgrade -y
|
elevated_execution "$PACKAGER" upgrade -y
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Sy --noconfirm --needed archlinux-keyring
|
elevated_execution "$PACKAGER" -Sy --noconfirm --needed archlinux-keyring
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Su --noconfirm
|
elevated_execution "$PACKAGER" -Su --noconfirm
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
elevated_execution "$PACKAGER" ref
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
elevated_execution "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
|
|
|
@ -8,13 +8,13 @@ InstallTermiusFonts() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --needed --noconfirm terminus-font
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fonts-terminus
|
elevated_execution "$PACKAGER" install -y fonts-terminus
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console
|
elevated_execution "$PACKAGER" install -y terminus-fonts-console
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
@ -30,31 +30,31 @@ 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
|
elevated_execution 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
|
elevated_execution 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
|
elevated_execution sed -i 's/^CODESET=.*/CODESET="guess"/' /etc/default/console-setup
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup
|
elevated_execution sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup
|
||||||
"$ESCALATION_TOOL" sed -i 's/^FONTSIZE=.*/FONTSIZE="16x32"/' /etc/default/console-setup
|
elevated_execution 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
|
elevated_execution 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
|
elevated_execution 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
|
elevated_execution 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
|
elevated_execution 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}"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -43,9 +43,9 @@ configure_lightdm() {
|
||||||
printf "%b" "Enter username for LightDM autologin: "
|
printf "%b" "Enter username for LightDM autologin: "
|
||||||
read -r user
|
read -r user
|
||||||
|
|
||||||
printf "%b\n" '[Seat:*]' | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf
|
printf "%b\n" '[Seat:*]' | elevated_execution tee -a /etc/lightdm/lightdm.conf
|
||||||
printf "%s\n" "autologin-user=$user" | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf
|
printf "%s\n" "autologin-user=$user" | elevated_execution tee -a /etc/lightdm/lightdm.conf
|
||||||
printf "%b\n" 'autologin-user-timeout=0' | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf
|
printf "%b\n" 'autologin-user-timeout=0' | elevated_execution tee -a /etc/lightdm/lightdm.conf
|
||||||
|
|
||||||
printf "%b\n" "LightDM has been configured for autologin."
|
printf "%b\n" "LightDM has been configured for autologin."
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,8 @@ configure_lightdm() {
|
||||||
# Function to remove LightDM autologin
|
# Function to remove LightDM autologin
|
||||||
remove_lightdm_autologin() {
|
remove_lightdm_autologin() {
|
||||||
printf "%b\n" "Removing LightDM autologin configuration..."
|
printf "%b\n" "Removing LightDM autologin configuration..."
|
||||||
"$ESCALATION_TOOL" sed -i'' '/^\[Seat:\*]/d' /etc/lightdm/lightdm.conf
|
elevated_execution sed -i'' '/^\[Seat:\*]/d' /etc/lightdm/lightdm.conf
|
||||||
"$ESCALATION_TOOL" sed -i'' '/^autologin-/d' /etc/lightdm/lightdm.conf
|
elevated_execution sed -i'' '/^autologin-/d' /etc/lightdm/lightdm.conf
|
||||||
printf "%b\n" "LightDM autologin configuration has been removed."
|
printf "%b\n" "LightDM autologin configuration has been removed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ configure_gdm() {
|
||||||
printf "%b" "Enter username for GDM autologin: "
|
printf "%b" "Enter username for GDM autologin: "
|
||||||
read -r user
|
read -r user
|
||||||
|
|
||||||
printf "%b\n" '[daemon]' | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf
|
printf "%b\n" '[daemon]' | elevated_execution tee -a /etc/gdm/custom.conf
|
||||||
printf "%b\n" 'AutomaticLoginEnable = true' | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf
|
printf "%b\n" 'AutomaticLoginEnable = true' | elevated_execution tee -a /etc/gdm/custom.conf
|
||||||
printf "%s\n" "AutomaticLogin = $user" | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf
|
printf "%s\n" "AutomaticLogin = $user" | elevated_execution tee -a /etc/gdm/custom.conf
|
||||||
|
|
||||||
printf "%b\n" "GDM has been configured for autologin."
|
printf "%b\n" "GDM has been configured for autologin."
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,8 @@ configure_gdm() {
|
||||||
# Function to remove GDM autologin
|
# Function to remove GDM autologin
|
||||||
remove_gdm_autologin() {
|
remove_gdm_autologin() {
|
||||||
printf "%b\n" "Removing GDM autologin configuration..."
|
printf "%b\n" "Removing GDM autologin configuration..."
|
||||||
"$ESCALATION_TOOL" sed -i'' '/AutomaticLoginEnable/d' /etc/gdm/custom.conf
|
elevated_execution sed -i'' '/AutomaticLoginEnable/d' /etc/gdm/custom.conf
|
||||||
"$ESCALATION_TOOL" sed -i'' '/AutomaticLogin/d' /etc/gdm/custom.conf
|
elevated_execution sed -i'' '/AutomaticLogin/d' /etc/gdm/custom.conf
|
||||||
printf "%b\n" "GDM autologin configuration has been removed."
|
printf "%b\n" "GDM autologin configuration has been removed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,9 +86,9 @@ configure_sddm() {
|
||||||
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]' | elevated_execution tee -a /etc/sddm.conf
|
||||||
printf "%s\n" "User=$user" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
printf "%s\n" "User=$user" | elevated_execution tee -a /etc/sddm.conf
|
||||||
printf "%s\n" "Session=$session" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf
|
printf "%s\n" "Session=$session" | elevated_execution tee -a /etc/sddm.conf
|
||||||
|
|
||||||
printf "%b\n" "SDDM has been configured for autologin."
|
printf "%b\n" "SDDM has been configured for autologin."
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ configure_sddm() {
|
||||||
# Function to remove SDDM autologin
|
# Function to remove SDDM autologin
|
||||||
remove_sddm_autologin() {
|
remove_sddm_autologin() {
|
||||||
printf "%b\n" "Removing SDDM autologin configuration..."
|
printf "%b\n" "Removing SDDM autologin configuration..."
|
||||||
"$ESCALATION_TOOL" sed -i'' '/\[Autologin\]/,+2d' /etc/sddm.conf
|
elevated_execution sed -i'' '/\[Autologin\]/,+2d' /etc/sddm.conf
|
||||||
printf "%b\n" "SDDM autologin configuration has been removed."
|
printf "%b\n" "SDDM autologin configuration has been removed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,8 @@ configure_lxdm() {
|
||||||
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
|
elevated_execution 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
|
elevated_execution sed -i'' "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf
|
||||||
|
|
||||||
printf "%b\n" "LXDM has been configured for autologin."
|
printf "%b\n" "LXDM has been configured for autologin."
|
||||||
}
|
}
|
||||||
|
@ -116,8 +116,8 @@ configure_lxdm() {
|
||||||
# Function to remove LXDM autologin
|
# Function to remove LXDM autologin
|
||||||
remove_lxdm_autologin() {
|
remove_lxdm_autologin() {
|
||||||
printf "%b\n" "Removing LXDM autologin configuration..."
|
printf "%b\n" "Removing LXDM autologin configuration..."
|
||||||
"$ESCALATION_TOOL" sed -i'' "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf
|
elevated_execution sed -i'' "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf
|
||||||
"$ESCALATION_TOOL" sed -i'' "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf
|
elevated_execution sed -i'' "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf
|
||||||
printf "%b\n" "LXDM autologin configuration has been removed."
|
printf "%b\n" "LXDM autologin configuration has been removed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ select_drive() {
|
||||||
|
|
||||||
# Function to get UUID and FSTYPE of the selected drive
|
# Function to get UUID and FSTYPE of the selected drive
|
||||||
get_uuid_fstype() {
|
get_uuid_fstype() {
|
||||||
UUID=$("$ESCALATION_TOOL" blkid -s UUID -o value "${partition}")
|
UUID=$(elevated_execution blkid -s UUID -o value "${partition}")
|
||||||
FSTYPE=$(lsblk -no FSTYPE "${partition}")
|
FSTYPE=$(lsblk -no FSTYPE "${partition}")
|
||||||
NAME=$(lsblk -no NAME "${partition}")
|
NAME=$(lsblk -no NAME "${partition}")
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ create_mount_point() {
|
||||||
read -r mount_point
|
read -r mount_point
|
||||||
if [ ! -d "$mount_point" ]; then
|
if [ ! -d "$mount_point" ]; then
|
||||||
printf "%b\n" "${YELLOW}Mount point doesn't exist. Creating it..${RC}."
|
printf "%b\n" "${YELLOW}Mount point doesn't exist. Creating it..${RC}."
|
||||||
"$ESCALATION_TOOL" mkdir -p "$mount_point"
|
elevated_execution mkdir -p "$mount_point"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Mount point already exists.${RC}"
|
printf "%b\n" "${RED}Mount point already exists.${RC}"
|
||||||
fi
|
fi
|
||||||
|
@ -51,16 +51,16 @@ create_mount_point() {
|
||||||
# Function to update /etc/fstab with a comment on the first line and the actual entry on the second line
|
# Function to update /etc/fstab with a comment on the first line and the actual entry on the second line
|
||||||
update_fstab() {
|
update_fstab() {
|
||||||
printf "%b\n" "${YELLOW}Adding entry to /etc/fstab...${RC}"
|
printf "%b\n" "${YELLOW}Adding entry to /etc/fstab...${RC}"
|
||||||
"$ESCALATION_TOOL" cp /etc/fstab /etc/fstab.bak # Backup fstab
|
elevated_execution cp /etc/fstab /etc/fstab.bak # Backup fstab
|
||||||
|
|
||||||
# Prepare the comment and the fstab entry
|
# Prepare the comment and the fstab entry
|
||||||
comment="# Mount for /dev/$NAME"
|
comment="# Mount for /dev/$NAME"
|
||||||
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" | elevated_execution tee -a /etc/fstab > /dev/null
|
||||||
printf "%b\n" "$fstab_entry" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
|
printf "%b\n" "$fstab_entry" | elevated_execution tee -a /etc/fstab > /dev/null
|
||||||
printf "%b\n" "" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
|
printf "%b\n" "" | elevated_execution 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"
|
||||||
|
@ -71,7 +71,7 @@ update_fstab() {
|
||||||
# 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
|
elevated_execution 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
|
||||||
|
|
|
@ -8,10 +8,10 @@ setupBluetooth() {
|
||||||
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
|
elevated_execution "$PACKAGER" -S --noconfirm bluez-utils
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
elevated_execution "$PACKAGER" install -y bluez
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -21,7 +21,7 @@ setupBluetooth() {
|
||||||
# Check if bluetooth service is running
|
# 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
|
elevated_execution 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}"
|
||||||
|
|
|
@ -13,7 +13,7 @@ usage() {
|
||||||
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"
|
||||||
"$ESCALATION_TOOL" lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
|
elevated_execution lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
|
||||||
printf "\n"
|
printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,13 +164,13 @@ write_iso(){
|
||||||
|
|
||||||
# Display progress and create the bootable USB drive
|
# 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 ! elevated_execution 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
|
# Sync to ensure all data is written
|
||||||
if ! "$ESCALATION_TOOL" sync; then
|
if ! elevated_execution 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
|
||||||
|
@ -179,10 +179,10 @@ write_iso(){
|
||||||
|
|
||||||
# Eject the USB device
|
# 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 ! elevated_execution 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}"
|
||||||
fi
|
fi
|
||||||
if ! "$ESCALATION_TOOL" eject "$USB_DEVICE"; then
|
if ! elevated_execution eject "$USB_DEVICE"; then
|
||||||
printf "%b\n" "${RED}Failed to eject ${USB_DEVICE}${RC}"
|
printf "%b\n" "${RED}Failed to eject ${USB_DEVICE}${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,16 @@ printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}"
|
||||||
if ! command_exists openssl; then
|
if ! command_exists openssl; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Syu --noconfirm openssl
|
elevated_execution "$PACKAGER" -Syu --noconfirm openssl
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y openssl
|
elevated_execution "$PACKAGER" install -y openssl
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y openssl
|
elevated_execution "$PACKAGER" install -y openssl
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install openssl
|
elevated_execution "$PACKAGER" install openssl
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
create_file() {
|
create_file() {
|
||||||
printf "%b\n" "Creating script..."
|
printf "%b\n" "Creating script..."
|
||||||
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
elevated_execution 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
|
elevated_execution 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'
|
elevated_execution tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=numlock
|
Description=numlock
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@ numlockSetup() {
|
||||||
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
|
elevated_execution 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
|
elevated_execution 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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
elevated_execution systemctl start ollama
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ installAutoCpufreq() {
|
||||||
printf "%b\n" "${YELLOW}git not found. Installing git...${RC}"
|
printf "%b\n" "${YELLOW}git not found. Installing git...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
|
elevated_execution "$PACKAGER" -S --needed --noconfirm git
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
elevated_execution "$PACKAGER" install -y git
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -33,8 +33,8 @@ 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
|
elevated_execution ./auto-cpufreq-installer
|
||||||
"$ESCALATION_TOOL" auto-cpufreq --install
|
elevated_execution auto-cpufreq --install
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
@ -47,10 +47,10 @@ configureAutoCpufreq() {
|
||||||
# Check if the system has a battery to determine if it's a laptop
|
# Check if the system has a battery to determine if it's a laptop
|
||||||
if [ -d /sys/class/power_supply/BAT0 ]; then
|
if [ -d /sys/class/power_supply/BAT0 ]; then
|
||||||
printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}"
|
printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}"
|
||||||
"$ESCALATION_TOOL" auto-cpufreq --force powersave
|
elevated_execution auto-cpufreq --force powersave
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}System detected as desktop. Updating auto-cpufreq for desktop...${RC}"
|
printf "%b\n" "${GREEN}System detected as desktop. Updating auto-cpufreq for desktop...${RC}"
|
||||||
"$ESCALATION_TOOL" auto-cpufreq --force performance
|
elevated_execution auto-cpufreq --force performance
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping configuration.${RC}"
|
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping configuration.${RC}"
|
||||||
|
@ -62,7 +62,7 @@ removeAutoCpufreqTweak() {
|
||||||
|
|
||||||
if command_exists auto-cpufreq; then
|
if command_exists auto-cpufreq; then
|
||||||
printf "%b\n" "${YELLOW}Resetting auto-cpufreq configuration...${RC}"
|
printf "%b\n" "${YELLOW}Resetting auto-cpufreq configuration...${RC}"
|
||||||
"$ESCALATION_TOOL" auto-cpufreq --force reset
|
elevated_execution auto-cpufreq --force reset
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping removal.${RC}"
|
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping removal.${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,10 +9,10 @@ install_package() {
|
||||||
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"
|
elevated_execution "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
|
elevated_execution "$PACKAGER" install -y "$PACKAGE"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -41,8 +41,8 @@ setup_ssh() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Enable and start the appropriate SSH service
|
# Enable and start the appropriate SSH service
|
||||||
"$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE"
|
elevated_execution systemctl enable "$SSH_SERVICE"
|
||||||
"$ESCALATION_TOOL" systemctl start "$SSH_SERVICE"
|
elevated_execution systemctl start "$SSH_SERVICE"
|
||||||
|
|
||||||
# Get the local IP address
|
# Get the local IP address
|
||||||
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1)
|
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1)
|
||||||
|
@ -71,7 +71,7 @@ setup_samba() {
|
||||||
printf "%b" "Do you want to modify the existing Samba configuration? (Y/n): "
|
printf "%b" "Do you want to modify the existing Samba configuration? (Y/n): "
|
||||||
read -r MODIFY_SAMBA
|
read -r MODIFY_SAMBA
|
||||||
if [ "$MODIFY_SAMBA" = "Y" ] || [ "$MODIFY_SAMBA" = "y" ]; then
|
if [ "$MODIFY_SAMBA" = "Y" ] || [ "$MODIFY_SAMBA" = "y" ]; then
|
||||||
"$ESCALATION_TOOL" "$EDITOR" "$SAMBA_CONFIG"
|
elevated_execution "$EDITOR" "$SAMBA_CONFIG"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "%b\n" "${YELLOW}No existing Samba configuration found. Setting up a new one...${RC}"
|
printf "%b\n" "${YELLOW}No existing Samba configuration found. Setting up a new one...${RC}"
|
||||||
|
@ -82,8 +82,8 @@ setup_samba() {
|
||||||
SHARED_DIR=${SHARED_DIR:-/srv/samba/share}
|
SHARED_DIR=${SHARED_DIR:-/srv/samba/share}
|
||||||
|
|
||||||
# Create the shared directory if it doesn't exist
|
# Create the shared directory if it doesn't exist
|
||||||
"$ESCALATION_TOOL" mkdir -p "$SHARED_DIR"
|
elevated_execution mkdir -p "$SHARED_DIR"
|
||||||
"$ESCALATION_TOOL" chmod -R 0777 "$SHARED_DIR"
|
elevated_execution chmod -R 0777 "$SHARED_DIR"
|
||||||
|
|
||||||
# Add a new Samba user
|
# Add a new Samba user
|
||||||
printf "%b" "Enter Samba username: "
|
printf "%b" "Enter Samba username: "
|
||||||
|
@ -109,10 +109,10 @@ setup_samba() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Add the user and set the password
|
# Add the user and set the password
|
||||||
"$ESCALATION_TOOL" smbpasswd -a "$SAMBA_USER"
|
elevated_execution smbpasswd -a "$SAMBA_USER"
|
||||||
|
|
||||||
# Configure Samba settings
|
# Configure Samba settings
|
||||||
"$ESCALATION_TOOL" tee "$SAMBA_CONFIG" > /dev/null <<EOL
|
elevated_execution tee "$SAMBA_CONFIG" > /dev/null <<EOL
|
||||||
[global]
|
[global]
|
||||||
workgroup = WORKGROUP
|
workgroup = WORKGROUP
|
||||||
server string = Samba Server
|
server string = Samba Server
|
||||||
|
@ -131,8 +131,8 @@ EOL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable and start Samba services
|
# Enable and start Samba services
|
||||||
"$ESCALATION_TOOL" systemctl enable smb nmb
|
elevated_execution systemctl enable smb nmb
|
||||||
"$ESCALATION_TOOL" systemctl start smb nmb
|
elevated_execution systemctl start smb nmb
|
||||||
|
|
||||||
# Check if Samba is running
|
# Check if Samba is running
|
||||||
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
|
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
|
||||||
|
@ -148,9 +148,9 @@ configure_firewall() {
|
||||||
printf "%b\n" "${BLUE}Configuring firewall...${RC}"
|
printf "%b\n" "${BLUE}Configuring firewall...${RC}"
|
||||||
|
|
||||||
if command_exists ufw; then
|
if command_exists ufw; then
|
||||||
"$ESCALATION_TOOL" ufw allow OpenSSH
|
elevated_execution ufw allow OpenSSH
|
||||||
"$ESCALATION_TOOL" ufw allow Samba
|
elevated_execution ufw allow Samba
|
||||||
"$ESCALATION_TOOL" ufw enable
|
elevated_execution ufw enable
|
||||||
printf "%b\n" "${GREEN}Firewall configured for SSH and Samba.${RC}"
|
printf "%b\n" "${GREEN}Firewall configured for SSH and Samba.${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${YELLOW}UFW is not installed. Skipping firewall configuration.${RC}"
|
printf "%b\n" "${YELLOW}UFW is not installed. Skipping firewall configuration.${RC}"
|
||||||
|
|
|
@ -29,25 +29,25 @@ show_menu() {
|
||||||
# Function to view all services
|
# Function to view all services
|
||||||
view_all_services() {
|
view_all_services() {
|
||||||
printf "%b\n" "Listing all services..."
|
printf "%b\n" "Listing all services..."
|
||||||
"$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
elevated_execution systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to view enabled services
|
# Function to view enabled services
|
||||||
view_enabled_services() {
|
view_enabled_services() {
|
||||||
printf "%b\n" "Listing enabled services..."
|
printf "%b\n" "Listing enabled services..."
|
||||||
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
elevated_execution systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to view disabled services
|
# Function to view disabled services
|
||||||
view_disabled_services() {
|
view_disabled_services() {
|
||||||
printf "%b\n" "Listing disabled services..."
|
printf "%b\n" "Listing disabled services..."
|
||||||
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
elevated_execution systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to view started services
|
# Function to view started services
|
||||||
view_started_services() {
|
view_started_services() {
|
||||||
printf "%b\n" "Listing started services: "
|
printf "%b\n" "Listing started services: "
|
||||||
"$ESCALATION_TOOL" systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more
|
elevated_execution systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to add a new service
|
# Function to add a new service
|
||||||
|
@ -55,7 +55,7 @@ add_service() {
|
||||||
while [ -z "$SERVICE_NAME" ]; do
|
while [ -z "$SERVICE_NAME" ]; do
|
||||||
printf "%b" "Enter the name of the new service (e.g., my_service): "
|
printf "%b" "Enter the name of the new service (e.g., my_service): "
|
||||||
read -r SERVICE_NAME
|
read -r SERVICE_NAME
|
||||||
if "$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | grep -q "$SERVICE_NAME.service"; then
|
if elevated_execution systemctl list-units --type=service --all --no-legend | grep -q "$SERVICE_NAME.service"; then
|
||||||
printf "%b\n" "${GREEN}Service already exists.${RC}"
|
printf "%b\n" "${GREEN}Service already exists.${RC}"
|
||||||
SERVICE_NAME=""
|
SERVICE_NAME=""
|
||||||
fi
|
fi
|
||||||
|
@ -92,11 +92,11 @@ add_service() {
|
||||||
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
|
} | elevated_execution tee "$SERVICE_FILE" > /dev/null
|
||||||
|
|
||||||
# Set permissions and reload systemd
|
# Set permissions and reload systemd
|
||||||
"$ESCALATION_TOOL" chmod 644 "$SERVICE_FILE"
|
elevated_execution chmod 644 "$SERVICE_FILE"
|
||||||
"$ESCALATION_TOOL" systemctl daemon-reload
|
elevated_execution systemctl daemon-reload
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been created and is ready to be started."
|
printf "%b\n" "Service $SERVICE_NAME has been created and is ready to be started."
|
||||||
|
|
||||||
# Optionally, enable and start the service
|
# Optionally, enable and start the service
|
||||||
|
@ -104,8 +104,8 @@ add_service() {
|
||||||
read -r START_ENABLE
|
read -r START_ENABLE
|
||||||
|
|
||||||
if [ "$START_ENABLE" = "y" ] || [ "$START_ENABLE" = "Y" ]; then
|
if [ "$START_ENABLE" = "y" ] || [ "$START_ENABLE" = "Y" ]; then
|
||||||
"$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"
|
elevated_execution systemctl start "$SERVICE_NAME"
|
||||||
"$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"
|
elevated_execution systemctl enable "$SERVICE_NAME"
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
|
printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been created but not started."
|
printf "%b\n" "Service $SERVICE_NAME has been created but not started."
|
||||||
|
@ -121,12 +121,12 @@ remove_service() {
|
||||||
|
|
||||||
if [ -f "$SERVICE_FILE" ]; then
|
if [ -f "$SERVICE_FILE" ]; then
|
||||||
printf "%b\n" "Stopping and disabling the service..."
|
printf "%b\n" "Stopping and disabling the service..."
|
||||||
"$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"
|
elevated_execution systemctl stop "$SERVICE_NAME"
|
||||||
"$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"
|
elevated_execution systemctl disable "$SERVICE_NAME"
|
||||||
|
|
||||||
printf "%b\n" "Removing the service file..."
|
printf "%b\n" "Removing the service file..."
|
||||||
"$ESCALATION_TOOL" rm -f "$SERVICE_FILE"
|
elevated_execution rm -f "$SERVICE_FILE"
|
||||||
"$ESCALATION_TOOL" systemctl daemon-reload
|
elevated_execution systemctl daemon-reload
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been removed."
|
printf "%b\n" "Service $SERVICE_NAME has been removed."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Service $SERVICE_NAME does not exist."
|
printf "%b\n" "Service $SERVICE_NAME does not exist."
|
||||||
|
@ -139,7 +139,7 @@ start_service() {
|
||||||
printf "%b" "Enter the name of the service to start (e.g., my_service): "
|
printf "%b" "Enter the name of the service to start (e.g., my_service): "
|
||||||
read -r SERVICE_NAME
|
read -r SERVICE_NAME
|
||||||
|
|
||||||
if "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"; then
|
if elevated_execution systemctl start "$SERVICE_NAME"; then
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been started."
|
printf "%b\n" "Service $SERVICE_NAME has been started."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Failed to start service: $SERVICE_NAME."
|
printf "%b\n" "Failed to start service: $SERVICE_NAME."
|
||||||
|
@ -152,7 +152,7 @@ stop_service() {
|
||||||
printf "%b" "Enter the name of the service to stop (e.g., my_service): "
|
printf "%b" "Enter the name of the service to stop (e.g., my_service): "
|
||||||
read -r SERVICE_NAME
|
read -r SERVICE_NAME
|
||||||
|
|
||||||
if "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"; then
|
if elevated_execution systemctl stop "$SERVICE_NAME"; then
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been stopped."
|
printf "%b\n" "Service $SERVICE_NAME has been stopped."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Failed to stop service: $SERVICE_NAME."
|
printf "%b\n" "Failed to stop service: $SERVICE_NAME."
|
||||||
|
@ -165,7 +165,7 @@ enable_service() {
|
||||||
printf "%b" "Enter the name of the service to enable (e.g., my_service): "
|
printf "%b" "Enter the name of the service to enable (e.g., my_service): "
|
||||||
read -r SERVICE_NAME
|
read -r SERVICE_NAME
|
||||||
|
|
||||||
if "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"; then
|
if elevated_execution systemctl enable "$SERVICE_NAME"; then
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been enabled."
|
printf "%b\n" "Service $SERVICE_NAME has been enabled."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Failed to enable service: $SERVICE_NAME."
|
printf "%b\n" "Failed to enable service: $SERVICE_NAME."
|
||||||
|
@ -178,7 +178,7 @@ disable_service() {
|
||||||
printf "%b" "Enter the name of the service to disable (e.g., my_service): "
|
printf "%b" "Enter the name of the service to disable (e.g., my_service): "
|
||||||
read -r SERVICE_NAME
|
read -r SERVICE_NAME
|
||||||
|
|
||||||
if "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"; then
|
if elevated_execution systemctl disable "$SERVICE_NAME"; then
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been enabled."
|
printf "%b\n" "Service $SERVICE_NAME has been enabled."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Failed to enable service: $SERVICE_NAME."
|
printf "%b\n" "Failed to enable service: $SERVICE_NAME."
|
||||||
|
@ -225,11 +225,11 @@ create_service_from_external() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy the modified service file to /etc/systemd/system/
|
# Copy the modified service file to /etc/systemd/system/
|
||||||
"$ESCALATION_TOOL" cp "$SERVICE_FILE" "$SYSTEMD_SERVICE_FILE"
|
elevated_execution cp "$SERVICE_FILE" "$SYSTEMD_SERVICE_FILE"
|
||||||
|
|
||||||
# Set permissions and reload systemd
|
# Set permissions and reload systemd
|
||||||
"$ESCALATION_TOOL" chmod 644 "$SYSTEMD_SERVICE_FILE"
|
elevated_execution chmod 644 "$SYSTEMD_SERVICE_FILE"
|
||||||
"$ESCALATION_TOOL" systemctl daemon-reload
|
elevated_execution systemctl daemon-reload
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been created and is ready to be started."
|
printf "%b\n" "Service $SERVICE_NAME has been created and is ready to be started."
|
||||||
|
|
||||||
# Optionally, enable and start the service
|
# Optionally, enable and start the service
|
||||||
|
@ -237,8 +237,8 @@ create_service_from_external() {
|
||||||
read -r START_ENABLE
|
read -r START_ENABLE
|
||||||
|
|
||||||
if [ "$START_ENABLE" = "y" ]; then
|
if [ "$START_ENABLE" = "y" ]; then
|
||||||
"$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"
|
elevated_execution systemctl start "$SERVICE_NAME"
|
||||||
"$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"
|
elevated_execution systemctl enable "$SERVICE_NAME"
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
|
printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
|
||||||
else
|
else
|
||||||
printf "%b\n" "Service $SERVICE_NAME has been created but not started."
|
printf "%b\n" "Service $SERVICE_NAME has been created but not started."
|
||||||
|
|
|
@ -61,11 +61,11 @@ disable_password_auth() {
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "\n"
|
printf "\n"
|
||||||
ssh "$host_alias" "
|
ssh "$host_alias" "
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
|
elevated_execution -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 &&
|
elevated_execution -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 &&
|
elevated_execution -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 &&
|
elevated_execution -S sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S systemctl restart sshd
|
elevated_execution -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,11 +76,11 @@ enable_password_auth() {
|
||||||
read -r host_alias
|
read -r host_alias
|
||||||
printf "\n"
|
printf "\n"
|
||||||
ssh "$host_alias" "
|
ssh "$host_alias" "
|
||||||
"$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
|
elevated_execution -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 &&
|
elevated_execution -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 &&
|
elevated_execution -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 &&
|
elevated_execution -S sed -i 's/^PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
|
||||||
"$ESCALATION_TOOL" -S systemctl restart sshd
|
elevated_execution -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."
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,10 @@ install_timeshift() {
|
||||||
if ! command_exists timeshift; then
|
if ! command_exists timeshift; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift
|
elevated_execution "${PACKAGER}" -S --noconfirm timeshift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift
|
elevated_execution "${PACKAGER}" install -y timeshift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -37,13 +37,13 @@ display_menu() {
|
||||||
# Function to list snapshots
|
# 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
|
elevated_execution timeshift --list-snapshots
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to list devices
|
# 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
|
elevated_execution timeshift --list-devices
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to create a new snapshot
|
# Function to create a new snapshot
|
||||||
|
@ -55,13 +55,13 @@ create_snapshot() {
|
||||||
|
|
||||||
if [ -z "$COMMENT" ] && [ -z "$TAG" ]; then
|
if [ -z "$COMMENT" ] && [ -z "$TAG" ]; then
|
||||||
printf "%b\n" "${CYAN}Creating snapshot with no comment or tag...${RC}"
|
printf "%b\n" "${CYAN}Creating snapshot with no comment or tag...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --create
|
elevated_execution timeshift --create
|
||||||
elif [ -z "$TAG" ]; then
|
elif [ -z "$TAG" ]; then
|
||||||
printf "%b\n" "${CYAN}Creating snapshot with no tag...${RC}"
|
printf "%b\n" "${CYAN}Creating snapshot with no tag...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --create --comments "$COMMENT"
|
elevated_execution timeshift --create --comments "$COMMENT"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${CYAN}Creating snapshot with tag: $TAG...${RC}"
|
printf "%b\n" "${CYAN}Creating snapshot with tag: $TAG...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" --tags "$TAG"
|
elevated_execution timeshift --create --comments "$COMMENT" --tags "$TAG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
@ -83,11 +83,11 @@ restore_snapshot() {
|
||||||
read -r SKIP_GRUB
|
read -r SKIP_GRUB
|
||||||
|
|
||||||
if [ "$SKIP_GRUB" = "y" ] || [ "$SKIP_GRUB" = "Y" ]; then
|
if [ "$SKIP_GRUB" = "y" ] || [ "$SKIP_GRUB" = "Y" ]; then
|
||||||
"$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes
|
elevated_execution timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes
|
||||||
else
|
else
|
||||||
printf "%b\n" "${CYAN}Enter GRUB device (e.g., /dev/sda): ${RC}"
|
printf "%b\n" "${CYAN}Enter GRUB device (e.g., /dev/sda): ${RC}"
|
||||||
read -r GRUB_DEVICE
|
read -r GRUB_DEVICE
|
||||||
"$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes
|
elevated_execution timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
@ -105,7 +105,7 @@ delete_snapshot() {
|
||||||
read -r SNAPSHOT
|
read -r SNAPSHOT
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}"
|
printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}"
|
||||||
"$ESCALATION_TOOL" timeshift --delete --snapshot "$SNAPSHOT" --yes
|
elevated_execution timeshift --delete --snapshot "$SNAPSHOT" --yes
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}"
|
printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}"
|
||||||
|
@ -122,7 +122,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
|
elevated_execution timeshift --delete-all --yes
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}"
|
printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -36,7 +36,7 @@ addToGroup() {
|
||||||
read -r confirm
|
read -r confirm
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
"$ESCALATION_TOOL" usermod -aG "$groups_to_add" "$username"
|
elevated_execution usermod -aG "$groups_to_add" "$username"
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}User successfully added to the $groups_to_add${RC}"
|
printf "%b\n" "${GREEN}User successfully added to the $groups_to_add${RC}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@ createUser() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$ESCALATION_TOOL" useradd -m "$username" -g users -s /bin/bash
|
elevated_execution useradd -m "$username" -g users -s /bin/bash
|
||||||
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
|
echo "$username:$password" | elevated_execution chpasswd
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}User $username created successfully${RC}"
|
printf "%b\n" "${GREEN}User $username created successfully${RC}"
|
||||||
printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}"
|
printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}"
|
||||||
|
|
|
@ -20,7 +20,7 @@ changePassword() {
|
||||||
read -r confirm
|
read -r confirm
|
||||||
confirmAction || exit 1
|
confirmAction || exit 1
|
||||||
|
|
||||||
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
|
echo "$username:$password" | elevated_execution chpasswd
|
||||||
printf "%b\n" "${GREEN}Password changed successfully${RC}"
|
printf "%b\n" "${GREEN}Password changed successfully${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
printf "%b\n" "${RED}User $username does not exist.${RC}"
|
||||||
|
|
|
@ -8,13 +8,13 @@ setup_xrandr() {
|
||||||
if ! command_exists xrandr; then
|
if ! command_exists xrandr; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm xorg-xrandr
|
elevated_execution "$PACKAGER" -S --noconfirm xorg-xrandr
|
||||||
;;
|
;;
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
elevated_execution "$PACKAGER" install -y x11-xserver-utils
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils
|
elevated_execution "$PACKAGER" install -y xorg-x11-server-utils
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -8,13 +8,13 @@ setupNetworkManager() {
|
||||||
if ! command_exists nmcli; then
|
if ! command_exists nmcli; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm networkmanager
|
elevated_execution "$PACKAGER" -S --noconfirm networkmanager
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y NetworkManager-1
|
elevated_execution "$PACKAGER" install -y NetworkManager-1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y network-manager
|
elevated_execution "$PACKAGER" install -y network-manager
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -24,7 +24,7 @@ setupNetworkManager() {
|
||||||
# Check if NetworkManager service is running
|
# 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
|
elevated_execution 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}"
|
||||||
|
|
|
@ -31,6 +31,7 @@ tree-sitter-bash = "0.23.1"
|
||||||
anstyle = "1.0.8"
|
anstyle = "1.0.8"
|
||||||
ansi-to-tui = "6.0.0"
|
ansi-to-tui = "6.0.0"
|
||||||
zips = "0.1.7"
|
zips = "0.1.7"
|
||||||
|
nix = { version = "0.29.0", features = [ "user" ] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
chrono = "0.4.33"
|
chrono = "0.4.33"
|
||||||
|
|
|
@ -3,6 +3,7 @@ mod filter;
|
||||||
mod float;
|
mod float;
|
||||||
mod floating_text;
|
mod floating_text;
|
||||||
mod hint;
|
mod hint;
|
||||||
|
mod root;
|
||||||
mod running_command;
|
mod running_command;
|
||||||
pub mod state;
|
pub mod state;
|
||||||
mod theme;
|
mod theme;
|
||||||
|
@ -61,6 +62,10 @@ fn run(
|
||||||
terminal: &mut Terminal<CrosstermBackend<io::Stdout>>,
|
terminal: &mut Terminal<CrosstermBackend<io::Stdout>>,
|
||||||
state: &mut AppState,
|
state: &mut AppState,
|
||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
|
if !root::check_root(terminal)? {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
terminal.draw(|frame| state.draw(frame)).unwrap();
|
terminal.draw(|frame| state.draw(frame)).unwrap();
|
||||||
// Wait for an event
|
// Wait for an event
|
||||||
|
|
57
tui/src/root.rs
Normal file
57
tui/src/root.rs
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
use ratatui::{
|
||||||
|
backend::CrosstermBackend,
|
||||||
|
crossterm::event::{self, Event, KeyCode, KeyEvent},
|
||||||
|
layout::{Alignment, Constraint, Layout},
|
||||||
|
style::{Style, Stylize},
|
||||||
|
widgets::{Paragraph, Wrap},
|
||||||
|
Terminal,
|
||||||
|
};
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
const ROOT_WARNING: &str = r#"
|
||||||
|
!!!!!!!!!!!!!! YOU ARE ABOUT TO RUN LINUTIL AS ROOT !!!!!!!!!!!!!!
|
||||||
|
This utility prioritizes compatibility with non-root environments.
|
||||||
|
Some scripts may work without any issues, some may not.
|
||||||
|
You have been warned!
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!! PROCEED WITH CAUTION !!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
Press [y] to continue, [n] to abort
|
||||||
|
"#;
|
||||||
|
|
||||||
|
pub fn check_root(terminal: &mut Terminal<CrosstermBackend<io::Stdout>>) -> io::Result<bool> {
|
||||||
|
if !nix::unistd::geteuid().is_root() {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
terminal.draw(|frame| {
|
||||||
|
let root_warn = Paragraph::new(ROOT_WARNING)
|
||||||
|
.white()
|
||||||
|
.on_black()
|
||||||
|
.alignment(Alignment::Center)
|
||||||
|
.style(Style::default().bold())
|
||||||
|
.wrap(Wrap { trim: true });
|
||||||
|
|
||||||
|
let rects = Layout::vertical([
|
||||||
|
Constraint::Fill(1),
|
||||||
|
Constraint::Length(10),
|
||||||
|
Constraint::Fill(1),
|
||||||
|
])
|
||||||
|
.split(frame.area());
|
||||||
|
|
||||||
|
let centered = rects[1];
|
||||||
|
|
||||||
|
frame.render_widget(root_warn, centered);
|
||||||
|
})?;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
if let Event::Key(KeyEvent {
|
||||||
|
code: KeyCode::Char(ch),
|
||||||
|
..
|
||||||
|
}) = event::read()?
|
||||||
|
{
|
||||||
|
match ch.to_ascii_lowercase() {
|
||||||
|
'y' => return Ok(true),
|
||||||
|
'n' => return Ok(false),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user