# chelydra

![logo](https://files.catbox.moe/me5gtw.svg)

chelydra is a [Snapcast](https://github.com/snapcast/snapcast) client GUI interface

[Project Home](https://hg.sr.ht/~ser/chelydra)
★ [![Build status](https://builds.sr.ht/~ser/chelydra/.build.yml.svg)](https://builds.sr.ht/~ser/chelydra/.build.yml?)
★ [Releases](https://downloads.ser1.net/software/chelydra/)
★ ![Latest release](https://downloads.ser1.net/software/chelydra/badges/latest_release.svg)   
[License](https://hg.sr.ht/~ser/chelydra/raw/LICENSE?rev=tip)
★ [Issues](https://todo.sr.ht/~ser/chelydra)
★ [Mailing List](https://lists.sr.ht/~ser/chelydra)
★ [Credits](https://hg.sr.ht/~ser/chelydra/browse/CREDITS.md?rev=tip)
★ ![AI-Free](https://downloads.ser1.net/software/chelydra/badges/ai_free.svg)

chelydra is a GUI for light configuration, starting, and stopping a
Snapcast client. Its purpose is to make running a client on a mobile device
easier; consequently, it's designed for mobile form factor. chelydra is not,
itself, a Snapcast client – you must also have snapclient installed.

## Features

![Screenshot of chelydra running on a Linux phone](screenshot.jxl)

chelydra allows you to configure, start, and stop snapclient through a GUI.
It saves your settings automatically.

## Caveats

**chelydra will only stop a snapclient that it started, and if you exit chelydra,
any snapclient it started will be stopped!** To keep snapclient running, leave
chelydra running. It doesn't use any CPU; it's just holding onto the PID. This is
by design; chelydra was designed for bring snapclient up and down sporadically.
If you want to e.g. launch snapclient and have it running long-term, a better
way is with job control: dinit, or s6, or systemd, or whatever.

If snapclient fails to start, the status will bounce from "Stopped" -> "Started"
-> "Stopped". There's a very little logging in the window which may help; most
of the output is swallowed to prevent memory from being eaten up over time by
logs.

For some reason I haven't yet figured out, on my FLX1s I always have to start
Go+gioui programs _twice_ when starting them from Phosh. I'm sure it's something
I'm doing in the `.desktop` file; I'll figure it out eventually.

## Installation

Install `snapclient` with your package manager.

```
$ yay -S snapcast               # Arch
$ sudo apt install snapclient   # Deb/Furios
$ sudo apk install snapcast     # Alpine
```

### Binaries

You can grab a binary of chelydra from
[the releases page](https://downloads.ser1.net/software/chelydra/); binaries are
provided for Linux amd64 and arm64 (arm64 should run on the FLX1s). RPM, debs,
and Arch packages are also provided. The packages are probably the best option,
since chelydra is a GUI convenience starter and probably best launched from your
desktop launcher: this means having the desktop and icon installed with the
executable is probably what you want, and the packages do this.

#### Signatures

Assets in the release page built with Sourcehut's CI are signed with my [PGP
key](https://meta.sr.ht/~ser.pgp). For the PGP signatures, import [my public
key](https://meta.sr.ht/~ser.pgp) and verify the downloaded asset and signature
with:

```
gpg --verify chelydra-0.0.5-1-x86_64.pkg.tar.zst chelydra-0.0.5-1-x86_64.pkg.tar.zst.sig
```

### Building

Or, you can `go install` it with

```bash
go install ser1.net/chelydra@latest
```

The binary will be found as `$(go env GOPATH)/bin/chelydra`.

### Alt. Building

Alternatively, you can check this repository out and compile it with:

```bash
$ hg clone https://hg.sr.ht/~ser/chelydra
$ cd chelydra
$ go build .
```

The resulting binary will be `chelydra` in the source directory.

If you have [nFPM](https://nfpm.goreleaser.com/) installed, you can build
the release packages with `nfpm pkg -p <distr>` where `<distro>` is one
of:

- archlinux
- rpm
- deb
- apk

If you want to do a manual install, e.g. into your home directory, this should work
on most systems:

```bash
#!/usr/bin/env bash
DEST=${HOME}/.local
mkdir -p ${DEST}/share/applications
mkdir -p ${DEST}/share/icons
mkdir -p ${DEST}/bin
sed -i "s/^Exec=chelydra/Exec=${DEST}/bin/chelydra" chelydra.desktop
cp chelydra.desktop ${DEST}/share/applications/
cp chelydra.svg ${DEST}/share/icons/
cp chelydra ${DEST}/bin/
```

The `sed` command is only necessary if you're installing to `~/.local/bin` and
it is not in your `$PATH` by at least `~/.profile`; Phosh won't find it
otherwise. If you have `~/.local/bin` set in `.profile`, you shouldn't need the
`sed`.

Change `DEST` to `/usr` and exclude the `sed` for a global install.

### Redo (build system)

If you have [redo](https://redo.readthedocs.io/en/latest/), e.g.
[goredo](http://www.goredo.cypherpunks.su/) installed, you can build all of the
assets -- arm64, amd64, debs, rpms, the whole kit & kaboodle -- with `redo`.
You'll need nFPM for this to do the packages, and
[changelog](https://hg.sr.ht/~ser/changelog) and
[legume](https://hg.sr.ht/~ser/legume) for the
changelog. If you don't have all of these installed, it'll build what it can
and complain about the rest.

## Notes

This project was an adventure in UI development. It's small enough that I have
been able to rewrite it, mostly 1:1, and do some comparisons between GUI libraries.
I've [written about it here](https://ser1.net/post/golang_gui_libraries/).
