0 Members and 3 Guests are viewing this topic.
du: cannot read directory ‘/home/misko2/.thumbnails/’: Permission denied
THUMBCACHESIZE=$(du -sh /home/*/.thumbnails/ | awk '{print $1}')
sudo apt-get update && sudo apt-get install lite-cleaner
No,when Quit is clicked it will open a message. It should just quit.
The only thing I can't fix is that message when I click on Quit: 'Nothing was selected.'.I guess I can always change the message to 'Nothing was selected or you pressed Quit.'
When I was in windows (last week) I used a free program called CCleaner it seemed to do the job quite well and had/has a number of functions from cleaning to registry checking to uninstalling unwanted progs and their components. I don't know how much of that sort of thing would apply to LL. but something similar might be good.
#! /bin/bashic="/usr/share/icons/zenity-llcc.png"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)# check if there are old kernelsecho "$OLDKERNELS" | grep linux*if [ $? = 1 ]; thenzenity --error \--title="Error" --text="No old Kernels found."exit 0fi# sed command adds all FALSE entries in the column 'Select'# separator sets the separator in the output of the checklist, could be a new line \n or anything elseselection=$(echo "$OLDKERNELS" | sed -e 's/^/FALSE\n/' | zenity --window-icon="$ic" --list --checklist --separator=" " --width=890 --height=400 --column='Select' --column='Kernel' \--text=' ' --title="Lite Cleaner" --ok-label="Clean" --cancel-label="Quit" ) #check if any item was selectedecho "$selection" | grep linux*if [ $? = 1 ]; thenzenity --error \--title="Error" --text="Nothing was selected."exit 0fizenity --question --title="Question" --text="Do you want to proceed?" if [ "$?" -eq "0" ]; thengksudo -g --message 'To run this cleaner your password is required. Enter your password, or press Cancel.' "sudo apt-get purge -y $selection" | zenity --progress --title='removing kernel/header' --text='Uninstalling...' --no-cancel --pulsate --width=400 --auto-close --auto-kill if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error \ --title="Error" --text="Uninstall has failed." exit 0 fielse exit 0fi PROCEED=$(zenity --info --title="Cleaner" --text="The cleaner has finished."; echo $?) if [ ${PROCEED} -eq 1 ]; then zenity --info --title='Cleaner' --text='Clean Complete.'exit 0 fiexit 0
#! /bin/bash#--------------------------------------------------------------------------------------------------------# Name: Old Kernel Remover GUI# Description: Prints out old kernels and removes them.# Authors: Misko_2083, Jerry Bezencon# Date: September 9th, 2014# Website: https://www.linuxliteos.com#--------------------------------------------------------------------------------------------------------ic="/usr/share/icons/zenity-llcc.png"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)# sed command adds all FALSE entries in the column 'Select'# separator sets the separator in the output of the checklist, could be a new line \n or anything elseselection=$(echo "$OLDKERNELS" | sed -e 's/^/FALSE\n/' | zenity --window-icon="$ic" --list --checklist --separator="" --width=890 --height=400 --column='Select' --column='Kernel' \--text=' ' --title="Lite Cleaner" --ok-label="Clean" --cancel-label="Quit" ) echo $selection | grep linux-headers-linuxlite-3.15.0if [ $? = 0 ];thengksudo -g --message '.' "sudo apt-get purge linux-headers-linuxlite-3.15.0 --force-yes -y" | zenity --progress --title="removing kernel" --text="Uninstalling headers 3.15.0..." --pulsate --width=400 --auto-close --auto-killfiecho $selection | grep linux-image-linuxlite-3.15.0if [ $? = 0 ];thengksudo -g --message '.' "sudo apt-get purge linux-image-linuxlite-3.15.0 --force-yes -y" | zenity --progress --title="removing kernel" --text="Uninstalling image 3.15.0..." --pulsate --width=400 --auto-close --auto-killfi
Have started on some of the scripts. Here's what the apt cache cleaner looks like, printing the directory size.
#! /bin/bashic="/usr/share/icons/zenity-llcc.png"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)# sed command adds all FALSE entries in the column 'Select'# separator sets the output of the checklist, "\n" can also be usedselection=$(echo "$OLDKERNELS" | sed -e 's/^/FALSE\n/' | zenity --window-icon="$ic" --list --checklist --separator=" " --width=890 --height=400 --column='Select' --column='Kernel' \--text=' ' --title="Lite Cleaner" --ok-label="Clean" --cancel-label="Quit" ) # Next line just tests the output of a checklistecho "$selection"# Next line deletes all of the selected kernels# gksudo "$(echo "$selection" | sed -e 's/^/sudo apt-get purge -y /')"
Quote from: misko_2083 on September 05, 2014, 10:03:56 AMMay 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: [Select]#! /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
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
#! /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 <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 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