You are Here:
Download Linux Lite 5.4 Final today - See Release Announcements



X Close Ad
X Close Ad
Lite Tweaks - Suggestions welcomed

Author (Read 82061 times)

0 Members and 1 Guest are viewing this topic.

Re: Lite Cleaner - Suggestions welcomed
« Reply #15 on: September 07, 2014, 03:13:08 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Have started on some of the scripts. Here's what the apt cache cleaner looks like, printing the directory size.
Nice.
I've had some experiments on removing individual old kernels instead of all old kernels.
Code: [Select]
#! /bin/bash

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 output of the checklist, "\n" can also be used
selection=$(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 checklist
echo "$selection"
# Next line deletes all of the selected kernels
# gksudo "$(echo "$selection" | sed -e 's/^/sudo apt-get purge -y /')"
 


Re: Lite Cleaner - Suggestions welcomed
« Reply #16 on: September 08, 2014, 02:26:10 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8054
    Posts
  • Country: nz
  • Reputation: 750
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.4 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Awesome stuff misko, I really like that and can't wait to test. What sort of results have you had so far?
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #17 on: September 08, 2014, 08:44:59 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
So far it's working with an old  3.15.0 kernel.

So I've used this to uninstall it.
Code: [Select]
#! /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 else
selection=$(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.0
if [ $? = 0 ];then
gksudo -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-kill
fi

echo $selection | grep linux-image-linuxlite-3.15.0
if [ $? = 0 ];then
gksudo -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-kill
fi
And it worked. When I start the script again I get this:
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #18 on: September 08, 2014, 11:14:14 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
OK so I made a lot of changes.
First the script checks if there are any old kernels/headers...
If there are no old kernels it will just display a message.
This version will purge any output it gets from $checklist.
If no item was selected it will display a message 'Nothing was selected.'.
Cancel button in the progress bar is hidden.
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.' :)
Code: [Select]
#! /bin/bash

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)

# check if there are old kernels
echo "$OLDKERNELS" | grep linux*
if [  $? = 1 ]; then
zenity --error \
--title="Error" --text="No old Kernels found."
exit 0
fi

# 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 else
selection=$(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 selected
echo "$selection" | grep linux*
if [ $? = 1 ]; then
zenity --error \
--title="Error" --text="Nothing was selected."
exit 0
fi

zenity --question --title="Question"  --text="Do you want to proceed?"
 if [ "$?" -eq "0" ]; then
gksudo -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
    fi
else
exit 0
fi
   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
   fi
exit 0
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #19 on: September 09, 2014, 04:21:28 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8054
    Posts
  • Country: nz
  • Reputation: 750
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.4 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Absolutely fantastic :)

Sent from my GT-N7000 using Tapatalk

 

Re: Lite Cleaner - Suggestions welcomed
« Reply #20 on: September 10, 2014, 04:05:45 PM »
 

rijnsma

  • Forum Regular
  • ***
  • 211
    Posts
  • Reputation: 16
  • Never give up..
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.

:)
Is it still around... ??? Good program and together with other tools great in cleaning the Windows 'register'. Lot of work, but it cán pay off...
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #21 on: September 10, 2014, 04:58:56 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Country: gb
  • Reputation: 404
  • Linux Lite "Advocate"

  • Linux Lite: 2.8 64bit

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)

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.' :)

If I understand this scenario, which may not be the case...?
It when there is nothing showing to select?
So how about
"No Old Kernels Available To Remove"
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #22 on: September 10, 2014, 05:43:21 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
No,when Quit is clicked it will open a message. It should just quit.
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #23 on: September 10, 2014, 05:52:53 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Country: gb
  • Reputation: 404
  • Linux Lite "Advocate"

  • Linux Lite: 2.8 64bit

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
No,when Quit is clicked it will open a message. It should just quit.

Argh O.K... Understould, "Quit" is just not quitting O.K
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #24 on: September 15, 2014, 11:21:53 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8054
    Posts
  • Country: nz
  • Reputation: 750
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.4 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Lite Cleaner is now available for download:

Code: [Select]
sudo apt-get update && sudo apt-get install lite-cleaner
Current version: litecleaner_1.0-0030

Installs to: Menu, System, Lite Cleaner or you can run lite-cleaner from the command line.

Once the kernel portion is perfected we will include that is a future for release but for now, there should be enough tools there to clean some peoples systems significantly. A HUGE thank you to those who contributed code and ideas, this couldn't be possible without your input, so I thank you all, and so do the people who use our software :)



Last Edit: September 15, 2014, 11:56:49 AM by Valtam
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #25 on: September 15, 2014, 12:26:24 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
It's not working well when you have multiple users.
When I start it from terminal:
Code: [Select]
du: cannot read directory ‘/home/misko2/.thumbnails/’: Permission deniedThat's because it will try to display cache size from all the users:
Code: [Select]
THUMBCACHESIZE=$(du -sh /home/*/.thumbnails/ | awk '{print $1}')
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #26 on: September 15, 2014, 12:35:51 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8054
    Posts
  • Country: nz
  • Reputation: 750
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.4 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Thanks misko_2083, I will fix this :)
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #27 on: September 15, 2014, 12:59:13 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8054
    Posts
  • Country: nz
  • Reputation: 750
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.4 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Ok, I have limited this to per-user function. I think it's a more sensible approach as people will probably not want others messing with their home folder on multiple user systems.
 

Re: Lite Cleaner - Suggestions welcomed
« Reply #28 on: September 15, 2014, 08:03:10 PM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Country: 00
  • Reputation: 305
    • Try to Grow

  • Linux Lite: 3.2 64bit

  • Kernel: 4.x
Hello,
Thank you everyone for the ideas and work in making the Lite Cleaner.  8)


 

Re: Lite Cleaner - Suggestions welcomed
« Reply #29 on: September 15, 2014, 08:14:38 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Ok, I have limited this to per-user function. I think it's a more sensible approach as people will probably not want others messing with their home folder on multiple user systems.
Cool, tested and it's all ok now.
That approach is much better.

One more thing.
Maybe you could make a contest on the forum for the design of that lite-cleaner icon.
This one looks a like a toaster that's stuck in the golf hole. :D
 


Tags:
 

X Close Ad
X Close Ad

Download Linux Lite 5.4 Final today - See Release Announcements