Go Back   The macosxhints Forums > Working with OS X > Tweaking OS X / Wish List



Reply
 
Thread Tools Display Modes
Old 02-24-2003, 03:24 AM   #1
pyrohotdog
Triple-A Player
 
Join Date: Mar 2002
Location: Coeur d'Alene
Posts: 80
how much is in the trash...

Remember back in OS9 and earlier, how when you went to empty the trash, it would tell you how much the trash contains? ahh, I miss that! Anyone have any idea how to bring that back in to OSX?

should be interesting to see the ideas that come up for this...
__________________
I wish I could fly....(jumping up and down waving arms franticaly)
pyrohotdog is offline   Reply With Quote
Old 02-24-2003, 01:43 PM   #2
ebow
Triple-A Player
 
Join Date: Jan 2002
Location: 0x4D41
Posts: 105
Wish I knew...

Until someone finds a way, I just select all (cmd-A) and then get info (cmd-I). Not quite seamless, but the info is only 2 keyboard shortcuts away (plus one to close the info window).
ebow is offline   Reply With Quote
Old 02-24-2003, 06:38 PM   #3
djn1
MVP
 
Join Date: Apr 2002
Location: UK
Posts: 1,212
Wink a virtually useless answer ...

... but the best I can come up with:

du -sk /Users/<username>/.trash
__________________
chromasia

G4/800, OS 10.3.x, 1.25GB RAM, 2x80GB HD, 60GB firewire, Geforce4MX, Iiyama VMpro 455+413
Goldtouch keyboard, Cirque EasyCat trackpad, D-Link DSL-604+
djn1 is offline   Reply With Quote
Old 02-24-2003, 06:44 PM   #4
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
to get all partitions...

Code:
$ sudo du -sk ~/.Trash/ /.Trashes/ /Volumes/*/.Trashes/
0       /Users/merv/.Trash
0       /.Trashes
0       /Volumes/banshee/.Trashes
0       /Volumes/chunder/.Trashes
0       /Volumes/data/.Trashes
0       /Volumes/ebola/.Trashes
44184   /Volumes/flivver/.Trashes
0       /Volumes/gunt/.Trashes
0       /Volumes/hell/.Trashes
0       /Volumes/meow/.Trashes
0       /Volumes/tango/.Trashes
0       /Volumes/whiskey/.Trashes
0       /Volumes/zulu/.Trashes
mervTormel is offline   Reply With Quote
Old 02-26-2003, 01:11 AM   #5
xchanyazy
All Star
 
Join Date: Jan 2002
Location: Dexter, MI, USA
Posts: 704
Well, I was kind of bored, so I decided to mess around. I came up with this script, which I then saved as a run-only script, and threw in my dock next to the trash can. I'm sure it can be improved a lot (for instance, this only counts the amount in your user trash (not the volumes like merv has)), but it works for me.

Code:
set amount to do shell script "du -sk ~/.trash | awk '{print $1}'"
display dialog "There are " & amount & " kb in trash.  Would you like to empty?"
if button returned of result = "OK" then
	tell application "Finder"
		empty trash
	end tell
end if
Hope someone makes sense of this...

EDIT: Maybe I should explain what (I think...) this code does.

The first line uses the terminal code given by the other posters and then takes the kb from the first column and stores it in a variable. The next line displays the message including the size of the trash. The next line checks to see if you said ok, and if it does, tells the finder to empty the trash. That's it.
__________________
- Greg

Happy user of OS X since the Public Beta.
Help Team Mac OS X cure cancer, Alzheimer's, ALS, Parkinson's, and more!

Last edited by xchanyazy; 02-26-2003 at 01:15 AM.
xchanyazy is offline   Reply With Quote
Old 02-26-2003, 01:24 AM   #6
pyrohotdog
Triple-A Player
 
Join Date: Mar 2002
Location: Coeur d'Alene
Posts: 80
ya read my mind

hey thanks! I was hard at work myself on an AppleScript to do the same thing, but with my VERY limited knowledge of AS, I wasn't getting to far...

But...if you save that as an app, and just click it when you want to emtpy the trash, it takes more time to launch then it's worth! Is there someway to speed up the process? I miss folder actions too.....

now if someone can find a way to convert the KB to MB......just like old times...
__________________
I wish I could fly....(jumping up and down waving arms franticaly)
pyrohotdog is offline   Reply With Quote
Old 02-26-2003, 01:39 AM   #7
xchanyazy
All Star
 
Join Date: Jan 2002
Location: Dexter, MI, USA
Posts: 704
Sure, you could just add this line between the first and second lines:
Code:
set amount to amount / 1024
and change the dialog from kb to mb
__________________
- Greg

Happy user of OS X since the Public Beta.
Help Team Mac OS X cure cancer, Alzheimer's, ALS, Parkinson's, and more!
xchanyazy is offline   Reply With Quote
Old 02-26-2003, 02:32 AM   #8
djn1
MVP
 
Join Date: Apr 2002
Location: UK
Posts: 1,212
Quote:
But...if you save that as an app, and just click it when you want to emtpy the trash, it takes more time to launch then it's worth!

Check the 'Stay Open' option when you save it as an application.
__________________
chromasia

G4/800, OS 10.3.x, 1.25GB RAM, 2x80GB HD, 60GB firewire, Geforce4MX, Iiyama VMpro 455+413
Goldtouch keyboard, Cirque EasyCat trackpad, D-Link DSL-604+
djn1 is offline   Reply With Quote
Old 02-28-2003, 03:21 PM   #9
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
to get all partitions:
Code:
$ sudo du -sk ~/.trash /Volumes/*/.trashes/ | \
    awk "{sum += \$1} END{print sum}" ${1+"$@"}
mervTormel is offline   Reply With Quote
Old 02-28-2003, 04:32 PM   #10
gnome
Prospect
 
Join Date: Feb 2003
Posts: 26
Re: ya read my mind

Quote:
I miss folder actions too.....

You can have them back! It takes some experimenting, but if you double click on Applications/AppleScript/ScriptMenu.menu, and go to the little script icon in the left side of your menu bar, there is an AppleScript to enable/disable Folder Actions, and then some scripts to show you how to use them. I'm not sure if it works exactly the way it did in OS 9, but I'd check it out.

To uninstall Script Menu, drag it from the menu bar with the Command key depressed.
gnome is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:55 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.