summaryrefslogtreecommitdiff
path: root/tessen
AgeCommit message (Collapse)Author
2022-02-16refactor: clear the clipboard when necessaryAyush Agarwal
clearing the clipboard isn't needed when in autotype only mode
2022-02-16docs: mention support for gopass in the help menuAyush Agarwal
support for config file, changes in the options to `-d` instead of `-b` is mentioned as well
2022-02-16refactor: trap the INT signal as wellAyush Agarwal
in addition, if a user selects gopass as the pass backend, use the `get_gopass_files` function
2022-02-16refactor!: initialize sane defaults, parse argsAyush Agarwal
BREAKING CHANGE: the `-b` option has been changed to `-d` to make more sense. i know changes like these may annoy users but i didn't want to use a generic term like `--backend` for configuring dmenu programs. `--backend` is also confusing because tessen supports two kinds of backends now - pass backend and dmenu backend the `tmp_opts` variable was declare before in the parse_config option as a way to resolve a conflict when a user provides config files for rofi and wofi and ends up choosing rofi or wofi explicitly from the arguments. in that case, validate_backend would reset the list of dmenu_backend_opts variable to its defaults without the config file locations which are mentioned in the parse_config function since we've parsed the `-c` option before in parse_config, the `-c` option must be ignored in the main() function. we can't omit `-c` because then a user would get incorrect arg specified error.
2022-02-16feat: parse the config file for tessenAyush Agarwal
the config file also supports pointing rofi and wofi to their config files which allows for context dependent usage which wasn't possible earlier (without siginficant annoyance and having to accept arbitrary input) when environment variables were supported
2022-02-16refactor: better response when validating actionAyush Agarwal
with this change, an action can't be selected if it's not possible and the best available choice should be selected automatically in case no action is provided.
2022-02-16feat: add support for gopass when copying dataAyush Agarwal
when using pass, use the clipboard timeout value specified by PASSWORD_STORE_CLIP_TIME and if this isn't specified, fallback to 15 seconds. when using gopass, use the clipboard timeout value as specified in the `cliptimeout` key in gopass config
2022-02-16refactor: offload otp handling to key_otpAyush Agarwal
2022-02-16refactor!: remove support for $BROWSERAyush Agarwal
the config file supports setting a web browser of your choice and if it is provided, it will used irrespective of what the default web browser is according to XDG. if a user wants to use xdg-open, leave the web_browser config flag commented in the config file.
2022-02-16refactor: key_url isn't needed anymoreAyush Agarwal
key_action is taking care of this
2022-02-16feat: add support for OTP when using gopassAyush Agarwal
refactor: offload the autotype and copy operation to key_action
2022-02-16refactor: fix behavior when url is selectedAyush Agarwal
if the user selects a url, respond appropriately and change the third menu if the action is default. if it's autotype, open the url. if it's copy, copy the url. if the action is both, open the url and copy it.
2022-02-16refactor!: don't show autotype when action is copyAyush Agarwal
this changes the default behavior of the 2nd menu. if copy mode is selected, it doesn't make sense to show the user the option to autotype the username and the password. the option for autotyping has been removed if copy mode is selected. the autotype, both, and the default action mode have the same contents in the 2nd menu. however, the default mode has a third menu which asks for a user action. the chosen_key variable was made a global variable rather than a dynamically scoped variable to avoid confusion. i must admit, dynamically scoped variables sounds kinda insane when you realize that scripting languages like Lua support lexical scoping.
2022-02-16feat!: use the first non-unique keyAyush Agarwal
in addition to adding support for parsing data from gopass, this commit changes the default behavior of tessen to consider the first non-unique key that it finds and ignore the rest. this is different from the earlier behavior of going through each and every potentially identical keys and considering the value of the last key, which is more expensive and makes lesser sense. the keys for url and autotype now support regex as well. this idea was inspired by the following PR https://github.com/ayushnix/tessen/pull/11
2022-02-16feat: add support for gopass in the 1st menuAyush Agarwal
this feels like a hack as mentioned in the comments but if gopass authors keep their output format stable, this should work adding support for gopass mounts was somewhat tricky but worked out in the end
2022-02-16refactor: make the pass prefix localAyush Agarwal
2022-02-16feat!: add support for configuration fileAyush Agarwal
I've dropped support for environment variables in favor of a config file. This was motivated by https://github.com/Cloudef/bemenu/issues/15 From what I think of environment variables, they're meant to be used when they won't change often, especially not during a live session while you're working. I don't think that performing a relogin to change colors in a dmenu program is a sensible thing. Sure, you can create wrapper scripts and place them in your `$PATH` but that feels like an inferior solution compared to config file kept in `$XDG_CONFIG_HOME`.
2022-02-16chore: change email addressAyush Agarwal
I'm gradually moving away from my .in email address.
2022-02-16refactor: use /usr/bin/env bashAyush Agarwal
It seems there are some distros like NixOS which do not have `/bin/bash` in an effort to be stateless, as mentioned in this PR https://github.com/ayushnix/tessen/pull/15 I'm aware that BSDs probably don't have bash at that location either. I'll go ahead and change the default shebang to use `env` to find bash but I also intend to provide an optional patch to revert the shebang back to `#!/bin/bash` and hardcode the `$PATH` to root owned directories in `/usr`.
2022-02-11docs: use consistent case in help menuAyush Agarwal
also removed trailing whitespace
2022-01-24userkey search uses regex to find field (#11)Jerzy Drozdz
* userkey search uses regex to find field * Changed userkey default value to "user" * First matched entry will be set as tsn_username * Update to man page * Fixed setting userkey * Fixed typo
2022-01-17release: bump version to 1.3.1v1.3.1Ayush Agarwal
2022-01-17fix: return empty value if backend is unrecognizedAyush Agarwal
2022-01-16release: revamp the README, bump version of tessenv1.3.0Ayush Agarwal
There's no point replicating the information inside the man page on the README.
2022-01-16refactor: change the order of dmenu backendAyush Agarwal
tessen will now prefer finding fuzzel over rofi and wofi
2022-01-16style: use consistent case, fix grammarAyush Agarwal
2022-01-16refactor: use only one printfAyush Agarwal
Instead of using multiple printf commands, we can just use one. No, I don't like using heredocs for some reason.
2022-01-16refactor: change the find_backend functionAyush Agarwal
Recently, I realized that bash local variables aren't actually local and use dynamic scoping. Renaming `backend` to `dmbd` is just a precaution.
2022-01-16refactor: change the setup_backend functionAyush Agarwal
A few extraneous `{}` were removed from variable names, `=` was replaced with `==` because we're using bash and the former is more confusing, and other cosmetic changes.
2022-01-16refactor: simplify the default optsAyush Agarwal
Instead of creating multiple functions for passing one line outputs, it seems better to just use a case statment. Support for fuzzel has also been added.
2022-01-16refactor: remove redundant colonsAyush Agarwal
In the absence of a colon, the default value (which is empty) will be used only if TESSEN_BACKEND is unset. Adding a colon ensures that the default value is also used if TESSEN_BACKEND is empty. Since the default value is empty, the colon is redundant.
2022-01-10allow using any dmenu-like backendJerzy Drozdz
This commit makes `tessen` agnostic to the dmenu backend used and closes issue #4. Thank you @t0fik for this PR.
2021-11-29fix(release): bump tessen to version 1.2.3v1.2.3Ayush Agarwal
2021-11-29fix: don't check for the presence of oathtoolAyush Agarwal
It's unnecessary to check for the presence of oathtool considering it's listed as a dependency of pass-otp. The explicit check was also causing problems for people on NixOS as mentioned in #6.
2021-11-15fix: exit if file is empty or decryption failsv1.2.2Ayush Agarwal
2021-11-14fix: use tabs instead of spaces in Makefilev1.2.1Ayush Agarwal
2021-11-14docs: improve README, bump release to 1.2.0v1.2.0Ayush Agarwal
2021-11-14refactor: improve help menu, consistent printfAyush Agarwal
2021-11-14refactor: custom autotype, better copyingAyush Agarwal
The auto type operation has been split into two functions - one of them deals with the default auto type operation involving username and password and the other deals with custom autotype operation specified by the user. The copy menu now checks for the presence of notify-send rather than just using it.
2021-11-14feat: add functions to deal with otp and urlAyush Agarwal
continue to implement features explained in 9511148
2021-11-14refactor: improve validation checksAyush Agarwal
The validation functions have been changed to be more modular and more resistant to invalid input. Instead of using printf to redirect error messages to stderr and using `exit 1`, use the function `_die` which has been changed as well. A function called `is_installed` was added as well to check if the needed binaries are present on the system.
2021-11-14refactor: make the key selection modularAyush Agarwal
The `key_menu()` function will now handle different types of keys using case and specific functions instead of complex if-else monstrosity. feat: continue to implement features explained in 9511148
2021-11-14refactor: change the 2nd and 3rd menuAyush Agarwal
Use the environment variables to show options for autotype and username. The URL should also be accounted for and the 3rd menu should show 'open' instead of 'autotype'. feat: continue to implement features explained in 9511148
2021-11-14feat: parse otp, username, allow more char in keysAyush Agarwal
tessen can now parse 'otpauth://' URI format thanks to the regex borrowed from pass-otp The username will now be taken from TESSEN_USERKEY if it exists, otherwise, fallback to using the basename of the selected file. The keys can now have '#', '+', and '@' characters as well.
2021-11-14fix: don't proceed if selected file is emptyAyush Agarwal
2021-11-14feat: add global variables for more featuresAyush Agarwal
The TESSEN_USERKEY environment variable can be set to point tessen to a custom key which should be considered as the username. The TESSEN_URLKEY environment variable can be set to point tessen to a custom key which should be considered as the URL of website. The TESSEN_AUTOKEY environment variable can be set to point tessen to a custom key which should be considered for custom auto type operations instead of the default operation of auto typing the username and the password. The TESSEN_DELAY environment variable can be set to make tessen introduce delay when auto typing to avoid errors. The default is 200 milliseconds. 'bemenu' is no longer the default backend.
2021-11-08refactor: don't use upper case global variablesAyush Agarwal
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.
2021-11-08refactor: disable shell "strict" modeAyush Agarwal
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.
2021-11-06release: bump the version to 1.1.2v1.1.2Ayush Agarwal
2021-11-06fix: don't parse the 'username' and 'password' keyAyush Agarwal
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