Age | Commit message (Collapse) | Author |
|
add changes in README.md, CHANGELOG.md, and the tessen version in
`tessen` itself
|
|
Instead of setting the cache file to `/dev/null`, this silly mistake
ended up creating a directory with a name of literal whitespace
containing a dir called `dev` and a file inside `dev` called `null`
|
|
|
|
this feature was implemented after I came across this commit
dnkl/fuzzel/commit/ffec2bc2ef7e5ca1398ab7ed7f134bd769706dcd
apparently, dmenu backends like fuzzel, rofi, and wofi can function in
dmenu backend if `argv[0]==dmenu`, similar to how busybox works in
distributions like Alpine Linux and OpenWrt
|
|
this was motivated by this commit
swaywm/sway/commit/eaeb173a4b9b22d8ba1b35d3d863f0dcb8595341
|
|
docs: updated CHANGELOG.md
|
|
This embarrasing bug escaped my notice until #21 was raised and I tried
to make the clipboard clearing behavior saner.
`kill` is a bash built-in and `kill 0` sends the default SIGTERM signal
to all processes in the same process group (PGID). If `sleep
$tsn_cliptime` is killed for any reason, `kill 0` should end up killing
`wl-copy` as well. This can be confirmed by manually sending a SIGTERM
to the sleep process.
|
|
there's no need to aggressively clear the clipboard in the trap function
and there's also no need to call `_clear` in `_die` because `exit 1`
should call `_clear` because of the trap
|
|
|
|
fixes #21
|
|
|
|
|
|
|
|
if rofi or wofi are chosen as the dmenu backends, add the corresponding
dmenu backend options using tmp_rofi_opts and tmp_wofi_opts
|
|
|
|
the pass and dmenu backends mentioned in the config file will be
accepted only if they're not already set by the argparse menu which will
be modified to run before the config file is parsed
|
|
this should prevent expansion of $PS escape sequences like \u for
username
wildcard characters have been removed as well
|
|
when using fuzzel, it spams stdout with system information which isn't
needed or desired for tessen
|
|
since rofi and wofi support configuring themselves with config files,
which is the sensible thing to do, we'll need to store their config
option in separate variables to avoid conflict scenarios with the
options of other dmenu backends
rather than using `eval`, I've used parameter transformations in bash to
expand possible variables provided in the config file. however, to avoid
expanding and accepting arbitrary input, i'll use a regex to filter
unwanted data
|
|
|
|
The `-s` flag simplfies the code by removing unnecessary quotes inside
the bash `[[` operator. This option has also been added to GitHub
actions and CONTRIBUTING.md file.
|
|
if the user doesn't provide any input via arguments or config file, try
to setup sane defaults
|
|
|
|
clearing the clipboard isn't needed when in autotype only mode
|
|
support for config file, changes in the options to `-d` instead of `-b`
is mentioned as well
|
|
in addition, if a user selects gopass as the pass backend, use the
`get_gopass_files` function
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
|
|
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.
|
|
key_action is taking care of this
|
|
refactor: offload the autotype and copy operation to key_action
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
|
|
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`.
|
|
I'm gradually moving away from my .in email address.
|
|
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`.
|
|
also removed trailing whitespace
|
|
* 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
|
|
|
|
|
|
There's no point replicating the information inside the man page on the
README.
|
|
tessen will now prefer finding fuzzel over rofi and wofi
|
|
|
|
Instead of using multiple printf commands, we can just use one. No, I
don't like using heredocs for some reason.
|