Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pnlng committed Jan 29, 2020
0 parents commit dc0f567
Show file tree
Hide file tree
Showing 44 changed files with 3,867 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# /node_modules/* in the project root is ignored by default
# build artefacts
dist/*
coverage/*
# data definition files
**/*.d.ts
# 3rd party libs
/src/public/
# custom definition files
/src/types/
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "tsconfig.json"
},
"env": {
"shared-node-browser": true,
"node": true,
"es6": true
},
"rules": {
"no-console": "off",
"no-debugger": "off",
"no-unused-vars": "off",
"no-undef": "off",
"no-redeclare": "off",
"prefer-const": "off"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock.json binary
yarn.lock binary
150 changes: 150 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@

# Created by https://www.gitignore.io/api/node,visualstudiocode,macos
# Edit at https://www.gitignore.io/?templates=node,visualstudiocode,macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# rollup.js default build output
# dist/

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Temporary folders
tmp/
temp/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/node,visualstudiocode,macos
Empty file added .prettierrc
Empty file.
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/src/server.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
}
]
}
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<h1 align="center">BarTime</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.1.0-blue.svg?cacheSeconds=2592000" />
<img src="https://img.shields.io/badge/node-%3E%3D8.0.0-blue.svg" />
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
</p>

> A visual progress bar style countdown timer to your Touch Bar via BetterTouchTool.
![](images/set_timer.gif)

## Prerequisites

- node >=8.0.0
- BetterTouchTool > 2.430

## Install

### BetterTouchTool

BetterTouchTool is a paid app available for purchase on its [website](https://folivora.ai/), or through a [Setapp](https://setapp.com/) subscription.

Enable external scripting through Preferences -> Scripting BTT.

![](images/btt_scripting.png)

Download BarTime's BTT presets and install them.

- Touch Bar Preset
- Named Preset

### BarTime Server

Clone or [download](https://github.com/kefranabg/readme-md-generator/archive/master.zip) the project. In the directory, run

```sh
# npm
npm install
# OR yarn
yarn install
```

Then start the server.

```sh
node dist/server.js
```

#### Daemon & Login Item

You may want to run BarTime as a daemon, in that case, you could use `forever.`

```
# npm
npm install -g forever
# OR yarn
yarn global add forever
```

Then the included script `forever.sh` will run BarTime as a daemon.

```sh
sh forever.sh
```

## Usage and Configuration

To hook up the BTT widget and the server, copy the main widget's UUID.

![](images/uuid.png)

Then go to

```
http://localhost:4975/bartime/config/set?uuid=YOUR_UUID
```

Things should be ready to go!

Using the time picker widget to set a timer:

![](images/set_timer.gif)

Using the bar widget to start a timer of default length (15m).

![](images/use_default.gif)

For the bar widget, the following actions are available.

- **Tap**
- start default timer, if idle
- pause/resume, if a timer is set
- **Long press**
- stop current timer

## Acknowledgements

BarTime took inspirations from the following projects.

- [Timebar](https://www.macupdate.com/app/mac/47506/timebar): Turn your menubar into a subtle timer.
- Unfortunately it's been many years since Timebar was last maintained/available. I still miss the app dearly. This is *the* reason I wrote BarTime.
- [ng-vu/tomato](https://github.com/ng-vu/tomato): Tomato is a command for running pomodoro in background. It's designed mainly to stay in MacBook touchbar.
- [mathiasvr/tiny-timer](https://github.com/mathiasvr/tiny-timer): :clock2: Small countdown timer and stopwatch module.

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
5 changes: 5 additions & 0 deletions dist/assets/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/assets/icons.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc0f567

Please sign in to comment.