Skip to content

eendroroy/zsh-codestats

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code::Stats plugin for Zsh

This a fork of the original zsh-codestats plugin Licensed to Hannu Hartikainen

GitHub tag

Contributors GitHub last commit (branch) license GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests

zsh-codestats hooks onto Zsh, counts characters as you type and saves your statistics in Code::Stats. You'll receive XP for the following languages for each character you type.

  • Terminal (Zsh)
  • Git
  • Vagrant
  • Docker
  • Gradle

Installation

  1. Ensure you have curl.
  2. Get your personal API key from https://codestats.net/my/machines and set environment variable in e.g. .zshrc.
    CODESTATS_API_KEY="<api key here>"
    
  3. Install and source the script in one of the following ways (in .zshrc after the environment variable):

Zplug

zplug "eendroroy/zsh-codestats"

Add a line for the plugin, run zplug update, then restart the shell by e.g. exec zsh.

Manual installation

Clone this git repo and source the script directly.

source codestats.plugin.zsh

Running on Windows Subsystem for Linux

If you are running Zsh on Windows and see this message:

_codestats_send_pulse:23: nice(5) failed: operation not permitted

This is caused due to WSL not supporting nice and Zsh using it by default for backgrounded processes. As a workaround, in your .zshrc, set:

unsetopt BG_NICE

See the discussion in this related issue: microsoft/WSL#1887

Options

  • CODESTATS_API_KEY: the API key used when submitting pulses. Required.
  • CODESTATS_API_URL: the base URL to the Code::Stats API. Only set this if you know what you're doing! :)
  • CODESTATS_LOG_FILE: a log file for debugging. Must exist and be writable.

Contributing

Bug reports and pull requests are welcome on GitHub at zsh-codestats repository. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it ( https://github.com/eendroroy/zsh-codestats/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Author

  • Hannu Hartikainen - Original Author - dancek
  • indrajit - Owner - eendroroy

License

The project is available as open source under the terms of the MIT License.

About

Code::Stats plugin for Zsh

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
ORIGINAL_LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%