Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- changelog start -->
## <!-- release tag -->[0.3.2] - 2026-01-03
### Changed
- Minor changes and fixes to example scripts<!-- change line -->

## <!-- release tag -->[0.3.1] - 2026-01-02
### Added
- Add examples to build a pure TUI scripted interface using dialog<!-- change line -->
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ OTP_CODE=123456
```
Look at the [example script](examples/otp-script-example.sh) to import script output into shell variables.

### Terminal UI Examples

The [examples/OTPTUI.md](examples/OTPTUI.md) documentation describes terminal-based scripts using `dialog` that demonstrate how to build custom interfaces with `otpgui`'s scripted mode. These are useful for headless servers, SSH sessions, or environments without a graphical display.

## Creating a Release

To create a new release:
Expand Down
6 changes: 1 addition & 5 deletions examples/OTPTUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ The script:

## Configuration

By default, `otpmenu.sh` reads the OTP configuration from `$HOME/develop/otp/otp.yml`. Modify line 39 in the script to point to your own OTP configuration file:

```bash
yq .otp "/path/to/your/otp.yml" -o json |
```
`otpmenu.sh` automatically reads the OTP configuration path from `otpgui`'s settings file (`${XDG_CONFIG_HOME:-$HOME/.config}/otpgui/settings.yml`). No manual configuration is needed if `otpgui` is already set up.

## Integration with otpgui

Expand Down
14 changes: 13 additions & 1 deletion examples/otpmenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,23 @@ fi
# Finally set the OTPTUI_SCRIPT location according to detected OTPTUI_PATH
OTPTUI_SCRIPT="${OTPTUI_PATH}otptui.sh"

OTPGUI_SETTINGS="${XDG_CONFIG_HOME:-$HOME/.config}/otpgui/settings.yml"
if ! [[ -f "$OTPGUI_SETTINGS" ]]; then
echo "Error: OTP settings file not found (lookup: ${OTPGUI_SETTINGS:-null})"
exit 1
fi

OTP_CONFIG="$(yq .config_file "$OTPGUI_SETTINGS")"
if ! [[ -f "$OTP_CONFIG" ]]; then
echo "Error: OTP config file not found (lookup: ${OTP_CONFIG:-null})"
exit 1
fi

TMPMENU="$(mktemp)"
TMPOTP="$(mktemp)"
(
echo "--menu otp 50 70 30 \\"
yq .otp "$HOME/develop/otp/otp.yml" -o json |
yq .otp "$OTP_CONFIG" -o json |
jq -Mrcs '.[] | to_entries | sort_by(.key) | map([.key, .value.name] | join(";"))[]' |
awk -F';' 'NR>1{print p" \\"}{p="\t\""$1"\" \""$2"\""}END{print p}'
) >"$TMPMENU"
Expand Down
2 changes: 1 addition & 1 deletion otpversion.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
program_version = "0.3.1"
program_version = "0.3.2"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[project]
name = "otpgui"
version = "0.3.1"
version = "0.3.2"
description = "Otp Generator GUI with python"
readme = "README.md"
requires-python = ">=3.12"
Expand Down Expand Up @@ -34,7 +34,7 @@ otpgui = "otpgui:main"

[tool.poetry]
name = "otpgui"
version = "0.3.1"
version = "0.3.2"
description = "Otp Generator GUI with python"
readme = "README.md"
license = "GPL-3.0-or-later"
Expand Down