Updates free disk space, and web-search

This commit is contained in:
Alicia Sykes 2023-03-20 16:29:25 +00:00
parent 6616faef80
commit 55077bfe3e
2 changed files with 26 additions and 17 deletions

View File

@ -50,7 +50,7 @@ function fuds_is_macos () {
# Prints the title
function fuds_print_title () {
echo -e "${GREEN_B}"
echo -e "${CYAN_B}"
if fuds_command_exists "figlet" ; then
figlet "Free Up Disk Space"
else
@ -129,7 +129,7 @@ function fuds_show_help () {
fuds_print_title
echo -e "${PURPLE_B}Free up disk space on *nix based systems\n"
echo -e "Usage:${PURPLE} free-up-disk-space [OPTION]"
echo -e "Usage:${PURPLE} free-up-disk-space [OPTION]\n"
echo -e "${PURPLE_B}Options:${PURPLE}"
echo " -h, --help Show this help message"
echo " -r, --run Run all tasks"
@ -144,8 +144,14 @@ function fuds_show_help () {
echo " -b, --broken Remove broken symlinks and empty files + folders"
echo ""
echo -e "${PURPLE_B}Examples:${PURPLE}"
echo " free-up-disk-space -r"
echo " free-up-disk-space"
echo " free-up-disk-space -p -f -a -s -j -t -c -d -b"
echo " free-up-disk-space --apt --snap --auto-yes"
echo ""
echo -e "${PURPLE_B}Note:"
echo -e " ${PURPLE}Some methods are not available for all operating systems"
echo -e " By default, it will automatically detect which options are available"
echo -e " You will be prompted before any changes are made (unless --auto-yes is used)${RESET}"
}
function free_up_disk_space () {
@ -240,20 +246,20 @@ function fuds_start () {
# Show help menu
if [[ $@ == *"--help"* ]]; then
fuds_show_help
elif [ -z $@ ] || [[ $@ == *"--run"* ]]; then
elif [ -z $@ ] || [[ $@ == *"--run"* ]] || [[ $@ == *"-r"* ]]; then
# Begin the guided process
free_up_disk_space
else
# Run specific tasks, based on which flags are present
if [[ $@ == *"--pacman"* ]]; then fuds_clean_pacman; fi
if [[ $@ == *"--flatpak"* ]]; then fuds_clean_flatpak; fi
if [[ $@ == *"--apt"* ]]; then fuds_clean_apt; fi
if [[ $@ == *"--snaps"* ]]; then fuds_remove_dead_snaps; fi
if [[ $@ == *"--journal"* ]]; then fuds_journal_configure; fi
if [[ $@ == *"--trash"* ]]; then fuds_empty_trash; fi
if [[ $@ == *"--caches"* ]]; then fuds_clear_caches; fi
if [[ $@ == *"--dups"* ]]; then fuds_remove_duplicates; fi
if [[ $@ == *"--broken"* ]]; then fuds_remove_broken; fi
if [[ $@ == *"-p"* ]] || [[ $@ == *"--pacman"* ]]; then fuds_clean_pacman; fi
if [[ $@ == *"-f"* ]] || [[ $@ == *"--flatpak"* ]]; then fuds_clean_flatpak; fi
if [[ $@ == *"-a"* ]] || [[ $@ == *"--apt"* ]]; then fuds_clean_apt; fi
if [[ $@ == *"-s"* ]] || [[ $@ == *"--snaps"* ]]; then fuds_remove_dead_snaps; fi
if [[ $@ == *"-j"* ]] || [[ $@ == *"--journal"* ]]; then fuds_journal_configure; fi
if [[ $@ == *"-t"* ]] || [[ $@ == *"--trash"* ]]; then fuds_empty_trash; fi
if [[ $@ == *"-c"* ]] || [[ $@ == *"--caches"* ]]; then fuds_clear_caches; fi
if [[ $@ == *"-d"* ]] || [[ $@ == *"--dups"* ]]; then fuds_remove_duplicates; fi
if [[ $@ == *"-b"* ]] || [[ $@ == *"--broken"* ]]; then fuds_remove_broken; fi
fi
# New line and reset afterwards
echo -e "\n${RESET}"
@ -269,5 +275,7 @@ function fuds_start () {
if [ $sourced -eq 0 ]; then
fuds_start $@
else
alias fuds='fuds_start $@'
alias makespace='fuds_start $@'
alias free-up-disk-space='fuds_start $@'
fi

9
utils/web-search.sh Normal file → Executable file
View File

@ -114,7 +114,7 @@ web_search() {
# Otherwise show menu input for search engines
choices=(
duckduckgo wikipedia google github stackoverflow
wolframalpha reddit maps 'help' quit
wolframalpha reddit maps grepapp 'help' quit
)
PS3=' '
echo -e "\033[1;95mSelect a Search Option\033[0;35m"
@ -129,11 +129,12 @@ web_search() {
reddit) ws_reddit $@; return;;
maps) ws_maps $@; return;;
grepapp) ws_grepapp $@; return;;
help) show_ws_help;;
quit) break ;;
help) show_ws_help; break;;
quit) echo -e "\033[0;93mBye 👋\e[0m"; break ;;
*)
echo -e "\033[0;93mInvalid option: '$REPLY'\e[0m"
echo -e "\033[0;33mEnter the number corresponding to one of the above options\e[0m"
break
;;
esac
done
@ -183,7 +184,7 @@ show_ws_help() {
echo -e ' \033[0;35mReddit: \x1b[2m$ ws reddit or ($ wsrdt)\e[0m'
echo -e ' \033[0;35mMaps: \x1b[2m$ ws maps or ($ wsmap)\e[0m'
echo -e ' \033[0;35mGoogle: \x1b[2m$ ws google or ($ wsggl)\e[0m'
echo -e ' \033[0;35mGoogle: \x1b[2m$ ws grepapp or ($ wsgra)\e[0m'
echo -e ' \033[0;35mGrep.App: \x1b[2m$ ws grepapp or ($ wsgra)\e[0m'
echo -e '\e[0m'
}