"Working Directory"
http://nedric.org/wiki/WorkingDirectory
Developed by Karlin Fox (fox@atomicobject.com)
With help and advice by David Crosby.
Requires bash and perl, for now.
Working Diectory (wd) is a system of scripts and aliases that allows named storage of directories, as well as quick retrieval of previously stored directories. It has support for varying schemes of working directories.
-- INSTALLATION
The easiest way to install (except the man page, see below) is just:
$ ./install.sh
This will put the necessary files in "$HOME/.wd". If you want it somewhere else, just put the files in the 'wd' directory of the package wherever you want. Then add the following lines to your .bashrc file (or appropriate equivalent thereof.)
export WDHOME=$HOME/.wd
source ~/.wd/wdaliases.sh
Note that there is a man page included. This file is not installed because of platform inconsitency. Please copy this file (wd.1.gz) to your man page directory. For linux, that is usually /usr/share/man/man1 or similar.
-- USAGE
There are 10 slots, 0 thru 9. Slot 0 is the default (implied slot). 'wdl' lists the contents of the current scheme's slots.
Some examples:
wdl Display all slot contents wds Store the current working directory in the default slot (slot 0) wds1 Store the current working directory in slot 1 (etc, etc) wd Jump to the default directory (slot 0) wd1 Jump to the directory in slot 1 (etc, etc) wdc Clear all slots
Slot contents are stored in a file, wd.list, so they will persist from session to session.
NOTE: This also means that all shells share the same slot configuration; changes in one will be reflected in the other. This is a feature.
Another command, 'wdenv', will copy all of your current working directories into corresponding environment variables for inline use. For example:
$ cd /home/junk
$ wds1
$ wdenv
$ echo $WD1
/home/junk
-- SCHEMES
You can have as many schemes as you'd like. To change schemes, simply say
$ wdscheme myscheme
...where 'myscheme' is some label for your scheme. If the scheme file already existed, it will save your previous wd.list to your previous .scheme file and switch to using the new one (by changing the contents of currentscheme.)
If the scheme was new, a new .scheme file is created in $WDHOME and the new scheme's name is recorded in the $WDHOME/currentscheme file.
-- BUGS
Please report any to me!
karlinfox@yahoo.com
-- TODO
+ adding a bash-completion module for wdscheme would be nice
-- LICENSE
Working Directory is licensed under the GPL:
Working Directory is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Working Directory is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Stratagem; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
