(09-05-2014, 09:28 PM)Valtam link Wrote: [quote author=misko_2083 link=topic=829.msg4678#msg4678 date=1409925836]
May I see the code? I have a few ideas.
Sure, keep in mind I haven't written any of the scripts yet, just this:
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 9th, 2014
# Website: https://www.freecinema2022.gq
#--------------------------------------------------------------------------------------------------------
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 scripts
echo $selection | grep "Clean package cache" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/aptgetclean 2>/dev/null
fi
echo $selection | grep "Autoremove packages" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/autoremovepkg 2>/dev/null
fi
echo $selection | grep "Clear thumbnail cache" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/thumbnails 2>/dev/null
fi
echo $selection | grep "Empty all Trash Bins" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/emptytrash 2>/dev/null
fi
echo $selection | grep "Remove old kernels" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/remkernels 2>/dev/null
fi
[/quote]
Thank you. I made some modifications. Some options are preselected now and I figured out how to change the formating of the text.
More text options are here:
https://developer.gnome.org/pygtk/stable...guage.html
It looks like it only works if you set text like this
--text='<span foreground="blue"> content </span>'
with ' ' not with " "
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 9th, 2014
# Website: https://www.freecinema2022.gq
#--------------------------------------------------------------------------------------------------------
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 <span foreground="green">Safe</span>-Safe to perform, no harm can be done.\n<span foreground="#ec691d">Caution</span> - 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" \
TRUE "Clean package cache" "Packages" "Safe" "Clean downloaded .deb files from your apt cache" \
TRUE "Autoremove packages" "Packages" "Safe" "Remove packages automatically installed for programs and that are no longer present" \
TRUE "Clear thumbnail cache" "Images" "Safe" "Delete thumbnail files created when viewing images" \
FALSE "Empty all Trash Bins" "Home" "Safe" "Empty the Trash Bins for all users" \
FALSE "Remove old kernels" "System" "Caution" "Remove kernels you no longer wish to boot from" )
# Exec scripts
echo $selection | grep "Clean package cache" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/aptgetclean 2>/dev/null
fi
echo $selection | grep "Autoremove packages" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/autoremovepkg 2>/dev/null
fi
echo $selection | grep "Clear thumbnail cache" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/thumbnails 2>/dev/null
fi
echo $selection | grep "Empty all Trash Bins" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/emptytrash 2>/dev/null
fi
echo $selection | grep "Remove old kernels" > /dev/null
if [ $? = 0 ];then
/usr/scripts/clean/remkernels 2>/dev/null
fi
More suggestions...
flash cookies
rm -rf $HOME/.macromedia/Flash_Player/#SharedObjects/*
rm -rf $HOME/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/*
flash cache
rm -rf $HOME/.adobe/Flash_Player/AssetCache/*
firefox cache
rm -rf $HOME/.cache/mozilla/firefox/*.default/cache*/entries/*
firefox thumbnails
rm -rf $HOME/.cache/mozilla/firefox/*.default/thumbnails/*
firefox cookies
rm -f $HOME/.mozilla/firefox/*.default/cookies.sqlite
firefox Autocomplete history
rm -f $HOME/.mozilla/firefox/*.default/formhistory.sqlite
firefox passwords
rm -f $HOME/.mozilla/firefox/*.default/signons.sqlite
firefox site preferences
rm -f $HOME/.mozilla/firefox/*.default/content-prefs.sqlite
firefox DOM storage
rm -f $HOME.mozilla/firefox/*.default/webappsstore.sqlite
firefox session restore
rm -f $HOME/.mozilla/firefox/*.default/sessionstore.js
rm -f $HOME/.mozilla/firefox/*.default/sessionstore.bak
firefox URL history, bookmarks, downloads
rm -f $HOME/.mozilla/firefox/*.default/places.sqlite