sphinx-x11(1) | simple script interpreter for integrating password managers with X11 | sphinx-x11(1) |
sphinx-x11 - simple script interpreter for integrating password managers with X11
sphinx-x11(1) is a simple “script” language interpreter that integrates the SPHINX CLI with X11.
All sphinx-x11(1) scripts expect a username and a hostname as the first and second parameter respectively.
Any lines not consisting of these tokens are simply ignored.
In this interpreter/implementation a TOTP value is assumed to be stored with a username prefixed with otp://, so that a regular login name can co-exist with the according TOTP secret in sphinx.
For example in a common 2FA login the first pwd operation uses e.g. joe as a username and then for the TOTP value it uses otp://joe as the username, which allows for seamless 2FA login.
sphinx-x11(1) comes with 5 default sphinx-scripts (note on debian and derivates instead of a .sphinx extension they have a sx11- prefix):
Each of these scripts waits for the user to click, then they retrieve the relevant password (and/or TOTP token) before inserting it into the form fields, navigating between them with tab and enter. You are welcome to contribute adapted sphinx-scripts for websites that have other login semantics.
As an example the user-pass-otp.sphinx script is explained below:
#!./sphinx-x11 wait-for-click user tab pwd tab enter wait-for-click otp enter
The first line specifies sphinx-x11(1) as the interpreter. The script itself then waits for the user to click (line 3), then in line 4 inserts the user - which is specified as the first parameter to this script. Line 5 injects a tab so the next form field is selected. Then pwdsphinx/getpwd is used to get the password for user and host - the host being the 2nd parameter to this script. enter is used to submit this form in line 8. Since this is a new form the script waits (line 9) for the user to click in the field where the TOTP value needs to be inserted. Then in line 10 the TOTP value is queried using pwdsphinx/getpwd, and finally in the last line the TOTP value is submitted by injecting enter into the application.
https://github.com/stef/pwdsphinx/issues/
Written by Stefan Marsiske.
Copyright © 2023 Stefan Marsiske. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
sphinx(1), type-pwd(1), exec-on-click(1), getpwd(1)