Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

add watch command #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add watch command #41

wants to merge 4 commits into from

Conversation

HalfVoxel
Copy link

@HalfVoxel HalfVoxel commented Aug 18, 2016

A common use case for 'thyme' is to record the active windows at regular intervals.
To make this easier, the command 'watch' can now be used instead of 'track'.

$ thyme watch -n [value] -o thyme.json

should be equivalent to

$ watch -n [value] thyme track -o thyme.json
or
$ while true; do thyme track -o thyme.json; sleep [value]s; done;

but is also usable on systems that do not have 'watch' installed and easier
to use than a shell loop.

If no interval is specified (-n or --interval) then it defaults to 30 seconds.

This was originally suggested by @keegancsmith.

Partially fixes #17

Possibly the track command behavior should simply be replaced by the watch command behavior. Thoughts?

I also added some other fixes to this pull request which addresses #36 (as there doesn't seem to be a way to have multiple different pull requests active from the same source repository... though maybe one can do it by creating new branches... I am not sure).

Generally the dep command seems to have caused a lot of confusion (as indicated by #39, #29 and #36) so these commits remove that command and instead checks are done when the program is started. I did not find a way to check if accessibility privileges were available, so for that it simply adds a more descriptive error message when it detects that error after an applescript has been executed.

A common use case for 'thyme' is to record the active windows at regular intervals.
To make this easier, the command 'watch' can now be used instead of 'track'.

$ thyme watch -n <value> -o thyme.json

should be equivalent to

$ watch -n <value> thyme track -o thyme.json
or
$ while true; do thyme track -o thyme.json; sleep <value>s; done;

but is also usable on systems that do not have 'watch' installed and easier
to use than a shell loop.

If no interval is specified (-n or --interval) then it defaults to 30 seconds.

This was originally suggested by @keegancsmith.
func (t *LinuxTracker) CheckDependencies() {
deps := map[string]string{
"xdpyinfo": "x11-utils",
"xwininfo": "x11-utils",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that package names are different for RPM, as in #48

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, hence the 'usually'. Might be a good idea to add those names too I guess.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #48 for the RPM names

@zyphlar
Copy link

zyphlar commented Aug 18, 2016

Yes you can have multiple PRs by using multiple branches aka git checkout -b fixing_17 and then git checkout master && git checkout -b fixing_36

@Olreich Olreich mentioned this pull request Aug 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Simplify usage
2 participants