[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Libtrash: Have any of you successfully activated it?



From the link that you so handily provided in your OP:

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
    * PERSONAL_CONF_FILE
    * WARNING_STRING
    * UNCOVER_DIRS


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:

    * INTERCEPT_UNLINK= YES
    * INTERCEPT_RENAME = YES
    * INTERCEPT_FOPEN
    * INTERCEPT_OPEN


More options, more control
The rest of 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.
    * IN_CASE_OF- FAILURE =
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.

    * SHOULD-WARN = YES
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.
    * PROTECT_TRASH = YES
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.
    * IGNORE_ENTENSIONS =
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_ENTENSIONS = o; c; log
    * IGNORE_HIDDEN = YES
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.
    * IGNORE_EDITOR_BACKUP = NO
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.
    * IGNORE-EDITOR-TEMPORARY = YES
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.
    * LIBTRASH_CONFIG_FILE_UNREMOVEABLE = YES
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.
    * TRASH_SYSTEM_ROOT
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.
    * UNCOVER_DIRS =
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.
    * USER_TEMPORATY_DIRS = temp
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.
    * REMOVEABLE_MEDIA_NMOUNT_POINTS
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.
    * EXCEPTIONS
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


Study these entries, and consider your system requirements. Once the configuration settings are entered, the next step is to compile and install libtrash.

Creating a personal configuration file
Personal configurations are created in each user's home directory. These settings are identical to the ones in the libtrash.conf file mentioned above, and, unless stated above, you should override the settings. For example, you could create the file ~/.libtrash in your home directory with these entries:

    * GLOBAL_PROTECTION = NO
    * IGNORE EXTENSIONS = bat; exe;com


These entries disable global protection, and allow any files with the extension bat, exe, or com to be permanently deleted without moving them to the trash.

On multiuser systems, the administrator will probably want all users or groups of users to be able to use libtrash. On these systems, the root user should create a standard libtrash configuration for each group of users requiring a predefined configuration.

On 04/24/2011 05:54 PM, Jason Hsu wrote:
The files that I deleted or removed with "rm" didn't show up in the Trash folder.  I tried adding those commands to the /etc/profile file and the /home/(username)/.bashrc files, but that didn't work.

What's the proper way to configure libtrash?  Is it working on your computer?  When you delete a file in the GUI or remove it with the "rm" command, does it show up in your Trash folder?

On Sun, 24 Apr 2011 17:41:52 -0500
Ron Johnson<ron.l.johnson@cox.net>  wrote:

Define "didn't work".  Returned an error message?

Adding that code to /home/(username)/.bashrc didn't work either.

Has ANYONE successfully implemented libtrash?


Did you configure it properly?




--
"Neither the wisest constitution nor the wisest laws will secure
the liberty and happiness of a people whose manners are universally
corrupt."
Samuel Adams, essay in The Public Advertiser, 1749


Reply to: