Git Product home page Git Product logo

thyme's Introduction

logo Thyme

Spice up your day-to-day productivity with some free Thyme, courtesy of the team at Sourcegraph (the best way to read and explore code). Automatically track which applications you use and for how long.

  • Simple CLI to track and analyze your application usage
  • Detailed charts that let you profile how you spend your time
  • Stores data locally, giving you full control and privacy
  • Open-source, well-documented, and easily extensible

Thyme is a work in progress, so please report bugs! Want to see how it works? Dive into the source here.

Want to share what you've learned about your Thyme? Join the discussion on Twitter.

Features

Simple CLI

  1. Record which applications you use every 30 seconds:

    $ while true; do thyme track -o thyme.json; sleep 30s; done;
    
  2. Create charts showing application usage over time. In a new window:

    $ thyme show -i thyme.json -w stats > thyme.html
    
  3. Open thyme.html in your browser of choice to see the charts below.

Application usage timeline

Application usage timeline

Detailed application window timeline

Application usage timeline

Aggregate time usage by app

Application usage timeline

Dependencies

Thyme's dependencies vary by system. See thyme dep (mentioned in the installation instructions below).

Install

  1. Install Go (if you have Homebrew on macOS, you can also run brew install go) and run

    $ go get -u github.com/sourcegraph/thyme/cmd/thyme
    

    Alternatively, if you don't want to install Go, just download the thyme binary here.

  2. Follow the instructions printed by thyme dep.

    $ thyme dep
    
  3. Verify thyme works with

    $ thyme track
    

    This should display JSON describing which applications are currently active, visible, and present on your system.

Thyme currently supports Linux, macOS, and Windows.

Usage for Other Shells

Windows Powershell
> for(1){thyme track -o thyme.json; Start-Sleep -s 5}
> thyme show -i thyme.json -w stats | Out-File -e utf8 thyme.html
Windows DOS Command Line
> for /L %n in (0) do @(thyme track -o thyme.json && timeout /t 5 /nobreak)
> thyme show -i thyme.json -w stats > thyme.html

Use cases

Thyme was designed for developers who want to investigate their application usage to make decisions that boost their day-to-day productivity.

It can also be for other purposes such as:

  • Tracking billable hours and constructing timesheets
  • Studying application usage behavior in a given population

How is Thyme different from other time trackers?

There are many time tracking products and services on the market. Thyme differs from available offerings in the following ways:

  • Thyme does not intend to be a fully featured time management product or service. Thyme adopts the Unix philosophy of a command-line tool that does one thing well and plays nicely with other command-line tools.

  • Thyme does not require you to manually signal when you start or stop an activity. It automatically records which applications you use.

  • Thyme is open source and free of charge.

  • Thyme does not send data over the network. It stores the data it collects on local disk. It's up to you whether you want to share it or not.

Attribution

The Thyme logo logo by Anthony Bossard is licensed under Creative Commons 3.0.

thyme's People

Contributors

beyang avatar camerondavison avatar clarkbw avatar howeyc avatar nicksnyder avatar olreich avatar paulirish avatar raboof avatar samstokes avatar seletskiy avatar vaskinyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thyme's Issues

`$ thyme dep` prompting to install watch even though it is already installed

I have watch installed and enabled privileges for iTerm and Terminal. Still getting the following on running thyme dep

Ankits-MacBook-Pro:bin ankit$ thyme dep

You will need the OSX 'watch' command. With Homebrew installed, in your command line enter "brew install watch". You will also need to enable privileges for "Terminal" in System Preferences > Security & Privacy > Privacy > Accessibility.
See https://support.apple.com/en-us/HT202802 for details.

Ankits-MacBook-Pro:bin ankit$ brew install watch
Warning: watch-3.3.11 already installed

OS X Security

Giving accessibility permissions to the OS X Terminal seems like a huge security risk.

Is there any way to grant these permissions only to Thyme?

Fix displaying of time active/visible/open for many applications

Description

When using a lot of applications throughout the day, the resulting time graphs canโ€™t be displayed correctly in the given 200px of height:

timegraph

Expectation

I would have expected one of the following:

  • rows that donโ€™t fit get cut off, because they have too little time on them
  • rows that donโ€™t fit get accumulated as a single row as โ€œOtherโ€
  • the graph has enough height to fit all rows

For me personally, I would be fine with any variation where I can still read the entries.

Reproducing

Use the default way to track thyme and do a lot of context switching thoughout your work day:

watch -n 30 thyme track -o thyme.json
thyme show -i thyme.json -w stats > thyme.html

[Feature requet] Simplifying running thyme

In readme, it states to run thyme on command line like while true; do thyme track -o thyme.json; sleep 30s; done;. What about run thyme on background by executing something like thyme track -o thyme.json -t 30 to simplify command / readability ? If it sounds good, I would like to contribute :)

Releasing binaries

"Go provides excellent support for producing binaries for foreign platforms without having to install Go on the target" - Dave Cheney

How come there are no prebuilt binaries for thyme? It would simplify the install process greatly imho.

Command for installing Thyme did not work

The README has

$ go get -u github.com/sourcegraph/thyme/cmd/thyme

but to actually install, I had to use this URL:

$ go get -u github.com/sourcegraph/thyme/tree/master/cmd/thyme

The first command silently failed, and I would get command not found: thyme when trying to run a thyme command.

Install osascript instructions not clear enough

running thyme dep on osx gives instruction
npm install --save osascript'

running which prints error
npm WARN saveError ENOENT: no such file or directory, open '/Users/<username>/Project/thyme/bin/package.json' npm WARN enoent ENOENT: no such file or directory, open '/Users/<username>/Project/thyme/bin/package.json' npm WARN bin No description npm WARN bin No repository field. npm WARN bin No README data npm WARN bin No license field.

maybe tell user (like me) who doesn't knows much about npm much to run npm init first and fill with this repo's data.

macOS Sierra installation instructions

Hi!

Amazing tool, been waiting for this for years!

I am running Thyme on macOS Sierra following these steps:

  1. Set GOPATH: export GOPATH=/Users/user/go
  2. go get -u github.com/sourcegraph/thyme/cmd/thyme
  3. cd GOPATH/bin
  4. while true; do ./thyme track -o thyme.json; sleep 30s; done;

For some reason I can't execute thyme anywhere, also, I can't run ./thyme dep because brew install watch is not yet compatible with macOS Sierra

MacOs installation

zk:~/ $ go get -u github.com/sourcegraph/thyme/cmd/thyme                                                                                                                              [16:16:54]
zk:~/ $ thyme dep                                                                                                                                                                     [16:17:08]
zsh: command not found: thyme

OSX mavericks with Go 1.7

and what brew found is the one which has name collision

Failed to Install on Ubuntu

$ go get -u github.com/sourcegraph/thyme/cmd/thyme
# github.com/sourcegraph/thyme/cmd/thyme
../gopkg/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:159: undefined: thyme.NewDarwinTracker

Removing the reference to NewDarwinTracker on that line appears to have solved the problem, since that line obviously isn't needed on a non-Darwin system.

go get thyme - no results

Not sure why I'm unable to get thyme, go is installed with homebrew:

dgig@mymac:~/go$ go version
go version go1.6.2 darwin/amd64
dgig@mymac:~/go$ echo $GOPATH
/Users/dgig/go
dgig@mymac:~/go$ go get -u github.com/sourcegraph/thyme/cmd/thyme
dgig@mymac:~/go$
dgig@mymac:~/go$ thyme
-bash: thyme: command not found

I just get no result whatsoever

I am not sure if this might help. I found a random golang program and tried to install it with go get and got this result:

dgig@mymac:~/go$ go get github.com/mattn/go-gtk/gtk
# pkg-config --cflags pango
Package pango was not found in the pkg-config search path.
Perhaps you should add the directory containing `pango.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pango' found
pkg-config: exit status 1
# pkg-config --cflags gdk-pixbuf-2.0
Package gdk-pixbuf-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdk-pixbuf-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gdk-pixbuf-2.0' found
pkg-config: exit status 1

could not run on mac with error

/ (master) $ thyme track [16:07:10]
AppleScript error: exit status 1, output was:
PROCESS 45067:MAMP
264:276: execution error: System Events got an error: osascript is not allowed assistive access. (-25211)

2016/08/27 16:08:29 AppleScript error: exit status 1, output was:
PROCESS 45067:MAMP
264:276: execution error: System Events got an error: osascript is not allowed assistive access. (-25211)

[Panic] thyme show

$ thyme show -i thyme_${today}.json -w stats > thyme_${today}.html
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0xbdc60]

goroutine 1 [running]:
github.com/sourcegraph/thyme.Stats.func1(0x0, 0x82044b608, 0x568a)
/Users/xuta/go/src/github.com/sourcegraph/thyme/show.go:17 +0x20
github.com/sourcegraph/thyme.NewTimeline(0x8203c69a0, 0x294748, 0x8203c69a0)
/Users/xuta/go/src/github.com/sourcegraph/thyme/show.go:142 +0x3c9
github.com/sourcegraph/thyme.Stats(0x8203c69a0, 0x0, 0x0)
/Users/xuta/go/src/github.com/sourcegraph/thyme/show.go:17 +0x46
main.(_ShowCmd).Execute(0x34fba0, 0x8203cc8c0, 0x0, 0x5, 0x0, 0x0)
/Users/xuta/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x595
github.com/jessevdk/go-flags.(_Parser).ParseArgs(0x8203c0480, 0x8203c01f0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/xuta/go/src/github.com/jessevdk/go-flags/parser.go:314 +0xa89
github.com/jessevdk/go-flags.(*Parser).Parse(0x8203c0480, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/xuta/go/src/github.com/jessevdk/go-flags/parser.go:185 +0x9b
main.main.func1(0x0, 0x0)
/Users/xuta/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2f
main.main()
/Users/xuta/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x23

Long Term Activity

So I'm starting to use this tool on a daily basis to keep track of what I'm working on at any given moment, and my general flow is to start tracking when I get to work, stop when I leave, and then generate the results at home to see how my day went.

I'd love to be able to compare results from day to day and see my trends. Any thoughts on having the ability to compare long-term results?

Rewrite macOS support using Accessibility API

Current macOS support is built on Applescript, which calls the Accessibility API under the hood via "System Events". "System Events", however doesn't appear to expose any way to get windows of unscriptable applications (e.g., Slack) that are not in the current desktop/workspace. This means that should any such applications ever have multiple offscreen windows, they will not be detected.

Calling the Accessibility API directly may let us get all windows in all applications. This example app might be useful to look at, particularly the updateWindowList controller method: https://developer.apple.com/library/mac/samplecode/SonOfGrab/Introduction/Intro.html

thyme show panics when 1 second snapshot

I tryed to make one second snapshot and thyme panics

here is the stacktrace

xcombelle@ender ~/d/t/bin> ./thyme show -i thyme.json -w stats
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4bd9e0]

goroutine 1 [running]:
panic(0x5f69e0, 0xc8200120d0)
    /home/xcombelle/.local/go/src/runtime/panic.go:481 +0x3e6
github.com/sourcegraph/thyme.Stats.func1(0x0, 0xc8200b5608, 0x3c00069)
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/show.go:17 +0x20
github.com/sourcegraph/thyme.NewTimeline(0xc8200aa920, 0x69a658, 0xc8200aa920)
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/show.go:142 +0x3d8
github.com/sourcegraph/thyme.Stats(0xc8200aa920, 0x0, 0x0)
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/show.go:17 +0x46
main.(*ShowCmd).Execute(0x758400, 0xc8200a8cd0, 0x0, 0x5, 0x0, 0x0)
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x59e
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc8200c4000, 0xc82000a0d0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/xcombelle/dev/thyme/src/github.com/jessevdk/go-flags/parser.go:314 +0xa83
github.com/jessevdk/go-flags.(*Parser).Parse(0xc8200c4000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/xcombelle/dev/thyme/src/github.com/jessevdk/go-flags/parser.go:185 +0x9b
main.main.func1(0x0, 0x0)
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2f
main.main()
    /home/xcombelle/dev/thyme/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x23

here how I called thyme show

xcombelle@ender ~/d/t/bin> watch -n 30 ./thyme track -o thyme.json
xcombelle@ender ~/d/t/bin> watch -n 1 ./thyme track -o thyme.json

Request for time-saving insights enabled by Thyme

I'd like to write a follow-up blog post to this one featuring insights people have had about their time usage from using Thyme. I'm incredibly curious what others have learned about their time usage and I want to compare other work habits with my own.

If you're willing to share your insights, please

  1. attach a thyme.json file you're comfortable sharing (feel free to sanitize anything you don't want public)
  2. mention 1-5 bullet points of realizations you had from looking at the chart

We'll synthesize these and publish a post sometime in the next couple of weeks.

Where is electron

Upon trying thyme track for the first time (on mac), I was presented with a file explorer window that said "Where is electron?". Since I don't have Electron, I hit "Cancel", at which point Terminal froze and I had to force quit it.

Constant popups asking "Where is X?"

Hi,

Thanks for creating this app, been using it since yesterday on macOS 10.11 and it mostly works well. But some apps seem to trigger many of the "Where is X?" popups. I've had to select "Where is firefox" about 10-15 times now (using Firefox Developer Edition).

Screenshot is attached.

dew-57b48fabf25375 08736047

Can't create graphs

After ran the program all day (while true; do ./thyme track -o thyme.json; sleep 30s; done;), I finished it (Ctrl+C) then tried to get the stats (./thyme show -i thyme.json -w stats > thyme.html), but this errors happened:

๐Ÿ‘‰  ./thyme show -i thyme.json -w stats > thyme.html
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9dd96]

goroutine 1 [running]:
panic(0x1673e0, 0x10580008)
        /home/beyang/go/src/runtime/panic.go:500 +0x325
github.com/sourcegraph/thyme.Stats.func1(0x0, 0x1071db00, 0xa)
        /home/beyang/src/github.com/sourcegraph/thyme/show.go:17 +0x26
github.com/sourcegraph/thyme.NewTimeline(0x105663d0, 0x1a13c0, 0x73713)
        /home/beyang/src/github.com/sourcegraph/thyme/show.go:142 +0x33c
github.com/sourcegraph/thyme.Stats(0x105663d0, 0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/show.go:17 +0x32
main.(*ShowCmd).Execute(0x233e60, 0x1055e480, 0x0, 0x5, 0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x45b
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x1055e450, 0x105c6098, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/beyang/src/github.com/jessevdk/go-flags/parser.go:314 +0x8f3
github.com/jessevdk/go-flags.(*Parser).Parse(0x1055e450, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/beyang/src/github.com/jessevdk/go-flags/parser.go:185 +0x72
main.main.func1(0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x27
main.main()
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x1c

How should it be terminated? I wanted to see these stats :(

Cannot download due to $GOPATH not set

I'm not familiar with how go works but by following the installation steps I was unable to download the package due to:

package github.com/sourcegraph/thyme/cmd/thyme: cannot download, $GOPATH not set. For more details see: go help gopath

I figured it out thanks to go help gopath and by googling a bit but it may be worth adding a note about that in the installation to reduce the time to get started.

Unicode Issue

The resulting HTML has some weird encoding issues.

Even though, the json contains Desktop โ€” Plasma, the HTML shows: Desktop รขโ‚ฌโ€ Plasma

[Windows] thyme track panics

Using Windows 10 Home 32-bit. Running thyme track panics. Here is what I get as output:

Exception 0xc0000005 0x1 0x431895 0x767db924
PC=0x767db924
signal arrived during cgo execution

syscall.(_Proc).Call(0x118c2960, 0x11909ac8, 0x1, 0x1, 0x8, 0x118c2954, 0x0, 0x0)
c:/go/src/syscall/dll_windows.go:130 +0x12c
syscall.(_LazyProc).Call(0x118f7cc0, 0x11909ac8, 0x1, 0x1, 0x118c2940, 0x8, 0x0, 0x0)
c:/go/src/syscall/dll_windows.go:279 +0x5f
github.com/sourcegraph/thyme.getWindowID(0x10062, 0x118c2954, 0x7)
D:/go/src/github.com/sourcegraph/thyme/windows.go:59 +0x65
github.com/sourcegraph/thyme.funcโ”ฌโ•–002(0x10062, 0x378, 0x8feac)
D:/go/src/github.com/sourcegraph/thyme/windows.go:95 +0x21d
syscall.(_Proc).Call(0x118c2910, 0x11909d14, 0x2, 0x2, 0x562ac0, 0x118f7fe0, 0x0, 0x0)
c:/go/src/syscall/dll_windows.go:132 +0x27b
syscall.(_LazyProc).Call(0x118f7c60, 0x11909d14, 0x2, 0x2, 0x1d01f0, 0x774713f0, 0x0, 0x0)
c:/go/src/syscall/dll_windows.go:279 +0x5f
github.com/sourcegraph/thyme.(_WindowsTracker).Snap(0x67ac08, 0x67ac08, 0x0, 0x0)
D:/go/src/github.com/sourcegraph/thyme/windows.go:110 +0x273
main.(_TrackCmd).Execute(0x672e90, 0x118f7e40, 0x0, 0x3, 0x0, 0x0)
D:/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:40 +0x96
github.com/jessevdk/go-flags.(_Parser).ParseArgs(0x118c4a50, 0x118c7768, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0)
D:/go/src/github.com/jessevdk/go-flags/parser.go:314 +0x8c0
github.com/jessevdk/go-flags.(_Parser).Parse(0x118c4a50, 0x0, 0x0, 0x0, 0x0, 0x0)
D:/go/src/github.com/jessevdk/go-flags/parser.go:185 +0x8d
main.funcโ”ฌโ•–002(0x0, 0x0)
D:/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x3a
main.main()
D:/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x25
eax 0x1674
ebx 0x119099f0
ecx 0x8fdc8
edx 0x774713f0
edi 0x10062
esi 0x431895
ebp 0x8fde0
esp 0x8fdd8
eip 0x767db924
eflags 0x10246
cs 0x1b
fs 0x3b
gs 0x0

Can't run on macOS Sierra

I can't run the program on macOS Sierra:

Steps I followed:

  1. Download darwin distribution from https://github.com/sourcegraph/thyme/releases/tag/0.2
  2. Set run permissions CHMOD +x thyme-darwin-368
  3. ./thyme-darwin-368 dep
  4. xcode-select --install
  5. Enable Accessibility permissions

But still I get the same error message:

๐Ÿ‘‰  ./thyme-darwin-386 dep

You will need the osascript command-line utility. You can install it via the Apple developer tools ('xcode-select --install') or npm ('npm install --save osascript').

You will need to enable privileges for "Terminal" in System Preferences > Security & Privacy > Privacy > Accessibility.
See https://support.apple.com/en-us/HT202802 for details.

screen shot 2016-08-18 at 10 56 22
screen shot 2016-08-18 at 10 56 09

What else I am missing?

feature: Simplify usage

Why don't we update Thyme CLI to have really smart defaults + "watch" built in. IE a user should just be able to run

$ thyme track
<ctrl-c>
$ thyme show
# opens thyme.html similiar to how go pprof opens webbrowser for svgs

and it would magically work.

thyme show slice bounds out of range

I just pulled the latest binary, 0.2.2, and I'm getting a slightly different stacktrace when trying to run show. I'm not proficient in GO troubleshooting, so I thought I'd pass it on.

$ ./thyme-linux-386 show -i thyme.json -w stats > plain.html
panic: runtime error: slice bounds out of range [recovered]
    panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x81b5760, 0x1852c030)
    /home/beyang/go/src/runtime/panic.go:500 +0x331
text/template.errRecover(0x185cdcc0)
    /home/beyang/go/src/text/template/exec.go:140 +0xd9
panic(0x81b5760, 0x1852c030)
    /home/beyang/go/src/runtime/panic.go:458 +0x40b
github.com/sourcegraph/thyme.(*BarChart).OrderedBars(0x1859b3b0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/show.go:99 +0x198
reflect.Value.call(0x81b5a60, 0x1859b3b0, 0x213, 0x81d2f1c, 0x4, 0x8292fd0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/beyang/go/src/reflect/value.go:434 +0xdd7
reflect.Value.Call(0x81b5a60, 0x1859b3b0, 0x213, 0x8292fd0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/go/src/reflect/value.go:302 +0x8c
text/template.(*state).evalCall(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x81b5a60, 0x1859b3b0, 0x213, 0x8272ee0, 0x1859c080, 0x1859c067, ...)
    /home/beyang/go/src/text/template/exec.go:658 +0x87d
text/template.(*state).evalField(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c067, 0xb, 0x8272ee0, 0x1859c080, 0x1859e010, 0x1, ...)
    /home/beyang/go/src/text/template/exec.go:549 +0x301
text/template.(*state).evalFieldChain(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x81b5a60, 0x185a1510, 0x196, 0x8272ee0, 0x1859c080, 0x185a0008, ...)
    /home/beyang/go/src/text/template/exec.go:520 +0x1d4
text/template.(*state).evalVariableNode(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c080, 0x1859e010, 0x1, 0x1, 0x0, 0x0, ...)
    /home/beyang/go/src/text/template/exec.go:508 +0x217
text/template.(*state).evalCommand(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c000, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/beyang/go/src/text/template/exec.go:432 +0x747
text/template.(*state).evalPipeline(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859a030, 0x0, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:400 +0x11c
text/template.(*state).walkRange(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x1859c260)
    /home/beyang/go/src/text/template/exec.go:309 +0xe7
text/template.(*state).walk(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x8272de0, 0x1859c260)
    /home/beyang/go/src/text/template/exec.go:237 +0x23d
text/template.(*state).walk(0x185cdc84, 0x81b5a60, 0x185a1510, 0x196, 0x8272ce0, 0x1858c460)
    /home/beyang/go/src/text/template/exec.go:234 +0x523
text/template.(*state).walkRange.func1(0x81ae260, 0x185e2db4, 0x82, 0x81b5a60, 0x185a1510, 0x196)
    /home/beyang/go/src/text/template/exec.go:321 +0x13a
text/template.(*state).walkRange(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x18511280)
    /home/beyang/go/src/text/template/exec.go:330 +0x366
text/template.(*state).walk(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x8272de0, 0x18511280)
    /home/beyang/go/src/text/template/exec.go:237 +0x23d
text/template.(*state).walk(0x185cdc84, 0x819dac0, 0x185a1520, 0x16, 0x8272ce0, 0x18510960)
    /home/beyang/go/src/text/template/exec.go:234 +0x523
text/template.(*Template).execute(0x18510860, 0x8271900, 0x1852c0e0, 0x819dac0, 0x185a1520, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:189 +0x1e3
text/template.(*Template).Execute(0x18510860, 0x8271900, 0x1852c0e0, 0x819dac0, 0x185a1520, 0x0, 0x0)
    /home/beyang/go/src/text/template/exec.go:175 +0x4b
github.com/sourcegraph/thyme.Stats(0x185a0260, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/show.go:24 +0x11e
main.(*ShowCmd).Execute(0x82830f0, 0x1859a240, 0x0, 0x5, 0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x461
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x1859a210, 0x1850a2a8, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/jessevdk/go-flags/parser.go:314 +0x8f9
github.com/jessevdk/go-flags.(*Parser).Parse(0x1859a210, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/beyang/src/github.com/jessevdk/go-flags/parser.go:185 +0x78
main.main.func1(0x0, 0x0)
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2d
main.main()
    /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x22

There is a partial HTML page.

[ thyme]$ ls -l
total 3524
-rw-r--r--. 1 user group    7455 Aug 19 15:34 plain.html
-rw-r--r--. 1 user group    2988 Aug 19 15:32 thyme.json
-rwxr-xr-x. 1 user group 3595657 Aug 19 14:15 thyme-linux-386

When I try to load it into a browser I see

Error: Container is not defined
https://www.gstatic.com/charts/loader.js line 138 > eval
Line 108

Running on Fedora 21

Making the documentation in READ.me more noob friendly

For Windows using novices:

The 'while true; do ./thyme track -o thyme.json; sleep 30s; done;' will not work in cmd. You will receive the following error message:
'while' is not recognized as an internal or external command,operable program or batch file.

If using MinGW/GitBASH, the ./ is missing.
Hence:

while true; do ./thyme track -o thyme.json; sleep 30s; done;
./thyme show -i thyme.json -w stats > thyme.html

Change tracking

A change log and goes in the GitBub release would be nice and mirror much of the community.

getting nil pointer dereference on `thyme show -w stats` (macOS)

I'm using GO version 1.7, and I got SIGSEGV when trying to exectute thyme show -i thyme.json -w stats > thyme.html. I'm not sure if 1.7 is causing the issue though.

Thanks!

Here are the details:

applefreak:~/ $ thyme show -i thyme.json -w stats > thyme.html                                     [11:34:25]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xa9f95]

goroutine 1 [running]:
panic(0x17f600, 0xc420010070)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/sourcegraph/thyme.Stats.func1(0x0, 0xc4202ed860, 0x9cb)
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/show.go:17 +0x5
github.com/sourcegraph/thyme.NewTimeline(0xc4200a8420, 0x1c1c28, 0xc4202edc48)
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/show.go:142 +0x39e
github.com/sourcegraph/thyme.Stats(0xc4200a8420, 0x5, 0x1aa813)
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/show.go:17 +0x3b
main.(*ShowCmd).Execute(0x278180, 0xc4200ba640, 0x0, 0x5, 0x0, 0x0)
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x44b
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc4200d6000, 0xc42000a130, 0x5, 0x5, 0x1, 0x0, 0x1b3201, 0xc4200001a0, 0x0)
    /Users/applefreak/go/src/github.com/jessevdk/go-flags/parser.go:314 +0x8e6
github.com/jessevdk/go-flags.(*Parser).Parse(0xc4200d6000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/applefreak/go/src/github.com/jessevdk/go-flags/parser.go:185 +0x74
main.main.func1(0x0, 0x32c4)
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2d
main.main()
    /Users/applefreak/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x31

Mac OSX El Capitan installation issues

Thanks for creating this, I'm excited to try it!

Installation seems pretty difficult on mac OSX - it would be great to be installed via brew install thyme

I'm on El Capitan version 10.11.6

I'm getting the following error when I run thyme dep. I have installed watch and enabled terminal priveleges:

You will need the OSX 'watch' command. With Homebrew installed, in your command line enter "brew install watch". You will also need to enable privileges for "Terminal" in System Preferences > Security & Privacy > Privacy > Accessibility.
See https://support.apple.com/en-us/HT202802 for details.

Then, when I try thyme track anyway I get a dialog box asking "Where is nwjs?" but it won't let me select the nwjs package I subsequently installed globally in node_modules.

Any suggestions would be fantastic!

[Windows] thyme error when run `thyme track`

Hi Dev,
I downloaded the 0.2.2 windows binary, and when run thyme show error on windows 10 64bit

Exception 0xc0000005 0x1 0x450654 0x7594db55
PC=0x7594db55

syscall.Syscall(0x7594da60, 0x1, 0x203f8, 0x0, 0x0, 0x13614000, 0x0, 0x136401a0)
        /home/beyang/go/src/runtime/syscall_windows.go:163 +0x4a
syscall.(*Proc).Call(0x1363a6c0, 0x1363a6b4, 0x1, 0x1, 0x4, 0x573ba0, 0x0, 0x0)
        /home/beyang/go/src/syscall/dll_windows.go:147 +0x119
syscall.(*LazyProc).Call(0x13688a20, 0x1363a6b4, 0x1, 0x1, 0x1, 0x1363a698, 0x0, 0x0)
        /home/beyang/go/src/syscall/dll_windows.go:304 +0x54
github.com/sourcegraph/thyme.getWindowID(0x203f8, 0x1363a6b0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/windows.go:59 +0x5b
github.com/sourcegraph/thyme.(*WindowsTracker).Snap.func1(0x203f8, 0x378, 0xdfeac)
        /home/beyang/src/github.com/sourcegraph/thyme/windows.go:95 +0x1f8
syscall.Syscall(0x75963a70, 0x2, 0x451d60, 0x378, 0x0, 0x13614000, 0x0, 0x13604380)
        /home/beyang/go/src/runtime/syscall_windows.go:163 +0x4a
syscall.(*Proc).Call(0x1363a650, 0x1363a628, 0x2, 0x2, 0x8, 0x5745e0, 0x0, 0x0)
        /home/beyang/go/src/syscall/dll_windows.go:149 +0x28c
syscall.(*LazyProc).Call(0x136889c0, 0x1363a628, 0x2, 0x2, 0x5b0da4, 0x0, 0x0, 0x0)
        /home/beyang/go/src/syscall/dll_windows.go:304 +0x54
github.com/sourcegraph/thyme.(*WindowsTracker).Snap(0x668ec4, 0x668ec4, 0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/windows.go:110 +0x211
main.(*TrackCmd).Execute(0x656f00, 0x1363e418, 0x0, 0x1, 0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:40 +0x76
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x1363c540, 0x1363a0e8, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/beyang/src/github.com/jessevdk/go-flags/parser.go:314 +0x917
github.com/jessevdk/go-flags.(*Parser).Parse(0x1363c540, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/beyang/src/github.com/jessevdk/go-flags/parser.go:185 +0x78
main.main.func1(0x0, 0x0)
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2d
main.main()
        /home/beyang/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x22
eax     0xe50
ebx     0x203f8
ecx     0x513721bc
edx     0x0
edi     0x43ddbb20
esi     0x450654
ebp     0xdfdf0
esp     0xdfddc
eip     0x7594db55
eflags  0x10246
cs      0x23
fs      0x53
gs      0x2b

thyme has no `-h`, `--help` flags or `help` command

Help flags are must have for the CLI applications, but thyme does not provide one:

$ thyme -h
unknown flag `h'
2016/08/17 15:17:40 unknown flag `h'

$ thyme
Please specify one command of: dep, show or track
2016/08/17 15:18:35 Please specify one command of: dep, show or track

$ thyme help
Unknown command `help'. Please specify one command of: dep, show or track
2016/08/17 15:18:38 Unknown command `help'. Please specify one command of: dep, show or track

thyme track exists with status 1 on Ubuntu

Hi,

I did the following steps:

$ sudo rm -rf /usr/local/go
$ sudo tar -C /usr/local -xvf go1.7.linux-amd64.tar.gz
$ go get -u github.com/sourcegraph/thyme/cmd/thyme
$ ./go_path/bin/thyme dep
$ sudo apt-get install xdotool wmctrl
# xdpyinfo and xwininfo were already installed
$ ./go_path/bin/thyme track
exit status 1
2016/08/17 08:43:40 exit status 1

[OSX] ParseInt: "missing value" error

When running "thyme track" I get a missing value error.

I am on Mac OSX. I just installed the thyme and followed the steps in thyme dep.

~> thyme track
strconv.ParseInt: parsing "missing value": invalid syntax
2016/08/16 13:30:10 strconv.ParseInt: parsing "missing value": invalid syntax

[FEATURE REQUEST] Support blacklisting applications

First, thanks for the software. It's pretty cool to easily see what apps I use throughout the day.

It would be nice if there was a way to blacklist an application so it doesn't show in the output at all. One example use case for me is with 'Path Finder'. I use it as a desktop replacement for Finder, so Thyme shows it as active 100% of the time.

Install dependencies

I have a working go installation. However when I run thyme dep, it gives the following message:

Install the following command-line utilities via your package manager (e.g., apt) of choice:
* xdpyinfo
* xwininfo
* xdotool
* wmctrl

However all these utilities are already installed. I am not a go programmer so maybe I am missing something.

invalid memory address or nil pointer dereference

Attempting to generate stats I get:

% ./go/bin/thyme show -i thyme.json -w stats 
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0xbe210]

goroutine 1 [running]:
panic(0x1f4ee0, 0xc820014130)
        /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:481 +0x3e6
github.com/sourcegraph/thyme.Stats.func1(0x0, 0xc8200b3608, 0x358358)
        /Users/aeg/go/src/github.com/sourcegraph/thyme/show.go:17 +0x20
github.com/sourcegraph/thyme.NewTimeline(0xc8200aa2c0, 0x297bc0, 0xc8200aa2c0)
        /Users/aeg/go/src/github.com/sourcegraph/thyme/show.go:161 +0x61d
github.com/sourcegraph/thyme.Stats(0xc8200aa2c0, 0x0, 0x0)
        /Users/aeg/go/src/github.com/sourcegraph/thyme/show.go:17 +0x46
main.(*ShowCmd).Execute(0x355e20, 0xc82009e370, 0x0, 0x5, 0x0, 0x0)
        /Users/aeg/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x59e
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc8200d0000, 0xc82000a0d0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/aeg/go/src/github.com/jessevdk/go-flags/parser.go:314 +0xa83
github.com/jessevdk/go-flags.(*Parser).Parse(0xc8200d0000, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/aeg/go/src/github.com/jessevdk/go-flags/parser.go:185 +0x9b
main.main.func1(0x0, 0x0)
        /Users/aeg/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2f
main.main()
        /Users/aeg/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x23

Where is JavaApplicationStub?

Was presented this with a chooser dialog, and I believe its tied to a Java based app I have open called DbVisualizer - the only Java desktop I have running.

Upon choosing the .app package, thyme terminates with:

$ thyme track -o thyme.json
strconv.ParseInt: parsing "": invalid syntax
2016/08/16 17:34:45 strconv.ParseInt: parsing "": invalid syntax

This error occurs with each launch of thyme with or with any Java apps currently running.

Should track individual iTerm tabs

I spend a good amount of time on one of the various tabls I have open in iTerm2. Currently, there is only one record for iTerm in the json file.

{
"ID": 88,
"Name": "1. tmux new-session -s test (tmux) - iTerm2"
}

It'll be great if records were broken down further by iTerm tabs

Use SQLite instead of JSON

Wouldn't sqlite be a better choice to store the data as compared to json?

To add new entry to json, we first need to parse the existing file. Whereas, considering our usecase, we just need something that works easily in an append-only fashion.

Calls to System Events are rather expensive

On my machine, calls to thyme track are taking 8s-17s.

image

During that time, one CPU core is pretty dedicated to "System Events". As an example, time reported a run of thyme track took 10.07s real and I'm seeing the total CPU Time in Activity Monitor increase ~9s.

Any ideas? Or more data I can collect?

OSX Installation doesn't seem to be working

Getting following error
Not working Getting message You will need the OSX 'watch' command. With Homebrew installed, in your command line enter "brew install watch". You will also need to enable privileges for "Terminal" in System Preferences > Security & Privacy > Privacy > Accessibility. See https://support.apple.com/en-us/HT202802 for details.

I have already installed watch and also enabled accessibility setting. Here is the output from brew info watch

watch: stable 3.3.11 (bottled), HEAD
Executes a program periodically, showing output fullscreen
https://gitlab.com/procps-ng/procps
Conflicts with: visionmedia-watch
/usr/local/Cellar/watch/3.3.11 (8 files, 74.8K) *
  Poured from bottle on 2016-08-16 at 11:03:53
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/watch.rb
==> Dependencies
Build: autoconf โœ”, automake โœ”, libtool โœ”, pkg-config โœ”
Required: gettext โœ”

Index out-of-bounds error during html generation

I've been running thyme all day and tried to generate the html report, but got an error:

[17:24:26] ~ $ thyme show -i thyme.json -w stats > thyme.html
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x1f4ee0, 0xc820012090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:481 +0x3e6
github.com/sourcegraph/thyme.(*Window).Info(0xc820365920, 0xc8201e9920)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/data.go:130 +0x2bc
github.com/sourcegraph/thyme.appID(0xc820365920, 0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/show.go:381 +0x42
github.com/sourcegraph/thyme.NewTimeline(0xc8200b6740, 0x297bc8, 0xc8203e8e40)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/show.go:177 +0x983
github.com/sourcegraph/thyme.Stats(0xc8200b6740, 0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/show.go:18 +0x6d
main.(*ShowCmd).Execute(0x355e20, 0xc8200aea50, 0x0, 0x5, 0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:114 +0x59e
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc8200c8000, 0xc82000a0d0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/jessevdk/go-flags/parser.go:314 +0xa83
github.com/jessevdk/go-flags.(*Parser).Parse(0xc8200c8000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/jessevdk/go-flags/parser.go:185 +0x9b
main.main.func1(0x0, 0x0)
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:141 +0x2f
main.main()
    /Users/arthur/Projects/go/src/github.com/sourcegraph/thyme/cmd/thyme/main.go:148 +0x23

Break out Chrome into sub-apps

Certain apps like Chrome are just containers for many sub-applications. When displaying app-level usage, it's much more useful to see which sub-apps are in use. Detecting these can be hard-coded for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.