Skip to content

Commit

Permalink
feature: set soundfile
Browse files Browse the repository at this point in the history
  • Loading branch information
abenz1267 committed Mar 2, 2024
1 parent d96a19a commit c62ca20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
- `remindme in <duration><m/h> <message>`, example: `remindme in 10m This is a message`
- `remindme at <time> <message>`, example: `remindme at 15:32 This is a message`
- `remindme p <start/stop>`
- `remindme notify <sound>`, example: `remindme notify message`
- `remindme --watch`, starts notifier

Adding a "!" suffix to the message will create an urgent notification instead of a normal one.

`<sound>` is a sound file within `/usr/share/sounds/freedesktop/stereo/`.

## Pomodoro

- 25 minutes work
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {

switch args[0] {
case "notify":
duck()
duck(args[1])
case "in":
send(Reminder{
Time: parseTimeIn(args[1]),
Expand Down Expand Up @@ -268,11 +268,11 @@ func parseTimeIn(val string) time.Time {
}
}

func duck() {
func duck(sound string) {
reduce := exec.Command("playerctl", "--all-players", "volume", "0.1")
reduce.Run()

play := exec.Command("play", "/usr/share/sounds/freedesktop/stereo/message.oga")
play := exec.Command("play", fmt.Sprintf("/usr/share/sounds/freedesktop/stereo/%s.oga", sound))
play.Run()

initial := 0.1
Expand Down

0 comments on commit c62ca20

Please sign in to comment.