Requirements
- A Linux machine (MacOS might work too, untested though)
inotify-tools, to watch for filesgit, to know what files to watchbash, to run the scriptwakatime/wakatime-api, to submit your progress to wakatime
First, clone the bashatime repository to your local machine. This is bashatime's installation directory. You can use a different directory to the one used in the command below, if you know what you are doing.
git clone https://github.com/prplwtf/bashatime.sh.git ~/.bashatimeTo run bashatime, you have to make it executable.
chmod +x ~/.bashatime/bashatime.shIn your ~/.bashrc or ~/.zshrc, create an alias for ~/.bashatime/bashatime.sh to run it more easily.
# When using bash
echo "alias bashatime=\"~/.bashatime/bashatime.sh\"" >> ~/.bashrc
# When using zsh
echo "alias bashatime=\"~/.bashatime/bashatime.sh\"" >> ~/.zshrcFinally, source the shell config to apply the alias to your current session.
# When using bash
source ~/.bashrc
# When using zsh
source ~/.zshrcRun the bashatime script from your project's root directory. You have to do this every time you code.
bashatimeTo create a bashatime configuration, make a file called .bashatimerc in the project's directory. The following configuration options are currently supported:
# The name of your project, defaults to the parent folder name
PROJECT_NAME=""
# Uncomment to output verbose logs as well
#LOG_VERBOSE="1"bashatime uses the wakatime-api cli tool to submit heartbeats. Use the ~/.wakatime.cfg config for your API url, key, and other configuration options.
bashatime has a few known limitations, it's a bash script after all.
- When deleting tracked files, bashatime might return errors when updating any file. To fix this, commit your deleted files in git.
- bashatime does not know your editor's buffer cursor position. It tries to "guess" the cursor position based on file changes, but will never be 100% accurate.
- Configuration options are lacking right now, but more might be introduced at some point in the future.
Contributions are welcome. Whenever making changes to bashatime.sh, please make sure it passes shellcheck to avoid weird edge-cases and shell freak-outs.
All users listed below have been bribed to provide positive options. Don't worry though, the bribes were totally ethical.
@NeonGamerBot-QK: "hi im neon and im pretty sure ts is oke doke"
@3kh0: "who hurt you"
