09-17-2014, 12:04 PM
If google chrome isn't installed, the output will be:
so the script should check if $HOME/.cache/firefox, $HOME/.cache/google-chrome and $HOME/.cache/chromium folders exist.
Code:
du: cannot access ‘/home/linuxlite/.cache/google-chrome/’: No such file or directory"
Code:
#! /bin/bash
#--------------------------------------------------------------------------------------------------------
# Name: Linux Lite Cleaner
# Description: A GUI tool to easily clean your Linux Lite system.
# Authors: Misko_2083, Jerry Bezencon
# Date: September 16th, 2014
# Website: https://www.freecinema2022.gq
#--------------------------------------------------------------------------------------------------------
APTCACHESIZE=$(du -sh /var/cache/apt/archives/ | awk '{print $1}')
TRASHCACHESIZE=$(du -sh $HOME/.local/share/Trash/ | awk '{print $1}')
THUMBCACHESIZE=$(du -sh $HOME/.thumbnails/ | awk '{print $1}')
if [ -d "$HOME/.cache/mozilla/" ]; then
FFCACHESIZE=$(du -sh $HOME/.cache/mozilla/ | awk '{print $1}')
else
FFCACHESIZE=$(echo 0)
fi
if [ -d "$HOME/.cache/google-chrome/" ]; then
GCCACHESIZE=$(du -sh $HOME/.cache/google-chrome/ | awk '{print $1}' )
else
GCCACHESIZE=$(echo nothing)
fi
if [ -d "$HOME/.cache/chromium/" ]; then
CHRCACHESIZE=$(du -sh $HOME/.cache/chromium/ | awk '{print $1}')
else
CHRCACHESIZE=$(echo nothing)
fi
# I've noticed that the dialog window icon doesn't match the menu icon, next line will fix this
ic="/usr/share/pixmaps/litecleaner.png"
# the other part is the same...