0 Members and 5 Guests are viewing this topic.
May I see the code? I have a few ideas.
#! /bin/bash#--------------------------------------------------------------------------------------------------------# Name: Linux Lite Cleaner# Description: A GUI tool to easily clean your Linux Lite system.# Authors: Misko_2083, Jerry Bezencon# Date: September 9th, 2014# Website: https://www.linuxliteos.com#--------------------------------------------------------------------------------------------------------ic="/usr/share/icons/zenity-llcc.png"selection=$(zenity --window-icon="$ic" --list --checklist --width=890 --height=400 --column="Select" --column="Name" --column="Category" --column="Status" \ --column="Description" --text="Select the task you wish to perform, then click the Clean button. Sort Categories by clicking on the column.\n\nThere are 3 levels of Status:\n<b>Safe</b> - Safe to perform, no harm can be done.\n<b>Caution</b> - Proceed with caution, read the warning on the proceeding step.\n<b>Title</b> - Text go here.\n\nYou can select multiple tasks to perform." --title="Lite Cleaner" --ok-label="Clean" --cancel-label="Quit" \"1" "Clean package cache" "Packages" "Safe" "Clean downloaded .deb files from your apt cache" \"2" "Autoremove packages" "Packages" "Safe" "Remove packages automatically installed for programs and that are no longer present" \"3" "Clear thumbnail cache" "Images" "Safe" "Delete thumbnail files created when viewing images" \"4" "Empty all Trash Bins" "Home" "Safe" "Empty the Trash Bins for all users" \"5" "Remove old kernels" "System" "Caution" "Remove kernels you no longer wish to boot from" )# Exec scriptsecho $selection | grep "Clean package cache" > /dev/nullif [ $? = 0 ];then/usr/scripts/clean/aptgetclean 2>/dev/nullfiecho $selection | grep "Autoremove packages" > /dev/nullif [ $? = 0 ];then/usr/scripts/clean/autoremovepkg 2>/dev/nullfiecho $selection | grep "Clear thumbnail cache" > /dev/nullif [ $? = 0 ];then/usr/scripts/clean/thumbnails 2>/dev/nullfiecho $selection | grep "Empty all Trash Bins" > /dev/nullif [ $? = 0 ];then/usr/scripts/clean/emptytrash 2>/dev/nullfiecho $selection | grep "Remove old kernels" > /dev/nullif [ $? = 0 ];then/usr/scripts/clean/remkernels 2>/dev/nullfi
This will be great for those of us like me who dread the Terminal.
So far ...
#!/bin/bashOLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)YELLOW="\033[1;33m"RED="\033[0;31m"ENDCOLOR="\033[0m"if [ $USER != root ]; then echo -e $RED"Error: must be root" echo -e $YELLOW"Exiting..."$ENDCOLOR exit 0fiecho -e $YELLOW"Cleaning apt cache..."$ENDCOLORaptitude cleanecho -e $YELLOW"Removing old config files..."$ENDCOLORsudo aptitude purge $OLDCONFecho -e $YELLOW"Removing old kernels..."$ENDCOLORsudo aptitude purge $OLDKERNELSecho -e $YELLOW"Emptying every trashes..."$ENDCOLORrm -rf /home/*/.local/share/Trash/*/** &> /dev/nullrm -rf /root/.local/share/Trash/*/** &> /dev/nullecho -e $YELLOW"Script Finished!"$ENDCOLOR
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
rm -f ~/.cache/thumbnails/normal/*
sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
rm -r -f ~/.local/share/Trash/files/*
apt-get autoremove
deborphan | xargs apt-get -y remove
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
sudo apt-get update && sudo apt-get install lite-cleaner