itd/README.md

197 lines
7.1 KiB
Markdown
Raw Permalink Normal View History

2021-08-21 08:19:49 +00:00
# ITD
## InfiniTime Daemon
2023-04-27 05:38:56 +00:00
`itd` is a daemon that uses my infinitime [library](https://go.elara.ws/infinitime) to interact with the [PineTime](https://www.pine64.org/pinetime/) running [InfiniTime](https://infinitime.io).
2021-08-21 08:19:49 +00:00
2023-04-27 05:38:56 +00:00
[![status-badge](https://ci.elara.ws/api/badges/Elara6331/itd/status.svg)](https://ci.elara.ws/Elara6331/itd)
[![itd-git AUR package](https://img.shields.io/aur/version/itd-git?label=itd-git&logo=archlinux)](https://aur.archlinux.org/packages/itd-git/)
[![itd-bin AUR package](https://img.shields.io/aur/version/itd-bin?label=itd-bin&logo=archlinux)](https://aur.archlinux.org/packages/itd-bin/)
2024-01-20 04:56:54 +00:00
[![LURE badge for itd-git](https://lure.sh/pkg/default/itd-git/badge.svg)](https://lure.sh/pkg/default/itd-git)
[![LURE badge for itd-bin](https://lure.sh/pkg/default/itd-bin/badge.svg)](https://lure.sh/pkg/default/itd-bin)
2021-08-21 23:36:10 +00:00
2023-10-20 17:23:29 +00:00
This repository is part of the Software Heritage Archive:
[![SWH](https://archive.softwareheritage.org/badge/swh:1:dir:1374aa47b5c0a0d636d6f9c69f77af5e5bae99b2/)](https://archive.softwareheritage.org/swh:1:dir:1374aa47b5c0a0d636d6f9c69f77af5e5bae99b2;origin=https://gitea.elara.ws/Elara6331/itd;visit=swh:1:snp:d2935acbc966dfe1b15c771927bb08b5fc2ec89f;anchor=swh:1:rev:395cded9758dccc020fcd5b666f83a62308c9ab7)
2021-08-21 08:19:49 +00:00
---
### Features
- Notification relay
2021-10-06 16:41:33 +00:00
- Notification transliteration
2021-10-15 07:26:14 +00:00
- Call Notifications (ModemManager)
2021-08-21 08:19:49 +00:00
- Music control
2021-10-23 00:12:46 +00:00
- Get info from watch (HRM, Battery level, Firmware version, Motion)
2021-08-21 08:19:49 +00:00
- Set current time
- Control socket
- Firmware upgrades
- Weather
- BLE Filesystem
2022-11-07 20:24:55 +00:00
- Navigation (PureMaps)
2023-03-25 22:27:28 +00:00
- FUSE Filesystem
2021-08-21 08:19:49 +00:00
---
### Installation
Since ITD 0.0.7, packages are built and uploaded whenever a new release is created.
#### Arch Linux
Use the `itd-bin` or `itd-git` AUR packages.
#### Debian/Ubuntu
2023-05-22 19:34:31 +00:00
- Go to the [latest release](https://gitea.elara.ws/Elara6331/itd/releases/latest) and download the `.deb` package for your CPU architecture. You can find your architecture by running `uname -m` in the terminal.
- Run `sudo apt install <package>`, replacing `<package>` with the path to the downloaded file. Note: relative paths must begin with `./`.
- Example: `sudo apt install ~/Downloads/itd-0.0.7-linux-aarch64.deb`
#### Fedora
2023-05-22 19:34:31 +00:00
- Go to the [latest release](https://gitea.elara.ws/Elara6331/itd/releases/latest) and download the `.rpm` package for your CPU architecture. You can find your architecture by running `uname -m` in the terminal.
- Run `sudo dnf install <package>`, replacing `<package>` with the path to the downloaded file.
- Example: `sudo dnf install ~/Downloads/itd-0.0.7-linux-aarch64.rpm`
#### Alpine (and postmarketOS)
2023-05-22 19:34:31 +00:00
- Go to the [latest release](https://gitea.elara.ws/Elara6331/itd/releases/latest) and download the `.apk` package for your CPU architecture. You can find your architecture by running `uname -m` in the terminal.
- Run `sudo apk add --allow-untrusted <package>`, replacing `<package>` with the path to the downloaded file.
2022-09-01 22:02:11 +00:00
- Example: `sudo apk add --allow-untrusted ~/Downloads/itd-0.0.7-linux-aarch64.apk`
Note: `--allow-untrusted` is required because ITD isn't part of a repository, and therefore is not signed.
---
2021-08-21 08:19:49 +00:00
### `itctl`
This daemon comes with a binary called `itctl` which uses the socket to control the daemon from the command line. As such, it can be scripted using bash.
This is the `itctl` usage screen:
```
NAME:
itctl - A new cli application
USAGE:
itctl [global options] command [command options] [arguments...]
COMMANDS:
help Display help screen for a command
resources, res Handle InfiniTime resource loading
filesystem, fs Perform filesystem operations on the PineTime
firmware, fw Manage InfiniTime firmware
get Get information from InfiniTime
notify Send notification to InfiniTime
set Set information on InfiniTime
update, upd Update information on InfiniTime
watch Watch a value for changes
GLOBAL OPTIONS:
--socket-path value, -s value Path to itd socket (default: "/tmp/itd/socket")
2021-08-21 08:19:49 +00:00
```
2021-08-22 02:07:59 +00:00
2021-08-26 16:01:03 +00:00
---
### `itgui`
In `cmd/itgui`, there is a gui frontend to the socket of `itd`. It uses the [Fyne library](https://fyne.io/) for Go.
2023-01-03 06:42:12 +00:00
#### Easy Installation
2023-05-22 19:34:31 +00:00
The easiest way to install `itgui` is to use my other project, [LURE](https://gitea.elara.ws/Elara6331/lure). LURE will only work if your package manager is `apt`, `dnf`, `yum`, `zypper`, `pacman`, or `apk`.
2023-01-03 06:42:12 +00:00
Instructions:
2023-05-22 19:34:31 +00:00
1. Install LURE. This can be done with the following command: `curl https://www.elara.ws/lure.sh | bash`.
2023-01-03 06:42:12 +00:00
2. Check to make sure LURE is properly installed by running `lure ref`.
3. Run `lure in itgui`. This process may take a while as it will compile `itgui` from source and package it for your distro.
4. Once the process is complete, you should be able to open and use `itgui` like any other app.
#### Compilation
Before compiling, certain prerequisites must be installed. These are listed on the following page: https://developer.fyne.io/started/#prerequisites
It can be compiled by running:
2021-08-26 16:01:03 +00:00
```shell
go build ./cmd/itgui
```
#### Cross-compilation
Due to the use of OpenGL, cross-compilation of `itgui` isn't as simple as that of `itd` and `itctl`. The following guide from the Fyne website should work for `itgui`: https://developer.fyne.io/started/cross-compiling.
2021-08-26 16:01:03 +00:00
#### Screenshots
2022-05-05 21:05:58 +00:00
![Info tab](cmd/itgui/screenshots/info.png)
2021-08-26 16:01:03 +00:00
2022-05-05 21:05:58 +00:00
![Motion tab](cmd/itgui/screenshots/motion.png)
2021-08-26 16:01:03 +00:00
2022-05-05 21:05:58 +00:00
![Notify tab](cmd/itgui/screenshots/notify.png)
2021-08-26 16:01:03 +00:00
2022-05-05 21:05:58 +00:00
![FS tab](cmd/itgui/screenshots/fs.png)
2021-08-26 16:01:03 +00:00
2022-05-05 21:05:58 +00:00
![FS mkdir](cmd/itgui/screenshots/mkdir.png)
2021-08-26 16:01:03 +00:00
2022-11-16 03:20:34 +00:00
![FS resource upload](cmd/itgui/screenshots/resources.png)
2022-05-05 21:05:58 +00:00
![Time tab](cmd/itgui/screenshots/time.png)
2021-08-22 02:07:59 +00:00
2022-05-05 21:05:58 +00:00
![Firmware tab](cmd/itgui/screenshots/firmware.png)
2021-08-22 02:07:59 +00:00
2022-05-05 21:05:58 +00:00
![Upgrade in progress](cmd/itgui/screenshots/progress.png)
2021-08-22 02:07:59 +00:00
2022-05-11 19:10:50 +00:00
![Metrics tab](cmd/itgui/screenshots/metrics.png)
2021-08-21 08:19:49 +00:00
---
2023-01-03 06:42:12 +00:00
### Socket
This daemon creates a UNIX socket at `/tmp/itd/socket`. It allows you to directly control the daemon and, by extension, the connected watch.
2023-01-03 17:16:59 +00:00
The socket uses the [DRPC](https://github.com/storj/drpc) library for requests. The code generated by this framework is located in [`internal/rpc`](internal/rpc)
2023-01-03 06:42:12 +00:00
2023-01-03 17:16:59 +00:00
The API description is located in the [`internal/rpc/itd.proto`](internal/rpc/itd.proto) file.
2023-01-03 06:42:12 +00:00
---
2021-08-21 08:19:49 +00:00
2021-08-21 22:14:37 +00:00
### Starting
To start the daemon, run the following **without root**:
```shell
systemctl --user start itd
```
To autostart on login, run:
```shell
systemctl --user enable itd
```
---
2021-08-21 08:19:49 +00:00
### Cross compiling
To cross compile, simply set the go environment variables. For example, for PinePhone, use:
```shell
make GOOS=linux GOARCH=arm64
```
2021-11-25 00:46:57 +00:00
This will compile `itd` and `itctl` for Linux aarch64 which is what runs on the PinePhone. This daemon only runs on Linux due to the library's dependencies (`dbus`, and `bluez` specifically).
2021-08-21 08:19:49 +00:00
---
### Configuration
This daemon places a config file at `/etc/itd.toml`. This is the global config. `itd` will also look for a config at `~/.config/itd.toml`.
2022-02-22 00:18:52 +00:00
Most of the time, the daemon does not need to be restarted for config changes to take effect.
---
### Attribution
Location data from OpenStreetMap Nominatim, &copy; [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors
2023-03-25 22:27:28 +00:00
Weather data from the [Norwegian Meteorological Institute](https://www.met.no/en)