diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 3060a50..ce25d9f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1 @@ -patreon: sampler custom: ['http://sampler.dev/sponsor'] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..48a745d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:focal + +ENV Sampler=/usr/local/bin/sampler + +RUN apt-get update && apt-get upgrade --yes && apt-get install libasound-dev wget --yes \ + && wget https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-linux-amd64 -O $Sampler \ + && chmod +x $Sampler + +ENTRYPOINT ["sampler"] diff --git a/README.md b/README.md index e11f586..0ed55f1 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,23 @@ If there is a way to get a metric using a shell command, then it can be visualiz ## Installation ### macOS + +[HomeBrew](https://brew.sh): ```bash brew install sampler ``` + +[MacPorts](https://www.macports.org): +```bash +sudo port install sampler +``` + or ```bash sudo curl -Lo /usr/local/bin/sampler https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-darwin-amd64 sudo chmod +x /usr/local/bin/sampler ``` + ### Linux ```bash sudo wget https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-linux-amd64 -O /usr/local/bin/sampler @@ -29,8 +38,9 @@ sudo chmod +x /usr/local/bin/sampler Note: `libasound2-dev` system library is required to be installed for Sampler to play a [trigger](https://github.com/sqshq/sampler#triggers) sound tone. Usually the library is in place, but if not - you can install it with your favorite package manager, e.g `apt install libasound2-dev` #### Packaging status - [Fedora](https://apps.fedoraproject.org/packages/golang-github-sqshq-sampler) `sudo dnf install golang-github-sqshq-sampler` (F31+) +- [Arch](https://aur.archlinux.org/packages/sampler) `yay -S sampler` ### Windows (experimental) -Recommended to use with advanced console emulators, e.g. [Cmder](https://cmder.net/) +Recommended to use with advanced console emulators, e.g. [Cmder](https://cmder.app/) Via [Chocolatey](https://chocolatey.org/docs) ```powershell @@ -40,6 +50,19 @@ or [Download .exe](https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-windows-amd64.exe) +### Docker + +``` +# Create a configuration file +vim config.yml + +# Build the container image +docker build --tag sampler . + +# Run a container +docker run --interactive --tty --volume $(pwd)/config.yml:/root/config.yml sampler --config /root/config.yml +``` + ## Usage You specify shell commands, Sampler executes them with a required rate. The output is used for visualization. diff --git a/go.mod b/go.mod index fdcd5e4..a92edee 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/sqshq/sampler +go 1.17 + require ( github.com/gizak/termui/v3 v3.0.0 github.com/hajimehoshi/go-mp3 v0.1.1 @@ -9,7 +11,16 @@ require ( github.com/lunixbochs/vtclean v1.0.0 github.com/mattn/go-runewidth v0.0.4 github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea - github.com/mitchellh/go-homedir v1.1.0 - github.com/mitchellh/go-wordwrap v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 ) + +require ( + github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd // indirect + github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f // indirect + github.com/gopherjs/gopherwasm v0.1.1 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect + golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect + gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 // indirect +)