commit ad83263c9168e11bd18fb3181caaf43344026b66 Author: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Sun Sep 8 12:30:02 2024 -0600 yay diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a4a2f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/*.sw* +/timer diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..af3fade --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module gitea.inhome.blapointe.com/bel/timer + +go 1.22.3 + +require ( + github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb // indirect + github.com/martinlindhe/notify v0.0.0-20181008203735-20632c9a275a // indirect + github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect + gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..83c357a --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb h1:6S+TKObz6+Io2c8IOkcbK4Sz7nj6RpEVU7TkvmsZZcw= +github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb/go.mod h1:wf3nKtOnQqCp7kp9xB7hHnNlZ6m3NoiOxjrB9hFRq4Y= +github.com/martinlindhe/notify v0.0.0-20181008203735-20632c9a275a h1:nQcAxLK581HrmqF0TVy2GC3iFjB8X+aWGtxQ/t2uyGE= +github.com/martinlindhe/notify v0.0.0-20181008203735-20632c9a275a/go.mod h1:zL1p4SieQ27ZZ4V4KdVYdEcSkVl1OwNoi8xI1r5hJkc= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 h1:MZF6J7CV6s/h0HBkfqebrYfKCVEo5iN+wzE4QhV3Evo= +gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2/go.mod h1:s1Sn2yZos05Qfs7NKt867Xe18emOmtsO3eAKbDaon0o= diff --git a/main.go b/main.go new file mode 100644 index 0000000..3c59cae --- /dev/null +++ b/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "os" + "time" + + "github.com/martinlindhe/notify" +) + +func main() { + d, err := time.ParseDuration(os.Args[1]) + if err != nil { + panic(err) + } + time.Sleep(d) + msg := "alerting after " + d.String() + notify.Alert(os.Args[0], msg, msg, "/dev/null") +}