diff --git a/CHANGELOG.md b/CHANGELOG.md index 1875e8b..9ba02af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). +## [0.3.2] - 2026-01-03 +### Changed +- Minor changes and fixes to example scripts + ## [0.3.1] - 2026-01-02 ### Added - Add examples to build a pure TUI scripted interface using dialog diff --git a/README.md b/README.md index 1cee0cf..0719df1 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/examples/OTPTUI.md b/examples/OTPTUI.md index e205d1a..a332377 100644 --- a/examples/OTPTUI.md +++ b/examples/OTPTUI.md @@ -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 diff --git a/examples/otpmenu.sh b/examples/otpmenu.sh index 763ea96..8fd5663 100755 --- a/examples/otpmenu.sh +++ b/examples/otpmenu.sh @@ -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" diff --git a/otpversion.py b/otpversion.py index 751b56f..208a96e 100644 --- a/otpversion.py +++ b/otpversion.py @@ -1 +1 @@ -program_version = "0.3.1" +program_version = "0.3.2" diff --git a/pyproject.toml b/pyproject.toml index 3227e98..df1ec76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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"