Skip to content

Commit bb6e7bc

Browse files
committed
update docs and default-prefs with custom sounds and default-sounds feature
1 parent 70706ed commit bb6e7bc

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Run this command too if you want to update bacon. Configuration has always been
3636

3737
Some features are disabled by default. You may enable them with
3838

39-
cargo install --features "clipboard sound"
39+
cargo install --features "clipboard sound default-sounds"
4040

4141
## check the current project
4242

@@ -116,6 +116,7 @@ Some bacon features can be disabled or enabled at compilation:
116116

117117
* `"clipboard"` - disabled by default : necessary for the `copy-unstyled-output` internal
118118
* `"sound"` - disabled by default : necessary for the `play-sound` internal
119+
* `"default-sounds"` - disabled by default: embed some default sounds for the `play-sound` internal
119120

120121
## Licences
121122

defaults/default-prefs.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ line_format = "{kind} {path}:{line}:{column} {message}"
7979
enabled = false # set true to allow sound
8080
base_volume = "100%" # global volume multiplier
8181

82+
# Specify your own sound files, e.g.
83+
# bepop = "~/audio/bepop.mp3"
84+
#
85+
# Then use its name as usual in a job, e.g.
86+
# on_success = "play-sound(name=bepop,volume=42)"
87+
[sound.collection]
88+
8289
# Uncomment and change the key-bindings you want to define
8390
# (some of those ones are the defaults and are just here for illustration)
8491
[keybindings]
@@ -110,4 +117,3 @@ base_volume = "100%" # global volume multiplier
110117
# r = "job:run"
111118
# ctrl-e = "export:analysis"
112119
# ctrl-c = "copy-unstyled-output"
113-

website/docs/config.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,27 @@ on_success = "play-sound(name=90s-game-ui-6,volume=50)"
323323
on_failure = "play-sound(name=beep-warning,volume=100)"
324324
```
325325

326-
Sound name can be omitted. Possible values are `2`, `90s-game-ui-6`, `beep-6`, `beep-beep`, `beep-warning`, `bell-chord`, `car-horn`, `convenience-store-ring`, `cow-bells`, `pickup`, `positive-beeps`, `short-beep-tone`, `slash`, `store-scanner`, `success`.
326+
Sound name can be omitted.
327+
328+
If the `default-sounds` feature is enabled, some pre-chosen sounds are available; their names are `2`, `90s-game-ui-6`, `beep-6`, `beep-beep`, `beep-warning`, `bell-chord`, `car-horn`, `convenience-store-ring`, `cow-bells`, `pickup`, `positive-beeps`, `short-beep-tone`, `slash`, `store-scanner`, `success`.
329+
330+
Or, you can add your own sounds.
331+
332+
Either use a direct path, eg
333+
334+
```TOML
335+
on_success = "play-sound(path=media/bepop.mp3,volume=42)"
336+
```
337+
338+
or, add sounds to a root level collection, eg
339+
340+
```TOML
341+
[sound.collection]
342+
bepop = "~/audio/bepop.mp3"
343+
```
344+
345+
then use its name in a job as usual, eg
346+
347+
```TOML
348+
on_success = "play-sound(name=bepop,volume=42)"
349+
```

0 commit comments

Comments
 (0)