|
|
#1 |
|
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) |
|
|
|
|
|
#2 |
|
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).
|
|
|
|
|
|
#3 |
|
MVP
Join Date: Apr 2002
Location: UK
Posts: 1,212
|
... 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+ |
|
|
|
|
|
#4 |
|
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 |
|
|
|
|
|
#5 |
|
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
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. |
|
|
|
|
|
#6 |
|
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) |
|
|
|
|
|
#7 |
|
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
__________________
- Greg Happy user of OS X since the Public Beta. Help Team Mac OS X cure cancer, Alzheimer's, ALS, Parkinson's, and more! |
|
|
|
|
|
#8 | |||||||||||||||||||
|
MVP
Join Date: Apr 2002
Location: UK
Posts: 1,212
|
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+ |
|||||||||||||||||||
|
|
|
|
|
#9 |
|
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+"$@"}
|
|
|
|
|
|
#10 | |||||||||||||||||||
|
Prospect
Join Date: Feb 2003
Posts: 26
|
Re: ya read my mind
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. |
|||||||||||||||||||
|
|
|
![]() |
|
|