mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
Compare commits
1 Commits
1777606d9a
...
83f231e414
Author | SHA1 | Date | |
---|---|---|---|
|
83f231e414 |
|
@ -35,10 +35,10 @@ installLinutil() {
|
|||
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl rustup man-db
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
|
||||
;;
|
||||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
||||
|
@ -54,23 +54,12 @@ installLinutil() {
|
|||
rustup default stable
|
||||
cargo install --force linutil_tui
|
||||
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
||||
installExtra
|
||||
;;
|
||||
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
installExtra() {
|
||||
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
|
||||
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
|
||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null
|
||||
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
|
||||
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
|
||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null
|
||||
printf "%b\n" "${GREEN}Done.${RC}"
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
checkAURHelper
|
||||
|
|
23
core/tabs/system-setup/system-cleanup.sh
Executable file → Normal file
23
core/tabs/system-setup/system-cleanup.sh
Executable file → Normal file
|
@ -26,21 +26,16 @@ cleanup_system() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
common_cleanup() {
|
||||
if [ -d /var/tmp ]; then
|
||||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d /tmp ]; then
|
||||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d /var/log ]; then
|
||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||
fi
|
||||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
|
||||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
|
||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
||||
}
|
||||
|
||||
|
@ -50,12 +45,8 @@ clean_data() {
|
|||
case $clean_response in
|
||||
y|Y)
|
||||
printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}"
|
||||
if [ -d "$HOME/.cache" ]; then
|
||||
find "$HOME/.cache/" -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d "$HOME/.local/share/Trash" ]; then
|
||||
find "$HOME/.local/share/Trash" -mindepth 1 -delete
|
||||
fi
|
||||
find "$HOME/.cache/" -type f -atime +5 -delete
|
||||
find "$HOME/.local/share/Trash" -mindepth 1 -delete
|
||||
printf "%b\n" "${GREEN}Cache and trash cleanup completed.${RC}"
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Reference in New Issue
Block a user