Skip to content

Commit 286b487

Browse files
committed
Update docs and disable macOS build since it is failing
1 parent 8a87c22 commit 286b487

File tree

4 files changed

+105
-4
lines changed

4 files changed

+105
-4
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
goos: [linux, windows, darwin]
1212
goarch: [amd64]
1313
exclude:
14-
- goarch: arm64
15-
goos: windows
14+
- goarch: amd64
15+
goos: darwin
1616
steps:
1717
- uses: actions/checkout@v3
1818
- uses: wangyoucao577/go-release-action@v1.32

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,104 @@
22

33
A chiming clock for the command line, written in Go.
44

5+
6+
## Installation
7+
8+
You can install `chimer` either from the latest release archive or be compiled locally.
9+
10+
### From Release Archive
11+
12+
1. Download the latest archive, specific to your platform, from https://github.com/codemedic/go-chimer/releases/latest
13+
2. Verify SHA256
14+
3. Extract the archive; e.g. into `~/apps/chimer`
15+
4. That's it!
16+
17+
### Compile
18+
19+
1. Clone the repo
20+
```
21+
git clone https://github.com/codemedic/go-chimer.git
22+
```
23+
2. Build the binary
24+
```shell
25+
# On Linux, dependencies for oto library need to be installed
26+
sudo apt install -y libasound2-dev build-essential
27+
28+
cd go-chimer
29+
CGO_ENABLED=1 go build ./cmd/chimer/
30+
```
31+
3. Copy binary and sounds
32+
```shell
33+
mkdir -p ~/apps/chimer
34+
cp -r chimer chimes ~/apps/chimer
35+
```
36+
37+
## Usage
38+
39+
The `chimer` can be used either as a one-shot command run from a cron, every 15 minutes
40+
or as a continuously running service, from your service manager of choice. You may also
41+
run the binary directly from a terminal window.
42+
43+
### Cron Usage
44+
45+
You need to add the below line to your `crontab`.
46+
47+
```
48+
*/15 * * * * /home/username/apps/chimer/chimer --sound /home/username/apps/chimer/chimes` --cron
49+
```
50+
51+
### From a Terminal Window
52+
53+
Run the command below from a terminal window; make sure you leave the window open afterwards. You may press `Ctrl+C` to stop `chimer`.
54+
55+
```shell
56+
~/apps/chimer/chimer --sound ~/apps/chimer/chimes
57+
```
58+
59+
Alternatively, you may add the below line to your `.bashrc` or your shell's rc file to simplify the invocation.
60+
61+
```shell
62+
export CHIMER_SOUND_DEFAULT="$HOME/apps/chimer/chimes"
63+
```
64+
65+
Then `chimer` can be invoked with no commandline option.
66+
67+
```shell
68+
~/apps/chimer/chimer
69+
```
70+
71+
## Usage Help
72+
73+
You can see the below usage help by using the command line option `--help`.
74+
75+
$> ~/apps/chimer/chimer --help
76+
Usage: chimer [options] [arguments]
77+
78+
OPTIONS
79+
--sound/$CHIMER_SOUND_DEFAULT <string>
80+
Default path for sound(s) if none are not specified.
81+
--sound-hour/$CHIMER_SOUND_HOUR <string>
82+
Path for sound(s) at zero past an hour.
83+
--sound-quarter-past/$CHIMER_SOUND_QUARTER_PAST <string>
84+
Path for sound(s) at quarter past an hour.
85+
--sound-half-past/$CHIMER_SOUND_HALF_PAST <string>
86+
Path for sound(s) at half past an hour.
87+
--sound-quarter-to/$CHIMER_SOUND_QUARTER_TO <string>
88+
Path for sound(s) at quarter to an hour.
89+
--cache-sounds/$CHIMER_CACHE_SOUNDS <bool> (default: true)
90+
Cache sounds in memory
91+
--repeat-hourly-sound/-r/$CHIMER_REPEAT_HOURLY_SOUND <bool> (default: false)
92+
Repeat the hourly sound T time at T'O clock.
93+
--minimum-volume-level/-l/$CHIMER_MINIMUM_VOLUME_LEVEL <int> (default: 50)
94+
--test-time/$CHIMER_TEST_TIME <value>
95+
Specify a time to test chimer in cron-mode. This option is ignored when cron-mode is not enabled.
96+
--cron/-c/$CHIMER_CRON_MODE_ENABLED <bool> (default: false)
97+
Enable cron-mode where it acts on the current time to decide whether to chime or not
98+
--help/-h
99+
display this help message
100+
--version/-v
101+
display version information
102+
103+
NOTE: All sound paths can be either a relative or full path to an MP3 file or
104+
a directory containing multiple MP3s. In the latter case, one of the files will
105+
be chosen at random for each chime.

cmd/chimer/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func main() {
6868
conf.Version
6969
chimer.Config
7070
TestTime time.Time `conf:"help:Specify a time to test chimer in cron-mode. This option is ignored when cron-mode is not enabled."`
71-
CronModeEnabled bool `conf:"help:Enable cron-mode where it acts on the current time to decide whether to chime or not, and quits."`
71+
CronModeEnabled bool `conf:"flag:cron,short:c,default:false,help:Enable cron-mode where it acts on the current time to decide whether to chime or not, and quits."`
7272
}{
7373
Version: conf.Version{
7474
Build: build,

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type Config struct {
8585
QuarterTo string `conf:"help:Path for sound(s) at quarter to an hour."`
8686
}
8787
CacheSounds bool `conf:"default:true,help:Cache sounds in memory"`
88-
RepeatHourlySound bool `conf:"short:r"`
88+
RepeatHourlySound bool `conf:"short:r,default:false,help:Repeat the hourly sound T time at T'O clock."`
8989
MinimumVolumeLevel int `conf:"default:50,short:l"`
9090
}
9191

0 commit comments

Comments
 (0)