diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 1129b04..d869f1f 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -33,12 +33,15 @@ jobs:
- name: Build
run: cargo build --verbose
+ - name: Build NPM (formatting)
+ run: npm ci
+
- name: Execute tests
run: cargo test --all-features
env:
- CARGO_INCREMENTAL: '0'
- RUSTFLAGS: '-Cinstrument-coverage'
- LLVM_PROFILE_FILE: 'target/coverage/%p-%m.profraw'
+ CARGO_INCREMENTAL: "0"
+ RUSTFLAGS: "-Cinstrument-coverage"
+ LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
- name: Generate coverage report
run: |
@@ -58,13 +61,20 @@ jobs:
git add -A
git diff --cached --exit-code
- - name: Format code
+ - name: Format rust code
if: >-
${{
!contains(env.lastcommit, '🎨 Formatted code')
}}
run: cargo fmt
+ - name: Format other code
+ if: >-
+ ${{
+ !contains(env.lastcommit, '🎨 Formatted code')
+ }}
+ run: npm run format
+
- name: Add formatting-commit
if: >-
${{
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 0ca8001..154076e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,16 +4,16 @@ on:
workflow_dispatch:
inputs:
version:
- description: 'Version (SemVer)'
+ description: "Version (SemVer)"
required: true
default: 0.0.0
deployment-aur-gui:
- description: 'Deployment (AUR, GUI)'
+ description: "Deployment (AUR, GUI)"
type: boolean
required: true
default: true
deployment-aur-cli:
- description: 'Deployment (AUR, CLI)'
+ description: "Deployment (AUR, CLI)"
type: boolean
required: true
default: true
@@ -94,16 +94,16 @@ jobs:
run: |
VERSION=${{ github.event.inputs.version }}
sha=$(sha256sum tiny4linux-${VERSION}.tar.gz | cut -d' ' -f1)
-
+
cd deployment/gui/aur
-
+
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
sed -i "s/^sha256sums=.*/sha256sums=('${sha}')/" PKGBUILD
-
+
# Write-Permissions for Container-User
chmod -R 777 .
-
+
docker run --rm -v $PWD:/pkg archlinux:latest bash -c "
pacman -Sy --noconfirm --needed base-devel shadow &&
useradd -m builder || true &&
@@ -117,16 +117,16 @@ jobs:
run: |
VERSION=${{ github.event.inputs.version }}
sha=$(sha256sum tiny4linux-${VERSION}.tar.gz | cut -d' ' -f1)
-
+
cd deployment/cli/aur
-
+
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
sed -i "s/^sha256sums=.*/sha256sums=('${sha}')/" PKGBUILD
-
+
# Write-Permissions for Container-User
chmod -R 777 .
-
+
docker run --rm -v $PWD:/pkg archlinux:latest bash -c "
pacman -Sy --noconfirm --needed base-devel shadow &&
useradd -m builder || true &&
@@ -179,7 +179,7 @@ jobs:
git push -u origin HEAD:main --tags
create-github-release:
- name: 'Create GitHub release'
+ name: "Create GitHub release"
runs-on: ubuntu-latest
needs: [build, update-metadata, add-version-commit]
steps:
@@ -207,7 +207,7 @@ jobs:
tiny4linux-${{ github.event.inputs.version }}.zip
deploy-aur-gui:
- name: 'Deploy GUI to AUR'
+ name: "Deploy GUI to AUR"
runs-on: ubuntu-latest
if: ${{ github.event.inputs.deployment-aur-gui == 'true' }}
needs: [create-github-release]
@@ -237,10 +237,10 @@ jobs:
git config user.email "openfoxes@bono-fox.de"
git add PKGBUILD .SRCINFO LICENSE
git commit -m "Update to Version ${{ github.event.inputs.version }}"
- git push
+ git push
deploy-aur-cli:
- name: 'Deploy CLI to AUR'
+ name: "Deploy CLI to AUR"
runs-on: ubuntu-latest
if: ${{ github.event.inputs.deployment-aur-cli == 'true' }}
needs: [create-github-release]
@@ -270,7 +270,7 @@ jobs:
git config user.email "openfoxes@bono-fox.de"
git add PKGBUILD .SRCINFO LICENSE
git commit -m "Update to Version ${{ github.event.inputs.version }}"
- git push
+ git push
cleanup:
name: Cleanup
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 63b915d..73d342b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -17,9 +17,9 @@ jobs:
- name: Execute tests
run: cargo test --all-features
env:
- CARGO_INCREMENTAL: '0'
- RUSTFLAGS: '-Cinstrument-coverage'
- LLVM_PROFILE_FILE: 'target/coverage/%p-%m.profraw'
+ CARGO_INCREMENTAL: "0"
+ RUSTFLAGS: "-Cinstrument-coverage"
+ LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
- name: Generate coverage report
run: |
diff --git a/.gitignore b/.gitignore
index 660bfe1..ebc906b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: EUPL-1.2
/target
+/node_modules
tiny4linux-*.tar.gz
tiny4linux-*.zip
diff --git a/.idea/runConfigurations/Format_All.xml b/.idea/runConfigurations/Format_All.xml
new file mode 100644
index 0000000..362d5ec
--- /dev/null
+++ b/.idea/runConfigurations/Format_All.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Format_Others.xml b/.idea/runConfigurations/Format_Others.xml
new file mode 100644
index 0000000..23ee335
--- /dev/null
+++ b/.idea/runConfigurations/Format_Others.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Format.xml b/.idea/runConfigurations/Format_Rust.xml
similarity index 85%
rename from .idea/runConfigurations/Format.xml
rename to .idea/runConfigurations/Format_Rust.xml
index 3d34b84..dd3b25a 100644
--- a/.idea/runConfigurations/Format.xml
+++ b/.idea/runConfigurations/Format_Rust.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/LICENSE.md b/LICENSE.md
index bc21014..200da12 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,5 @@
# EUROPEAN UNION PUBLIC LICENCE v. 1.2
+
## EUPL © the European Union 2007, 2016
This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the
@@ -6,65 +7,67 @@ terms of this Licence. Any use of the Work, other than as authorised under this
use is covered by a right of the copyright holder of the Work).
The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following
notice immediately following the copyright notice for the Work:
- `Licensed under the EUPL`
+`Licensed under the EUPL`
or has expressed by any other means his willingness to license under the EUPL.
1.Definitions
In this Licence, the following terms have the following meaning:
+
- ‘The Licence’:this Licence.
- ‘The Original Work’:the work or software distributed or communicated by the Licensor under this Licence, available
-as Source Code and also as Executable Code as the case may be.
+ as Source Code and also as Executable Code as the case may be.
- ‘Derivative Works’:the works or software that could be created by the Licensee, based upon the Original Work or
-modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
-required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
-the country mentioned in Article 15.
+ modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
+ required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
+ the country mentioned in Article 15.
- ‘The Work’:the Original Work or its Derivative Works.
- ‘The Source Code’:the human-readable form of the Work which is the most convenient for people to study and
-modify.
+ modify.
- ‘The Executable Code’:any code which has generally been compiled and which is meant to be interpreted by
-a computer as a program.
+ a computer as a program.
- ‘The Licensor’:the natural or legal person that distributes or communicates the Work under the Licence.
- ‘Contributor(s)’:any natural or legal person who modifies the Work under the Licence, or otherwise contributes to
-the creation of a Derivative Work.
+ the creation of a Derivative Work.
- ‘The Licensee’ or ‘You’:any natural or legal person who makes any usage of the Work under the terms of the
-Licence.
+ Licence.
- ‘Distribution’ or ‘Communication’:any act of selling, giving, lending, renting, distributing, communicating,
-transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
-functionalities at the disposal of any other natural or legal person.
+ transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
+ functionalities at the disposal of any other natural or legal person.
+
+ 2.Scope of the rights granted by the Licence
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
+ the duration of copyright vested in the Original Work:
-2.Scope of the rights granted by the Licence
-The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
-the duration of copyright vested in the Original Work:
- use the Work in any circumstance and for all usage,
- reproduce the Work,
- modify the Work, and make Derivative Works based upon the Work,
- communicate to the public, including the right to make available or display the Work or copies thereof to the public
-and perform publicly, as the case may be, the Work,
+ and perform publicly, as the case may be, the Work,
- distribute the Work or copies thereof,
- lend and rent the Work or copies thereof,
- sublicense rights in the Work or copies thereof.
-Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
-applicable law permits so.
-In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
-by law in order to make effective the licence of the economic rights here above listed.
-The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
-extent necessary to make use of the rights granted on the Work under this Licence.
-
-3.Communication of the Source Code
-The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
-Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
-each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
-the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
-distribute or communicate the Work.
-
-4.Limitations on copyright
-Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
-exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
-thereto.
-
-5.Obligations of the Licensee
-The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
-obligations are the following:
+ Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
+ applicable law permits so.
+ In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
+ by law in order to make effective the licence of the economic rights here above listed.
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
+ extent necessary to make use of the rights granted on the Work under this Licence.
+
+ 3.Communication of the Source Code
+ The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
+ Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
+ each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
+ the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
+ distribute or communicate the Work.
+
+ 4.Limitations on copyright
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
+ exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
+ thereto.
+
+ 5.Obligations of the Licensee
+ The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
+ obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to
the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the
@@ -156,23 +159,25 @@ advantage of the linguistic version of their choice.
14.Jurisdiction
Without prejudice to specific agreement between parties,
+
- any litigation resulting from the interpretation of this License, arising between the European Union institutions,
-bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
-of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
+ bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
+ of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
- any litigation arising between other parties and resulting from the interpretation of this License, will be subject to
-the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
+ the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
+
+ 15.Applicable Law
+ Without prejudice to specific agreement between parties,
-15.Applicable Law
-Without prejudice to specific agreement between parties,
- this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat,
-resides or has his registered office,
+ resides or has his registered office,
- this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside
-a European Union Member State.
-
+ a European Union Member State.
## Appendix
‘Compatible Licences’ according to Article 5 EUPL are:
+
- GNU General Public License (GPL) v. 2, v. 3
- GNU Affero General Public License (AGPL) v. 3
- Open Software License (OSL) v. 2.1, v. 3.0
diff --git a/README.md b/README.md
index e484afd..4b4efbd 100644
--- a/README.md
+++ b/README.md
@@ -65,11 +65,13 @@ The CLI is installed and made available in your terminal.
Both versions are ready to use.
The GUI is available in the [Arch User Repository](https://aur.archlinux.org/packages/tiny4linux-gui/) via:
+
```shell
yay -S tiny4linux-gui
```
The CLI is available in the [Arch User Repository](https://aur.archlinux.org/packages/tiny4linux-cli/) via:
+
```shell
yay -S tiny4linux-cli
```
@@ -92,10 +94,10 @@ You'll have full access to all available features in the window that opens.
The UI is available in two variants:
1. The **dashboard** is a full overview about the current state and all the available controlling functions.
-Via the terminal, you can open it by setting the flag: `tiny4linux-gui --start-as dashboard`
+ Via the terminal, you can open it by setting the flag: `tiny4linux-gui --start-as dashboard`
2. The **widget** is a smaller version intended for permanent viewing.
-It contains only the more important functions you might need more often.
-Via the terminal, you can open it by setting the flag: `tiny4linux-gui --start-as widget`
+ It contains only the more important functions you might need more often.
+ Via the terminal, you can open it by setting the flag: `tiny4linux-gui --start-as widget`
### CLI
@@ -119,4 +121,4 @@ To run the GUI, you have to build the project and then run the binary:
cargo run --package tiny4linux --bin tiny4linux-gui
```
-With *Jetbrains RustRover*, you can directly execute the corresponding Run Configuration.
+With _Jetbrains RustRover_, you can directly execute the corresponding Run Configuration.
diff --git a/deployment/README.md b/deployment/README.md
index 28cfc8d..b833283 100644
--- a/deployment/README.md
+++ b/deployment/README.md
@@ -2,4 +2,4 @@ This directory contains metadata for the distribution channels through which Tin
Currently, only the Arch User Repository (AUR) is supported.
In the future, other options such as Flatpak may also be considered.
-The project is distributed in both the GUI and CLI versions.
\ No newline at end of file
+The project is distributed in both the GUI and CLI versions.
diff --git a/docs/cli.md b/docs/cli.md
index 74a261e..a1946b1 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -11,7 +11,7 @@ t4l turn on
```
| Action | Description | Command | Aliases |
-|--------|---------------------------|---------|------------|
+| ------ | ------------------------- | ------- | ---------- |
| Sleep | Sets the camera to sleep. | `sleep` | `turn off` |
| Wake | Wakes the camera up. | `wake` | `turn on` |
@@ -21,12 +21,13 @@ With these commands you can control the AI-tracking of the camera.
You can either turn it completely off or set it to a specific mode.
All tracking commands begin with `tracking` or `track`, e.g.:
+
```shell
t4l tracking normal
```
| Action | Description | Command | Aliases |
-|-------------|-----------------------------------------------------------------------------|--------------|------------------|
+| ----------- | --------------------------------------------------------------------------- | ------------ | ---------------- |
| No Tracking | Turns off the AI-tracking and keeps the camera still | `static` | `none`, `off` |
| Standard | Turns on the standard AI-tracking, keeping the upper body and face in focus | `normal` | `standard`, `on` |
| Closeup | Similar to standard tracking, zoomed closer | `close-up` | `close` |
@@ -44,12 +45,13 @@ With these commands you can control the speed that the camera is tracking with.
You can only use the presets ( `standard` and `sport`).
All tracking-speed commands begin with `speed` or `tracking-speed`, e.g.:
+
```shell
t4l speed standard
```
| Action | Description | Command | Aliases |
-|----------|------------------------------------------------------|------------|------------------------------------|
+| -------- | ---------------------------------------------------- | ---------- | ---------------------------------- |
| Standard | Sets the speed to the default, slower tracking speed | `standard` | `normal`, `default`, `slow`, `low` |
| Sport | Sets the speed to the faster tracking speed | `fast` | `sport`, `high` |
@@ -58,6 +60,7 @@ t4l speed standard
With these commands you can set the position of the camera to one of the 3 possible presets.
The command is `preset` or `position`, e.g.:
+
```shell
t4l preset 2
```
@@ -80,12 +83,13 @@ t4l hdr off
With these commands you can control the exposure mode of the camera.
All exposure commands begin with `exposure`, e.g.:
+
```shell
t4l exposure manual
```
| Action | Description | Command |
-|--------|---------------------------------------------------|----------|
+| ------ | ------------------------------------------------- | -------- |
| Manual | Uses custom settings as exposure | `manual` |
| Global | Uses global reference for setting the exposure | `global` |
| Face | Uses a face as reference for setting the exposure | `face` |
@@ -109,6 +113,7 @@ If you use the cli more often, it might be useful to enable auto-completion for
Therefore, you can use the command `completions` to generate the shell-completion scripts for your shell.
In the following example, the shell-completion scripts are generated for bash with `bash-completion`:
+
```shell
t4l completions bash > /.local/share/bash-completion/completions/t4l
```
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..98aa901
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,29 @@
+{
+ "name": "tiny4linux",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "tiny4linux",
+ "devDependencies": {
+ "prettier": "3.6.2"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
+ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..3ca48e9
--- /dev/null
+++ b/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "tiny4linux",
+ "scripts": {
+ "format": "prettier --write ."
+ },
+ "devDependencies": {
+ "prettier": "3.6.2"
+ }
+}
diff --git a/renovate.json b/renovate.json
index d93beef..50ba15b 100644
--- a/renovate.json
+++ b/renovate.json
@@ -44,4 +44,4 @@
"versioningTemplate": "git"
}
]
-}
\ No newline at end of file
+}
diff --git a/src/assets/sources.md b/src/assets/sources.md
index 9859b2b..1864944 100644
--- a/src/assets/sources.md
+++ b/src/assets/sources.md
@@ -1,2 +1,2 @@
-| Element | Source | Files |
-|--------------|---------------------------------------------------|-------------------------------------------|
+| Element | Source | Files |
+| ------- | ------ | ----- |