Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iamfirecracker/productivity

Bahs productivity scripts
https://github.com/iamfirecracker/productivity

Last synced: 13 days ago
JSON representation

Bahs productivity scripts

Awesome Lists containing this project

README

        

# productivity - more productivity with your bash shell

## Setup

Clone this repository:

cd ~/workspace
git://github.com/iamFIREcracker/productivity.git

Make sure the following lines are present inside your **.bashrc**:

# move automatically inside last used directory
if [ -f ~/.lastdir ]; then
cd "`cat ~/.lastdir`"
fi

O
# prompt_command callback: update directory counter, save the current directory
# and (optionally) list last edited files.
function productivity_update() {
local current

current="`pwd`"
if [ "${current}" != "${PRODUCTIVITY_LASTDIR}" ]; then
# update directory count
~/workspace/productivity/productivity.sh update "${current}"
export PRODUCTIVITY_LASTDIR="${current}"

# list more recent content
ls -tAl | head -7
fi

# we need to update .lastdir because another shell could have modified it
# but we are the most recent process active
echo "${current}" > ~/.lastdir
}

export PRODUCTIVITY_LASTDIR="`pwd`"
export PROMPT_COMMAND="productivity_update"
alias f='~/workspace/productivity/productivity.sh prompt frequently'
alias r='~/workspace/productivity/productivity.sh prompt recently'
alias p='~/workspace/productivity/productivity.sh'

Add a new job inside your **crontab** which is going to wipe off stale entries
contained inside the database:

* * * * 0 ~/workspace/productivity/productivity.sh damp

*Voila`*

## Credits
http://matt.might.net/articles/console-hacks-exploiting-frequency/