From Gentoo Wiki
Jump to:navigation Jump to:search
This page has been nominated for deletion.

The given reason is: Abandoned software which cannot be installed in modern times

If you disagree with its deletion, do not remove this notice; discuss your objections on the associated discussion page.

Administrators, please remember to check if anything links here and the page history before deleting.

This notice should remain for a minimum of 1 month after it was placed on the page. If discussion is still ongoing it should remain until a consensus is reached, at which time the page may be deleted or this notice may be removed. (However, if the page has only been edited by the user who nominated it for deletion and/or is in the nominator's user space, then a speedy deletion may be called for.)
The information in this article has been deprecated. It may or may not be relevant for contemporary usage. Handle with care!
Manage web-browser home profile and cache directories in temporary filesystem in order to improve responsiveness while keeping disk read/write low

Browser-Home-Profile is a shell script that manage web browsers home profile and cache directories similar to Profile-Sync-Daemon[1] bash script. However, bhp does not touch the underlying profile and cache directories contrary to psd with symbolic links which can render the profile/cache direcories unusable; it just bind mount temporary file system (see tmpfs for more info) on the directories leaving the default profile and cache directories usable no matter what may happen.

And lastly the script can be sourced in ~/.profile or ~/{,ba,z}shrc, by setting up the necessary directory first; and then, sub-sequent bhp commands in a terminal will, first, decompress the archived profile and cache directories and finally update the tarball archives by maintaining an extra backup archive.

So, an empty profile is thus the default when the script is sourced. Still, there is bash and zsh alternative which are optimized to be integrated into ~/.bashrc[2] or ~/.zshrc[3].

A module[4] for zprezto[5] is also available for zsh.


First getting bar-overlay[6] is necessary only for the POSIX shell script, else, follow the links for the other variant tailored to be sourced in a (login) shell.

layman is optional in this process especiallay if /etc/portage/repos.conf configuration set up is used which make it easy to add new overlays by simply adding a repos.conf file. Else, the easy way is using layman[git] (with git USE flag enabled.)

root #layman -a bar
root #emerge --ask www-misc/browser-home-profile



There is nothing in particular to configure if theses scripts are used as standalone shell script. Just checkout the various options offered, notably the compressor command line switch.

When sourced, bhp.{ba,z}sh shell scripts offer the opportunity to finely set up the options and sub-profile by setting bhp associative array. zprezto module use zstyle framework for configuration, refer to the file for more info.


When source, the first login shell will prompt to enter a pass phrase to bind mount the profile and cache directories to randomly generated temporary directories. Or else, similarly, a set up phase is required when any variant is executed or sourced the first time. Sub-sequent call will maintain the tarball archives backup.

So setting up sudo to give users the ability to mount drectories might be necessary if a pass phrase less set up is required. Fire up visudo in order to add a mount command group along with its execution permission set up.

FILE /etc/sudoerssudoers example
Cmnd_Alias	MOUNT = /bin/mount, /bin/umount, /usr/bin/udevil, /usr/bin/eject
Of course the bracketed elipses should be removed; and the others command aliases should be removed as well if not used. Second, adding users to tho @adm group should be done as well with `gpasswd --add $USER adm' to get the desired effect.


First, bhp would guess a web browser name if none is passed as the last argument and use the first match found! Still, this is only a warning. However, a more efficient way would be to append a browser name to set up.

bhp is not mean to be used by super user (root) so there is nothing special to specify a particular user, or rather home directory, but set HOME environment variable to get the desired effect in the right home directory. Specifying any particular profile, if many profile are available with e.g. firefox, can be done by either passing the browser name as the last argument or setting BROWSER environment variable.

Automatic backup

So, using a cron job to handle automatic backup should ensure the right USER and HOME environment variables to get the desired effects.

FILE /etc/cron.hourly/bhpcron example
*/30 * * * * HOME="$HOME" /usr/bin/ --profile=abcdef01 firefox
# or else, using ~/bin/bhp.{ba,z}sh variant
*/30 * * * * $USER $HOME/bin/bhp.bash --profile=abcdef01 firefox

Alternatively atd from sys-process/at package can be used when need be to schedule backups.

Manual backup

Users using many terminals and accustomed to text interface would far prefer firing up a bhp command when need be. The author of this article prefer saving nad restoring when need be instead of an automatic setup. So, an empty profile, or anonymous, is available as long as a bhp command was not used. Similarly, saving is done when appropriate and the desire to save a particular session point is needed. And thus, using the right shell script for the shell in question seems to be more a propos about this kind of usage.

See also