[
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Rukshan Ranatunge\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Pomodoro\nA simple pomodoro shell script\n\n![Screenshot](http://i.imgur.com/P53pj9z.png)\n\n*How you see notifications*\n\n![Screenshot](http://i.imgur.com/CQUuaBI.png)\n\n## How to use\n\nYou can either copy the code to your ~/.bashrc file or simply run\n\n    source pomodoro.sh && pomo\n\nThere after \n    \n    pomo\n\n## Options\n    pomo [option][message]\n  \n  Options\n  \n    -v version\n    -h help screen\n    -l long break\n    -s short break\n    -d duration in minutes\n    [message] custom message to be displayed after timeout, make sure the message is under quotes\n\n### Long breaks\n  Long breaks are 15 minute breaks started by giving -l command, you will be notified after 15 minutes\n  \n    pomo -l\n  \n### Short breaks\n  Short breaks are 5 minute breaks started by giving -s command, you will be notified after 5 minutes\n\n    pomo -s\n\n### Custom duration\n  Sets custom duration of timer in minutes by giving -d command\n\n    # 45 minute timer\n    pomo -d 45\n\n## Messages\nCustom messages to be shown after breaks\n\n    pomo -l 'time is up'\n    pomo 'time is up'\n\nMade it during my spare time. Forkit, improve it, star it, have fun.\nInspired by [this](https://twitter.com/rob_dodson/status/695864071837470720)\n"
  },
  {
    "path": "pomodoro.sh",
    "content": "#!/bin/bash\n# POMODORO in YA TerMINAL ;)\n\nfunction pomo {\n    RED='\\033[0;31m'\n    NC='\\033[0m' # No Color\n    ORANGE='\\033[0;33m'\n    printf \"${ORANGE}POMODORO in YA TERMINAL${NC}\\n\"\n\n    if [[ \"$1\" == \"-h\" ]] || [[ \"$1\" == \"--help\" ]]; then\n        echo \"usage: pomo       25 minute cycle\"\n        echo -e \"   or: pomo [break]['_message_']  see options below\\n\"\n        echo \"Options:\"\n        echo \"  d: timer duration in minutes\"\n        echo \"  s: 05 minute break\"\n        echo \"  l:  15 minute break\"\n        echo \"  message: Your message to display\"\n        return\n    fi\n\n    if [[ \"$1\" == \"-v\" ]] || [[ \"$1\" == \"--version\" ]]; then\n        echo -e \"${ORANGE}POMODORO TIMER BY RUKSHAN\"\n        echo \"  v: 1.0.0.1\"\n        echo \"  twitter: @justruky\"\n        echo \"  blog: rukshn.github.io\"\n        echo -e \"  email: arkruka[@]gmail.com\"\n        return\n    fi\n\n    TITLE=\"POMODORO TIMER\"\n    MESSAGE=\"\"\n    ICON=\"face-cool\"\n    BEEP=\"_alarm 400 200\"\n    TIMER=1500\n\n    while :\n    do\n        case \"$1\" in\n        -d | --duration)\n            TIMER=$(($2*60))\n            shift 2\n            ;;\n        -l | --long-break)\n            MESSAGE=\"Long is break over, back to work\"\n            TIMER=900\n            shift\n            ;;\n        -s | --short-break)\n            MESSAGE=\"Short is break over, back to work\"\n            TIMER=300\n            shift\n            ;;\n        -*)\n          echo \"Error: Unknown option: $1\" >&2\n          return 1\n          ;;\n        *)  # No more options\n          break\n          ;;\n        esac\n    done\n\n    if [ -n \"$1\" ]; then\n        MESSAGE=\"$1\"\n    elif [ -z \"$MESSAGE\" ]; then\n        MESSAGE=\"Time to take a break\"\n    fi\n\n    echo -e \"${RED}TIMER SET FOR $(($TIMER/60)) MINUTES\"\n\n    # LINUX users\n    if [[ \"$(uname)\" == \"Linux\" ]]; then\n        eval \"(sleep $TIMER && notify-send '$TITLE' '$MESSAGE' --icon=$ICON && $BEEP &)\"\n    # MAC users\n    elif [[ \"$(uname)\" == \"Darwin\" ]]; then\n        eval \"(sleep $TIMER && terminal-notifier -message '$MESSAGE' -title 'Pomodoro' --subtitle '$TITLE' && $BEEP &)\"\n    else\n        echo \"Sorry! Only Linux or Mac\";\n    fi\n}\n\n_alarm() {\n    if [[ \"$(uname)\" == \"Linux\" ]]; then\n        paplay notification.ogg\n    elif [[ \"$(uname)\" == \"Darwin\" ]]; then\n        say -v bells 'beep'\n    fi\n}\n"
  }
]