Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
/ decaffeinater Public archive

Sometimes games give you overdoses. This one will help you set a timer to limit yourself.

License

Notifications You must be signed in to change notification settings

retrixe/decaffeinater

Repository files navigation

decaffeinater

Dependency status: dependencies Status devDependencies Status Dependency Status

Current build status

Windows via AppVeyor

Build Status

macOS via Travis CI

Build Status

Linux via CircleCI

Build Status

Enough badges, let's get this over with

This thing is for people who spend way too much time gaming when they should be utilizing time for more productive purposes. This app fixes that. Essentially, select the time, select the app, and use the app until decaffeinater automatically kills it. Kinda hardcore. Built with React and Electron :)

Installation (quick copy-and-paste job, for more clarity, open an issue in the issue section :3 )

Windows

Click here to go to the releases page, and download the .exe file for the latest stable release from there and install it.

macOS (stub, will change thanks to build servers)

Refer to compiling binaries.

Linux

Using apt on Debian, Ubuntu, and their devriatives

Click here to go to the releases page, and download the .deb file for the latest stable release from there and install it.

Using rpm

Click here to go to the releases page, and download the .rpm file for the latest stable release from there and install it.

Using a binary

Click here to go to the releases page, and download the .tar.gz file for the latest stable release from there and install it.

Compiling binaries

To compile binaries, you require a development environment (refer to Setting up a development environment) after which you can run the following commands to compile an executable, which you will find in a dist folder.

# macOS compilation options.
> npm run dist -- --mac dmg             # Compile a dmg on macOS (recommeded for macOS).
> npm run dist -- --mac pkg             # Compile a pkg on macOS.

# Windows compiliation options.
> npm run make-exe                      # Compile an exe installer on Windows.

# Linux compilation options.
> npm run dist -- --linux deb           # Compile a deb installer on apt-based Linux distros.
> npm run dist -- --linux rpm           # Compile an rpm installer on rpm-based Linux distros.
> npm run dist -- --linux tar.gz        # Compile a binary on any Linux installation.

# Compiling for all 3 platforms (using deb and dmg for macOS and Linux)
# Did you read the section below about compiling for other OSes from your own? o.o
> npm run dist -- --mac --linux && npm run make-exe

Compiling for another OS from your current OS

If you wish to create a package for another OS from your current OS, you need to get necessary tools which enable electron-builder to compile cross-platform.

  1. Setup a development environment.
  2. Follow instructions here to setup cross-platform compilation.
  3. Now, you can execute the command of your choice from the above section to compile a binary.

Setting up a development environment

Setting up a development environent requires Node.js. Click here to download the latest LTS version (Current also works though) of node.js for Windows and macOS, and click here to install the newest version of node.js on most Linux distributions.

Next, download the code in this repository by clicking here and unzip it in a folder, or clone this repository.

Finally, open a terminal window in the folder where the app is located and execute the following commands (with an internet connection):

> npm install
> npm start

Recommended development tools and standards

  • Atom with linter-eslint package, or Visual Studio Code with the flowtype and ESLint plugins.
  • Node.js v6/v7
  • Yarn package manager instead of npm
  • React development tools on Electron (refer here)
  • DevTron on Electron (refer here)

The basic directory structure

  • src/ contains everything that is executed.
  • app/ containg a package.json which is bundled with the app, and compiled files.
  • build/ contains build configuration and build tasks.
  • dist/ is generated when you compile the app, you will find executables and installers inside.
  • test/ contains tests run by Ava.

Coding standards

  • Code can be written in ES6 (also ESNext and ES2017) except webpack.config.js and build/*.
  • Please lint your code with ESLint and type check it with Flow (command to do this coming soon, rn use plugins for your code editor). ESLint follows the airbnb coding standard.