Skip to content

Commit 752ceee

Browse files
committed
near complete 0.2.0 with subcommands and scripting support
1 parent bf220a4 commit 752ceee

File tree

5 files changed

+262
-136
lines changed

5 files changed

+262
-136
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11

22
build:
33
go build -o local/topframe .
4+
5+
dev:
6+
go run ./topframe.go agent

README.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,75 @@
1-
<img align="left" src="./topframe.png" />
1+
<img align="left" alt="Topframe" src="./topframe.png" />
22

3-
# topframe
3+
# Topframe
44
User programmable screen overlay using web technologies
55

6-
[![Go Report Card](https://goreportcard.com/badge/github.com/progrium/topframe)](https://goreportcard.com/report/github.com/progrium/topframe)
6+
<a href="https://goreportcard.com/report/github.com/progrium/topframe" title="Go Report Card"><img src="https://goreportcard.com/badge/github.com/progrium/topframe" alt="Go Report Card"></a>
77
<a href="https://twitter.com/progriumHQ" title="@progriumHQ on Twitter"><img src="https://img.shields.io/badge/[email protected]" alt="@progriumHQ on Twitter"></a>
88
<a href="https://github.com/progrium/topframe/discussions" title="Project Forum"><img src="https://img.shields.io/badge/community-forum-ff69b4.svg" alt="Project Forum"></a>
99
<a href="https://github.com/sponsors/progrium" title="Sponsor Project"><img src="https://img.shields.io/static/v1?label=sponsor&message=%E2%9D%A4&logo=GitHub" alt="Sponsor Project" /></a>
1010

1111
---
1212
* Display information and always-on-top widgets
1313
* Use HTML/JS/CSS to draw on your screen
14-
* Great for screencasting or streaming overlays
1514
* Edit source, hit save, screen will update
16-
* Less than 300 lines of Go code
15+
* Extensible with shell scripts in any language
16+
* Less than 400 lines of Go code, minimal deps
1717
* Currently alpha, macOS only ...
1818

1919
## Getting Started
2020

21-
First, [download Go](https://golang.org/dl/) or `brew install go`. If you have Go installed, make sure it is
21+
First, [download Go 1.16+](https://golang.org/dl/) or `brew install go`. If already installed, make sure it is
2222
version 1.16 or greater:
2323

2424
```
2525
$ go version
2626
go version go1.16.2 darwin/amd64
2727
```
2828

29-
Then use `go get` to download, build, and install the topframe binary into a `PATH` directory:
29+
Then use `go get` to download, build, and install the topframe binary into a directory in your `PATH`
30+
by setting `GOBIN`:
3031

3132
```
3233
$ GOBIN=/usr/local/bin go get github.com/progrium/topframe
3334
```
3435

3536
Currently, this is the preferred way to install as anything else requires a much more elaborate
3637
release process with Apple code signing, etc. Specifying `GOBIN` is optional, but lets you specify
37-
where to install the binary, ensuring it is put in a directory in your `PATH`.
38-
39-
Running `topframe` will create a `~/.topframe` directory with a default `index.html` used for the
40-
overlay. If you have an `EDITOR` specified, you can run with `-edit` to open this in your preferred editor
41-
so you can start making changes to your topframe overlay immediately:
38+
where to install the binary, ensuring it is put in your `PATH`.
4239

4340
```
44-
$ topframe -edit
41+
$ topframe
42+
Usage: topframe <flags> <subcommand> <subcommand args>
43+
44+
Subcommands:
45+
agent fullscreen webview overlay agent
46+
docs open documentation in browser
47+
help describe subcommands and their syntax
48+
version show version
4549
```
4650

51+
Running `topframe agent` will create a `~/.topframe` directory with a default `index.html` used for the
52+
overlay. A new menu bar extra will let you enable or disable the overlay, make it interactive for
53+
debugging and bringing up devtools, and quickly open the `~/.topframe` directory to edit source.
54+
Files changed in the directory will trigger a reload, so if you edit `index.html` and hit save, changes
55+
will reflect immediately.
56+
4757
### Launching on Startup
4858

4959
Topframe works with `launchd` to run as an agent on startup. You can generate
50-
a plist file with `topframe -agent`, which you can write to a file and move
51-
into `/Library/LaunchAgents`:
60+
an agent plist file with `topframe agent -plist`, which you can write to a file in `~/Library/LaunchAgents`:
5261

5362
```
54-
$ topframe -agent > com.progrium.Topframe.plist
55-
$ sudo mv com.progrium.Topframe.plist /Library/LaunchAgents
63+
$ topframe agent -plist > ~/Library/LaunchAgents/com.progrium.Topframe.plist
5664
```
5765

58-
The generated plist will use the current binary location, so make sure it's
59-
in the right place before generating, or modify the plist file.
66+
It's a good idea to view the output before writing to the file, just to make sure
67+
paths are correct. If you don't know what is correct, it's probably fine!
6068

6169

6270
## Documentation
6371

64-
There is not a whole lot to topframe! I recommend [reading the source](https://github.com/progrium/topframe/blob/main/topframe.go) as its only a few hundred lines,
72+
There is not a whole lot to Topframe! I recommend [reading the source](https://github.com/progrium/topframe/blob/main/topframe.go) as its only a few hundred lines,
6573
but otherwise there is a [wiki](https://github.com/progrium/topframe/wiki) ready to document anything else.
6674

6775
## Getting Help
@@ -71,7 +79,7 @@ a question into the [discussion forum](https://github.com/progrium/topframe/disc
7179

7280
## Contributing
7381

74-
Ideally, topframe will be kept small. Bug fixes and other small PRs are welcome and should be merged quickly.
82+
Ideally, Topframe is kept small. Bug fixes and other small PRs are welcome and should be merged quickly.
7583
If you happen to have a large PR that we haven't discussed, you should talk about it in the forum first. In order
7684
to keep the project small, some features suggestions may be held back in favor of determining a good extension point to expose instead.
7785

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/progrium/topframe
33
go 1.16
44

55
require (
6-
github.com/progrium/macdriver v0.0.1
6+
github.com/google/subcommands v1.2.0
7+
github.com/progrium/macdriver v0.0.2
78
github.com/progrium/watcher v1.0.7
89
)

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
2+
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
13
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
24
github.com/manifold/qtalk v0.0.0-20201222233608-81c04ab41f37/go.mod h1:UX1KjRclAJyV+ydrpEO1CnF8x95Le/Adx8BMGPJaYqg=
35
github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
4-
github.com/progrium/macdriver v0.0.1 h1:IB6OIz+OotdKiCYRo9OLcrPSu1kP29RHmhEaol//sQk=
5-
github.com/progrium/macdriver v0.0.1/go.mod h1:9sPyjQ2zVExbC7I5tL3GPzyaet/cS3o4g8Ht2JcYuRk=
6+
github.com/progrium/macdriver v0.0.2 h1:+xHcfZ4Ggpc68InlZ9BnDJdbxxE5essolTxp+aonnlw=
7+
github.com/progrium/macdriver v0.0.2/go.mod h1:9sPyjQ2zVExbC7I5tL3GPzyaet/cS3o4g8Ht2JcYuRk=
68
github.com/progrium/watcher v1.0.7 h1:A+ciAtU09mHrTW0tdODa6SwWEuKMKF+n/vBJYNU/FqE=
79
github.com/progrium/watcher v1.0.7/go.mod h1:JQYLbWpkvkx6EDYKgqn4Tv5zwhRXe9a+MQw1wnmcyvI=
810
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=

0 commit comments

Comments
 (0)