Introduction This program is called TrashIt. It is designed to assist you with your Workbench housecleaning needs. If you are tired of selecting `Delete...' or `Empty Trash' from the WorkBench menus, this program will hopefully make life a little easier for you. This file contains all of the information contained in the online help, plus additional information that did not belong in any of the online help topics. This is version 1.20, written by Benbuck Nason on 5.5.93. Getting started WARNING! This purpose of this program is to delete files. Please use it appropriately. TrashIt is very versatile, so you can configure it in many ways. Instructions for a few configurations are listed below, but to understand why these configurations work, you should read the section on Options. At the very least, you should read the explanation of the EMPTYTIME option, because many of the other options depend on how it is set. If you just want to try TrashIt out, double click on it's icon. If everything goes well, an AppIcon will appear. Just drop files onto the AppIcon and they will be deleted. If you want TrashIt to move the files into the Trashcan(s) on your disk(s) and automatically delete them later, follow the steps below. 1. Double-click on the AppIcon. This will open the control panel. 2. Enter a time (in seconds) into the Empty Time gadget. 3. Click on the Close gadget. 4. Make sure there is a Trashcan on every disk you delete from. If you want TrashIt to delete any files you drop directly into the Trashcan on your Work: disk, follow the steps below. If you also want it to wait a little while before it deletes the files in the Trashcan, follow the steps above. 1. Double-click on the AppIcon. This will open the control panel. 2. Enter Work:Trashcan into the Trash Drawer gadget. 3. Click on the Close gadget. If you want to change the position of the AppIcon, follow the steps below. 1. Double-click on the AppIcon. This will open the control panel. 2. Enter the desired position into the Horizontal Position gadget and the Vertical Position gadget. 3. Click on the Close gadget. Overview TrashIt can be run from either a CLI, shell, or Workbench. You do not have to RUN it in order to get your command line back. Assuming TrashIt is up-and-running, whenever you want to immediately delete a file or drawer from Workbench, simply drag it onto the TrashIt AppIcon or AppWindow, or select the file, then select the AppMenuItem. The file or drawer and its icon will be deleted. You can select multiple files or drawers by holding shift while clicking each one individually, or by drag selecting them by clicking outside the icons and dragging the mouse over them. There two interesting features to TrashIt that didn't really fit anywhere but here: if you use the AppIcon, AppWindow, or AppMenuItem to delete something and TrashIt moves it into the Trashcan, you can undelete it by opening the Trashcan and deleting the file again. Also, when you delete a disk using the AppIcon, AppWindow, or AppMenuItem, TrashIt assumes that you want to Empty the Trashcan on that disk. If MESSAGES is set to OFF, then it will empty the trash immediately. Otherwise, it will ask you if this is what you want to do, and if you answer `no', then it will ask you if you want to delete all he files on the disk. If you decide to change the TrashIt options, or if you want to open the AppWindow, you will need to open the TrashIt control panel. You can do this several ways. You can double click on the AppIcon, or select the AppMenuItem (without having any files selected). You can use the Commodities Exchange program and select Show. You can use the Commodities Exchange PopKey combination. There are several ways to quit TrashIt. You can open the the control panel and click the Quit button, select Quit from the Project menu, or type the letter `Q'. You can use the Commodities Exchange program and select Kill. You can send it a Control-C from a task management program such as TaskX, ARTM, TaskTool, or Xoper. You can also use the Commodities Exchange program to Enable or Disable TrashIt, which will disable the enable or disable the deletion, but will still allow you to open the control panel and change the options. Options There are many options recognized by TrashIt, which can be given either on the command line or in the TrashIt icon ToolTypes using the Information... command from the Workbench `Icon' menu. The options are: APPICON APPICONHPOS APPICONVPOS APPICONNAME APPICONFILE FORCE DELETELIMIT EMPTYTIME TRASHDRAWER FINDTRASHDRAWERS SOUNDFILE APPWINDOW APPMENUITEM APPMENUITEMNAME MESSAGES PUBSCREEN TOOLPRI CX_PRIORITY CX_POPKEY CX_POPUP UNIT These tooltypes should already be present in the TrashIt icon ToolTypes. The DONOTWAIT ToolType should also be present so you can simply copy TrashIt to the WBStartup drawer of your system disk. Note that if you start TrashIt from a CLI or shell, it will only read options from the command line, not from the icon, even if one exists. Here is a sample of the options I use and explanations why I use them: APPICON=ON I want the AppIcon to be active. APPICONHPOS=620 Put the AppIcon at the far right of my screen. APPICONVPOS=10 Put the AppIcon near the top of my screen. APPICONNAME=The Dumper Give the AppIcon a silly name. APPICONFILE=Icons/8-Color/3-D Toilet Give the AppIcon a silly icon. FORCE=ON Override write-protection when deleting. DELETELIMIT=5 Warn me if I try to delete more than 5 files or drawers at one time, and make sure that there are never more than 5 files in a Trashcan. EMPTYTIME=1800 Empty the trash every 1800 seconds (30 minutes), not immediately. TRASHDRAWER= No trash drawer, because I use the standard Trashcans to temporarily hold deleted files. FINDTRASHDRAWERS=ON Search all disks for Trashcans when TrashIt first starts. SOUNDFILE=Sounds/Flush Play a silly sound when deleting things. APPWINDOW=ON Allow the control panel to act as an AppWindow. APPMENUITEM=OFF I don't want the AppMenuItem to be active. APPMENUITEMNAME= Since the AppMenuItem is off, this is irrelevant. MESSAGES=ON Talk to me, baby. PUBSCREEN=Workbench Open control panel on Workbench screen. TOOLPRI=0 Run TrashIt at normal priority. CX_PRIORITY=1 The higher value means that TrashIt will get commodities events before other commodities. CX_POPKEY=control lshift t Key combination to open the control panel. CX_POPUP=NO Don't open control panel when TrashIt is first started. UNIT=0 Use clipboard unit 0 for cut, copy, and paste. APPICON This option lets you specify whether or not TrashIt should create an AppIcon, which is an icon on the Workbench screen onto which you can drop files and drawers. Example: APPICON=OFF Default: APPICON=ON {ON, OFF} This corresponds to the On gadget on the control panel. APPICONHPOS This option lets you specify the x coordinate of the TrashIt AppIcon. If you don't specify a valid position, or the position you specify is over another icon, the icon will be placed in the next available spot on the screen. Example: APPICONHPOS=200 Default: APPICONHPOS= {An integer} This corresponds to the H Position gadget on the control panel. APPICONVPOS This option lets you specify the y coordinate of the TrashIt AppIcon. If you don't specify a valid position, or the position you specify is over another icon, the icon will be placed in the next available spot on the screen. Example: APPICONVPOS=100 Default: APPICONVPOS= {An integer} This corresponds to the V Position gadget on the control panel. APPICONNAME This option lets you specify the name of the AppIcon. If you don't specify a value, the name of the icon will be the name of the program (i.e., TrashIt). Example: APPICONNAME=MyTrashCan Default: APPICONNAME= {A string} This corresponds to the Name gadget on the control panel. APPICONFILE This option lets you specify the icon file that TrashIt will use when it opens the AppIcon. If you select a valid icon file, that icon's imagery will be used instead of TrashIt's icon or your system's default Trashcan icon. Example: APPICONFILE=WORK:Icons/Garbage.info Default: APPICONFILE= {A string} This corresponds to the File gadget on the control panel. FORCE This option lets you specify whether or not you want TrashIt to force deletions by deprotecting any delete protected files. Example: FORCE=ON Default: FORCE=OFF {OFF, ON} This corresponds to the Force gadget on the control panel. EMPTYTIME This option lets you specify the time, in seconds, that TrashIt will wait before it empties the trash. This is the most important option because many options are dependent on how this is set. If you do not specify a time, or if the time is not more than zero seconds, then TrashIt will delete everything immediately when you delete files using the AppIcon, AppWindow, or AppMenuItem, or when you add a file to the Trash Drawer, if you specified one. If you specify a time that is more than zero seconds, then TrashIt will attempt to move files to an appropriate location when you delete them. The locations it looks for are a Trashcan or a Trash Drawer on the disk you are deleting from, in that order. Example: EMPTYTIME=180 Default: EMPTYTIME=0 {An integer} This corresponds to the Empty Time gadget on the control panel. DELETELIMIT This option let you specify the maximum number of files that you can delete at one time (through the AppIcon, AppWindow, or AppMenuItem), without having TrashIt display a warning message. It also sets the maximum number of files that are allowed to be in a Trashcan at once. For instance if DELETELIMIT is set to 5 and there are 5 files in the Trashcan on your Work: disk, when you use TrashIt to delete another file, the oldest file in the Trashcan will be deleted and the new file will be moved into the trashcan. For this to happen, EMPTYTIME must be greater than zero. Example: DELETELIMIT=15 Default: DELETELIMIT=10 {An integer} This corresponds to the Delete Limit gadget on the control panel. TRASHDRAWER This option lets you specify the name of the drawer to use as an automatic disposal. This option is to allow you to use a drawer other than the Trashcan on your disk to throw trash into. The behavior of this is affected by how EMPTYTIME is set. Example: TRASHDRAWER=Sys:TrashCan Default: TRASHDRAWER= {A string} This corresponds to the Trash Drawer gadget on the control panel. FINDTRASHDRAWERS This option lets you specify that you want TrashIt to search all your disks for Trashcans to use for automatic disposal. These drawers are the same as the TRASHDRAWER, except that they are found automatically. If EMPTYTIME is greater than zero and this option is set to OFF, then TrashIt will search for a Trashcan at the time when you delete something. Therefore, the purpose of this option is to allow you to throw files directly into the Trashcan and have TrashIt be notified of this event, so that TrashIt can empty the Trashcan later. This option is ignored if EMPTYTIME is less than zero. Example: FINDTRASHDRAWERS=OFF Default: FINDTRASHDRAWERS=ON {ON, OFF} SOUNDFILE This option lets you specify a sound file that TrashIt will play whenever TrashIt deletes files. If you do not specify a sound file, TrashIt will beep at you when messages are turned off and it deletes something automatically, so that you don't reboot or shut off your computer at that moment. Example: SOUNDFILE=Work:Sounds/Warning.snd Default: SOUNDFILE= {A string} This corresponds to the Sound File gadget on the control panel. APPWINDOW This option lets you specify whether or not you want the TrashIt control panel to also serve as an AppWindow. This means that you can drop files onto the window and they will be delete. Of course, the control panel must actually be open for you to utilize this. Example: APPWINDOW=OFF Default: APPWINDOW=ON {ON, OFF} This corresponds to the AppWindow gadget on the control panel. APPMENUITEM This option lets you specify whether or not TrashIt should create an AppMenuItem. An AppMenuItem is a menu item that is added to the Tools menu of your Workbench screen. You can use the AppMenuItem to delete files by selecting the files then selecting the AppMenuItem. Example: APPMENUITEM=OFF Default: APPMENUITEM=ON {ON, OFF} This corresponds to the AppMenuItem gadget on the control panel. APPMENUITEMNAME This option lets you specify the name of the AppMenuItem. If you don't specify a value, the name of the menu item will be the same as the AppIcon name. Example: APPMENUITEMNAME=MyTrashCan Default: APPMENUITEMNAME= {A string} MESSAGES This option lets you specify whether or not you want TrashIt to display messages and non-fatal errors. When this option is OFF, TrashIt may play a sound or beep at certain times in order to warn you not to turn off your computer because it is deleting files, or to signal that an error occurred. Example: MESSAGES=OFF Default: MESSAGES=ON {ON, OFF} This corresponds to the Messages gadget on the control panel. PUBSCREEN This option lets you specify which Public Screen you want the TrashIt control panel to open on. Example: PUBSCREEN=Workbench Default: PUBSCREEN= {A string} TOOLPRI This option lets you specify the priority you want TrashIt to run at. Example: TOOLPRI=-1 Default: TOOLPRI=0 {A number} CX_PRIORITY This option lets you specify the priority of the TrashIt commodity. Example: CX_PRIORITY=1 Default: CX_PRIORITY=0 {A number} CX_POPKEY This option lets you specify a commodities hotkey to pop open the TrashIt control panel. Example: CX_POPKEY="control lalt b" Default: CX_POPKEY="control lshift t" (Control + Left-Shift + t) {A string} This corresponds to the CX PopKey gadget on the control panel. CX_POPUP This option lets you specify whether or not TrashIt should open the control panel when it starts. Example: CX_POPUP=NO Default: CX_POPUP=YES {YES, NO} UNIT This option lets you specify the clipboard unit number to use for cut, copy, and paste. Example: UNIT=1 Default: UNIT=0 {A number} Control Panel The control panel is what allows you to easily configure the TrashIt options to suit your personal preferences. The control panel is a window with gadgets that enable you to modify the settings that TrashIt is currently using. It also has menus for some of the options. Almost all of the Control Panel gadgets and menu items have corresponding options, so for a complete description of the item, refer to the that option. AppIcon Controls The AppIcon is an icon on the Workbench screen onto which you can drop files and drawers to be deleted. You can also double click on the AppIcon to open the TrashIt control panel. Horizontal Position This corresponds to the APPICONHPOS option. Vertical Position This corresponds to the APPICONVPOS option. On This corresponds to the APPICON option. Name This corresponds to the APPICONNAME option. File This corresponds to the APPICONFILE option. Select File This will bring up a file requester to allow you to choose an icon file for the AppIcon. Refer to the APPICONFILE option for more information. For this option to be available, you must have the ASL library. Trash Controls Trash refers to the files and drawers in the Trash Drawer(s). Empty Time This corresponds to the EMPTYTIME option. Delete Limit This corresponds to the DELETELIMIT option. Force This corresponds to the FORCE option. Trash Drawer This corresponds to the TRASHDRAWER option. Select Trash Drawer This will bring up a file requester to allow you to choose a Trash Drawer. Refer to the TRASHDRAWER for more information. For this option to be available, you must have the ASL library. SoundFile This corresponds to the SOUNDFILE option. Select Sound File This will bring up a file requester to allow you to choose a sound file. Refer to the SOUNDFILE for more information. For this option to be available, you must have the ASL library. General Controls These are the general controls. AppWindow This corresponds to the APPWINDOW option. AppMenuItem This corresponds to the APPMENUITEM option. Messages This corresponds to the MESSAGES option. Help This gives brief explanatory messages such as this one. Select the Help gadget, menu item, or key to enter and exit help mode. While in help mode, select any gadget or menu item to see a message like this one. There is also `Menu Help' available. To use Menu Help, you do not have to be in help mode. Just highlight the menu item you wish to get help on, and simultaneously press the help key. CxPopKey This corresponds to the CX_POPKEY option. Close This will close the TrashIt control panel, but will not cause TrashIt to quit. Save This will save the current TrashIt settings to the TrashIt icon ToolTypes, after displaying a requester verifying that you did not select Save accidentally. About This will give you a brief introductory message describing TrashIt. It will also tell you the version number. Quit This quits TrashIt. Edit Menu The Edit menu functions are only available when the currently selected gadget contains text or numbers that you can edit. Cut, Copy, and Paste all read or write to or from the clipboard. Cut This will copy the contents of the current gadget to the clipboard, then remove the gadget's contents. Copy This will copy the contents of the current gadget to the clipboard. Paste This will paste the contents of the clipboard into the currently selected gadget. Trashit will attempt to insert the clip into the gadget at the current cursor position. Be aware that this can be awkward for number gadgets with contents that are negative and/or a clip that is negative. This is due to the possibility of inappropriate placement of minus signs. If TrashIt detects that these conditions exist, it will completely replace the contents of the current gadget with the contents of the clipboard. Erase This will remove the contents of the currently selected gadget. Commodity If, possible, TrashIt installs itself as a commodity. This allows you to easily control it using the Commodities Exchange (CX) program that came with your system disks. If you open the Commodites Exchange window, there will be a list of all the commodities currently installed on your system. If you find `TrashIt' in the list and click on on it, you will be able to use the rest of the CX gadgets to control TrashIt. There are also several options and a control panel gadget that let you control the TrashIt commodity: CX_PRIORITY option CX_POPKEY option CX_POPUP option CxPopKey gadget Bugs There are no known bugs in TrashIt. However, having written the code myself, I can definitely say that TrashIt might not be very well behaved under low memory conditions. It has been beta tested on various machines (500, 1000, 2000, 1500, 3000, 4000) and operating systems (2.04, 2.1, 3.0, 3.1). Please cease to use TrashIt if you notice any strange behavior, and PLEASE report any bugs you find. I really hope you don't unintentionally delete any files because of this program. Please don't use it if you do not have backup copies of all your files. Rest assured, though, that I use this program constantly, so I will (hopefully) find and fix any bugs that may exist. You can send bug reports or enhancement requests through regular mail or email. Reaching the Author You can reach me (Benbuck Nason) at the following places: 416 Mott St. Santa Cruz, CA 95062 email: torp@cats.ucsc.edu school (preferred) benbuck@mri.com work Cal's Amiga Den (408-688-4074) as Ben Nason. So, this program is completely freely distributable, but please be sure to include this document if you distribute it, so that nobody has to experiment to figure out what the options do and end up erasing an entire disk. (Not easy to do - TrashIt check to make sure this doesn't happen accidentally.) I'm not asking you to send me anything except bug reports and suggestions for possible future versions. Future I have many ideas in mind for future versions of TrashIt. The most important thing is to completely revise the control panel. I ran out of room for new options a while ago, which is why some of the options aren't available on the control panel. After that, I would like to add some more options, an ARexx port, online AmigaGuide help, etc. However, I would love to hear your ideas for features that you would like to have. Feel free to contact me with any request you want, no matter how big or small. You can also contact me if you would like to be a beta tester. Beta Testers I have several beta testers who I would like to thank: Brian M. Aljian (smythe@cats.ucsc.edu) Joe Hartley (jh@cadre.com) Marek Janous (XMJS@sb.vse.cs) Paul Kienitz (paulk@terapin.com) Scott MacDonald (macdons@uhura.aston.ac.uk) Michael Phipps (MJP3783@ritvax.isc.rit.edu) Daniel F. Seidel (dfs5716@usl.edu) Eric van Wessel (emwessel@cs.ruu.nl) And especially: Gregory R. Block (gblock@csd4.csd.umw.edu) Nicolas Dade (u2203@sparc0a.cs.uiuc.edu) Mike Daneilson (miked@boilerbob.corp.mot.com) Mickey Everts (evermic@xanth.cs.orst.edu) Greg Flenton (gflenton@undergrad.math.uwaterloo.ca) Paul C. Miranda (mustang@ccwf.cc.utexas.edu) Michael Nerone (nerone@ccwf.cc.utexas.edu) Please contact me if you would like to become a beta tester. I prefer people who know how to use MungWall and Enforcer if their hardware allows, but this is not a requirement. You will have to have an email address, be able to uudecode, and be able test programs and respond to mail in a timely manner. Revision History 1.20 5.5.93 Current release. I fixed an error that was causing crashes when deleting files on machines with a 68040, added a few useful options (Delete Limit, undelete, empty trash when disk dropped), fixed an error that caused TrashIt to hang when it tried to play a sound but couldn't allocate the audio device, fixed an error that caused TrashIt to hang for some people when searching for trashcans on all volumes, and cleaned up a little here and there. 1.20beta 4.2.93 Release to beta testers. I revamped the code to be more modular, added clipboard support, improved deletion error handling, made the sound player a separate task, and added several other minor enhancements. I also found and removed several bugs. 1.11 3.13.93 Internal release. There were no bugs reported by the beta testers, but they did suggest quite a few minor enhancements, so I implemented them. 1.1beta 2.4.93 Release to beta testers. Too many improvements to list. Not one line of code survived from the old version. 1.0 8.15.92 Initial release. Very simple, with no options, but didn't work very well.