Age | Commit message (Collapse) | Author |
|
Global variables shouldn't be written in upper case unless the variable
is meant to be exported or is an environment variable. The style of
defining local variables was also changed.
|
|
It looks like there's no reliable way to enable a shell "strict" mode
globally in a script without dealing with certain caveats and edge cases
or making code cluttered with `${1-}` instead of simply `$1`. I'm not
gonna use shell "strict" any longer and instead try to write saner code
and rely on shellcheck.
|
|
|
|
tessen wasn't excluding 'username' and 'password' as a key from the menu
which isn't expected behaviour because the value of username is
determined from the basename of the selected file and password is
selected from the first line of the file
|
|
|
|
|
|
updated the fish completion and the README as well
|
|
I was being stupid with the sem versions while making this script. I
thought about editing the individual commits and rebasing and force
pushing the repo but decided against it. Hopefully, this isn't too
embarassing.
|
|
|
|
|
|
|
|
|
|
as mentioned before in 46cedab, the 1st autotype message should be
clearer to indicate that autotyping will be performed no matter what the
choice of `-a` is
|
|
|
|
To mitigate possible inaccuracies while autotyping, an option to let the
user perform autotyping AND copying of a key-value pair at the same
time has been added.
Of course, this doesn't work if the user selects `autotype` in the 2nd
stage menu. I guess I'll change the text of that key for clarity.
|
|
reduce possible confusion and code complexity by using an optional
argument with a value that specifies what the user wants to do
renamed AT_TYPE to ACTION for clarity as well
|
|
|
|
|
|
|
|
This might be a hack but I had to figure out how to work with the
following
- if no backend choice is given, assume bemenu
- if the user sets the TESSEN_BACKEND env var, use that
- if the user provides the `-b` flag at runtime, use that above all else
I've already assumed bemenu by default in the list of global variables.
However, figuring out how to prefer the command line flag over the env
var was a bit tricky I guess.
I changed the `validate_backend` function to always assign both backend
global variables as readonly and this function is always called if the
user provides a `-b` flag at runtime. If he doesn't though, I can safely
use the unset condition on the BACKEND_OPTS variable, instead of
BACKEND, since it has not been assigned anyways. If it can be unset, it
means it hasn't been made readonly, which means `-b` wasn't provided. We
can call the `validate_backend` function to do what we wanted.
|
|
the key presentation menu, `get_key`, was changed to allow presentation
of 2 stages of menus - one, where the user chooses one of the key-value
pairs present in the password store file chosen earlier and two - if the
user hasn't given a preference for autotyping or copying, present both
options as keys
`key_menu_copy` and `key_menu_autotype` were merged into a single
`key_menu` function which, in turn, calls a new `auto_type` function
and `wld_copy` function. This makes more sense and the code seems to be
more modular and extensible.
|
|
|
|
|
|
`argbash` seems like a decent tool to generate argparse while loop for
bash. Although `getopts` built-in is nice, it's restricted to short `-a`
style options only. I think short options are fine but one can't deny
that long options are easier to remember and perhaps more user-friendly.
|
|
|
|
|
|
using '##*:' ended up doing a greedy match which also removes text after
the first ':' if another ':' is found in the value
|
|
turns out, we don't need `choice_data_copy` and `choice_data_autotype`
but only a single `choice_data` function thanks to array slicing and a
if-then conditional
|
|
rofi and bemenu don't prevent garbage input from getting allocated to
the PASSFILE and CHOICE variables. We need to check for the validity of
the user input and fail if needed.
|
|
|
|
This allowed to make the code much simpler and avoid repititive
validation checks.
Using fzf as a backend is broken because I've been unable to figure out
how to make fzf work if we do `$TERMINAL -e tessen -b fzf`.
|
|
|
|
|
|
Yeah, don't litter your script with code not inside functions. The help
menu was also moved near the end of the script because it isn't part of
the script's core logic functions which are meant to be at the top.
|
|
The copy and autotype functions were renamed to make better sense and
adapated to work with the `clean` and `die` functions. This will make
these functions work well with an EXIT trap.
|
|
The `clean` function will copy password store data for a specific amount
of time and then clear it. The `die` function is meant to clear the
clipboard and other sensitive data immediately.
|
|
|
|
There's no need to have the getopts loop outside the main function. The
main function can be called as `main "$@"` to accept positional
parameters as input which then goes on to `getopts` which, by default,
uses `"$@"` unless a positional parameters is explicitly given.
|
|
I'm using `wtype` instead of `ydotool` simply because the former doesn't
need root access while the latter does. However, `wtype` doesn't seem to
be able to autotype correctly in a few cases in Firefox. In Chromium,
autotyping seems to be broken with `wtype`.
I don't think one should rely on autotyping. Although it is extremely
convenient, it is error prone, even in X11 when using xdotool. One of
the reasons is because some web pages don't follow the typical username
and password prompt and have a link between the two which basically
breaks autotyping.
|
|
Although bemenu and rofi work fine, fzf doesn't if tessen isn't invoked
from a terminal. I'm not sure why but using `exec $TERMINAL -e tessen -b
fzf` inside a sway config file won't work as expected.
|
|
For now, the script isn't ready for wide usage. I still need to add code
for autotyping and for all the backend choices.
|