Results 1 to 2 of 2

Thread: Linux trash bin

  1. #1
    Old Fart
    Join Date
    Jun 2002

    Linux trash bin

    I just thought I would share a little tidbit that I received in a newsletter today. I'm attaching the .tar file, including the steps to configure and including a link to the download page if you prefer to get it that way. Linux users check it out....you can have a "recycle bin" (we all delete the wrong thing every once in a while) all your own!

    Configuring libtrash
    Oddly enough, before you install libtrash, you must configure it. The libtrash-1.8/libtrash.conf file comes preconfigured with default settings. When libtrash is compiled, the /etc/libtrash.conf file is created, but this file only reflects the default configuration of libtrash.
    That doesn't mean you can't reconfigure libtrash. It just takes a little extra work. There are two configurations available when libtrash is activated:
    * Systemwide configuration: This is used for all users. This configuration is read from the /etc/libtrash.conf file.
    * Personal configurations: Each user may use a separate configuration. Separate configurations are enabled through settings read from the .libtrash file in the home directory of each user.
    Systemwide configuration
    Systemwide settings are made through the /etc/libtrash.conf file. The required settings must be made prior to compiling libtrash. Changing the /etc/libtrash.conf file after compiling libtrash will not change the default behavior of the program. To enforce the idea that this file should never be edited, no users are given write permission to this file. The /etc/libtrash.conf file is a read-only file for all users, including root. Therefore, you'll make changes to the libtrash-1.8/libtrash.conf file prior to installation.
    There are four entries in the libtrash.conf that are used as environmental variables and cannot be changed by a user's personal configuration settings when libtrash is run. These four settings are:
    * DEBUG
    The next four settings allow libtrash to intercept the standard routines Linux uses when files are unlinked or renamed. Your safest bet is to use the defaults for all of these settings:
    More options, more control
    The rest of the options give you more control over libtrash. These options are:
    * TRASH_CAN = Trash
    This entry sets the name for the subdirectory where deleted files will be stored. The default name for this directory is Trash. Any name may be used. To change the directory name, enter the new name without any slashes.
    This setting determines how libtrash reacts when there is a failure. Setting this value to PROTECT prevents files from being deleted by the standard Linux function. Setting the value to ALLOW_DESTRUCTION overrides libtrash.
    This setting enables a warning message for libtrash. It's normally a good idea to remind users that their files will be permanently deleted when libtrash is disabled. This is especially true if users on the system are new to Linux or for users who assume libtrash is always running.
    This setting protects files in the trash from being deleted. Files placed in the user's trash represent a special case. Libtrash functions by sending deleted files to a trashcan in the user's home directory. When the user wants to delete files in the trashcan, the default libtrash doesn't work.
    This setting allows you to specify files with specific extensions that may be deleted without being copied to the trashcan. To specify which types may be ignored by libtrash, create a semicolon-delimited separated list of the file extensions to be ignored. Do not include a dot (.) before the extension. For example, to allow .o, .c, and log files to be deleted without being moved to the trashcan, use this entry: IGNORE_EXTENSIONS = o; c; log
    Hidden files and files inside hidden directories may be sent to the trash. Setting this entry to YES allows Linux to delete hidden files without moving them to the trash. Stick with the default value of YES and override it if you must on a per-user basis.
    This entry will ensure that backups of important files are always sent to the trash. These are files that end with a tilde (~). The default is YES. Changing this setting might be a good idea.
    This entry concerns temporary files created by editors. Setting this entry to YES allows these temporary files to be removed without moving them to the trash. Set the entry to NO to allow libtrash to move these files to the user's trash. Stick with the default and change this setting on a per-user basis.
    This entry provides protection for the user's personal libtrash configuration file. Removing your own configuration file will cause unexpected actions from libtrash. Leave this setting alone.
    The TRASH_SYSTEM_ROOT variable specifies the location of the directory under the trash that will function as the root (/) of the file system whenever the GLOBAL_PROTECTION variable is set to YES. If global protection is not used, this variable is ignored. This variable always uses a directory name with no slashes. The default setting is TRASH_SYSTEM_ROOT = SYSTEM_ROOT.
    * UNREMOVEABLE_DIRS=/bin;/boot;/dev;/etc;/lib;/sbin;/usr
    Any directory on the system can be marked as an unremoveable directory. All files in these directories are protected from deletion by any user running libtrash. This may be the most important step in the entire libtrash configuration process. By carefully establishing a list of protected directories, the administrator can prevent users from either accidentally or intentionally removing critical directories and files. The default list is a commented line in the /libtrash.conf file. To activate this list, remove the comment (#) from the beginning of the line. To add additional directories, add a semicolon to the end of the line, and then add the path to the directory you want protected. In the example, the directory /usr/local/users has been added to the default entry to protected programs.
    Any directories listed as unremoveable may be temporarily removed from the above list by adding the directory to the UNCOVER_DIRS list. The default list is empty. Leave it empty. Any files that need to be uncovered should be added to an UNCOVER_DIRS list in the user's personal configuration file. This prevents all users from being able to remove specified directories.
    The USER_TEMPORARY_DIRS entry specifies a directory or list of directories under the user's home directory where temporary files are created. Files in these directories are always permanently deleted. Leave this setting if you don't require this feature.
    This setting prevents copies of removeable media from being copied to the trashcan when global protection is used. The REMOVEABLE_MEDIA_NMOUNT_POINTS setting is activated by default. This setting is ignored when global protection is disabled.
    The EXCEPTIONS setting is used to remove protection from files normally considered unremoveable. This allows essential actions by programs, such as creating or deleting a lock file or mounting/unmounting a drive, and may require some files in the UNREMOVEABLE_DIRS setting to be created and deleted. The default entry is EXCEPTIONS = /etc/mtab; /etc/resolv.conf; /etc/adjtime; /etc/upsstatus

    Libtrash Author's (download) page found here.
    It isn't paranoia when you KNOW they're out to get you...

  2. #2
    Junior Member
    Join Date
    Sep 2001

    Uhm, stupid question

    Okay, stupid question. I don't know much about graphical linux, I deal mostly in the console. Is it possible to make a link on your X desktop to /dev/null? If so, I'd prefer to use that as my recycle bin. Unless I read it wrong and this isn't only for X but just a place to put the files you want to delete and want that buffer between actual deletion and recovery... Though I really do wonder if it's possibly to put a link on your X desktop pointing to /dev/null....
    <-[ Eat, drink and be merry, for tomorrow they may cancel your visa. ]->

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts