Skip to content

Commit

Permalink
add support for wofi as a backend
Browse files Browse the repository at this point in the history
updated the fish completion and the README as well
  • Loading branch information
ayushnix committed Sep 21, 2021
1 parent c035849 commit ddc200e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
21 changes: 11 additions & 10 deletions README.md
@@ -1,8 +1,8 @@
## tessen

A bash script that uses either [bemenu](https://github.com/Cloudef/bemenu) or
[rofi](https://github.com/lbonn/rofi) as an interface for auto-typing and copying [password
store](https://www.passwordstore.org/) data.
A bash script that can use [bemenu](https://github.com/Cloudef/bemenu),
[rofi](https://github.com/lbonn/rofi), or [wofi](https://hg.sr.ht/~scoopta/wofi) as an interface for
auto-typing and copying [password store](https://www.passwordstore.org/) data.

`tessen` is written to work only on Wayland.

Expand All @@ -14,7 +14,8 @@ Xorg/X11 and Wayland, check out [pass-tessen](https://github.com/ayushnix/pass-t
### Dependencies

- [pass](https://git.zx2c4.com/password-store/)
- either [bemenu](https://github.com/Cloudef/bemenu) or [rofi](https://github.com/lbonn/rofi)
- either one of [bemenu](https://github.com/Cloudef/bemenu), [rofi](https://github.com/lbonn/rofi),
[wofi](https://hg.sr.ht/~scoopta/wofi)
- [wtype](https://github.com/atx/wtype) (if you want to auto-type data)
- [wl-clipboard](https://github.com/bugaevc/wl-clipboard) or
[wl-clipboard-rs](https://github.com/YaLTeR/wl-clipboard-rs) (if you want to copy data)
Expand All @@ -38,9 +39,9 @@ which you probably should.
### Stable Release

```
wget https://github.com/ayushnix/tessen/releases/download/v1.0.0/tessen-1.0.0.tar.gz
tar xvzf tessen-1.0.0.tar.gz
cd tessen-1.0.0
wget https://github.com/ayushnix/tessen/releases/download/v1.1.0/tessen-1.1.0.tar.gz
tar xvzf tessen-1.1.0.tar.gz
cd tessen-1.1.0
sudo make install
```

Expand All @@ -54,7 +55,7 @@ reasonable defaults.
- `PASSWORD_STORE_DIR` (the default location of your password store)
- `PASSWORD_STORE_CLIP_TIME` (the amount of time for which password-store data stays on the
clipboard)
- `TESSEN_BACKEND` (choose either `bemenu` or `rofi` as the backend for `tessen`)
- `TESSEN_BACKEND` (either one of `bemenu`, `rofi`, or `wofi` as the backend for `tessen`)
- `TESSEN_ACTION` (choose to either `autotype`, `copy`, or do `both` at the same time)

```
Expand All @@ -68,8 +69,8 @@ Usage: tessen [options]
tessen -b rofi -a copy use rofi and always copy data
tessen -b rofi -a both use rofi and always autotype AND copy data
-b, --backend, --backend= choose 'bemenu' or 'rofi' as backend (default: bemenu)
-a, --action, --action= choose one of 'autotype|copy|both'
-b, --backend, --backend= choose 'bemenu', 'rofi', or 'wofi' as backend (default: bemenu)
-a, --action, --action= choose 'autotype', 'copy', or 'both'
-h, --help print this help menu
-v, --version print the version of tessen
```
Expand Down
2 changes: 1 addition & 1 deletion completion/tessen.fish-completion
@@ -1,5 +1,5 @@
complete -f -c tessen
complete -x -c tessen -s b -l backend -k -a "bemenu rofi" -d "use either bemenu (default) or rofi as the backend"
complete -x -c tessen -s b -l backend -k -a "bemenu rofi wofi" -d "use either bemenu (default), rofi, or wofi as the backend"
complete -x -c tessen -s a -l action -k -a "autotype copy both" -d "either 'autotype' data, 'copy' it, or do 'both'"
complete -x -c tessen -s h -l help -d "show the help menu"
complete -x -c tessen -s v -l version -d "show the version"
13 changes: 8 additions & 5 deletions tessen
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021 Ayush Agarwal <ayush at fastmail dot in>
#
# tessen - a data selection interface for pass using bemenu or rofi on Wayland
# tessen - a data selection interface for pass on Wayland
# ------------------------------------------------------------------------------

# shell "strict" mode
Expand Down Expand Up @@ -184,8 +184,8 @@ print_help() {
printf '%s\n' " ${0##*/} -b rofi -a autotype use rofi and always autotype data"
printf '%s\n' " ${0##*/} -b rofi -a copy use rofi and always copy data"
printf '%s\n' " ${0##*/} -b rofi -a both use rofi and always autotype AND copy data" ""
printf '%s\n' " -b, --backend, --backend= choose 'bemenu' or 'rofi' as backend (default: bemenu)"
printf '%s\n' " -a, --action, --action= choose one of 'autotype|copy|both'"
printf '%s\n' " -b, --backend, --backend= choose 'bemenu', 'rofi', or 'wofi' as backend (default: bemenu)"
printf '%s\n' " -a, --action, --action= choose 'autotype', 'copy', or 'both'"
printf '%s\n' " -h, --help print this help menu"
printf '%s\n' " -v, --version print the version of ${0##*/}" ""
printf '%s\n' "For more details, visit https://github.com/ayushnix/tessen"
Expand All @@ -201,8 +201,11 @@ validate_backend() {
elif [[ "$BACKEND" == "rofi" ]]; then
readonly BACKEND="rofi"
readonly BACKEND_OPTS="-dmenu"
elif [[ "$BACKEND" == "wofi" ]]; then
readonly BACKEND="wofi"
readonly BACKEND_OPTS="-d"
else
printf '%s\n' "Please specify a backend: bemenu|rofi" >&2
printf '%s\n' "Please specify a backend: bemenu|rofi|wofi" >&2
exit 1
fi
}
Expand Down Expand Up @@ -249,7 +252,7 @@ main() {
case "$_opt" in
-b | --backend)
[[ "$#" -lt 2 ]] && {
printf '%s\n' "Please specify a backend: bemenu|rofi" >&2
printf '%s\n' "Please specify a backend: bemenu|rofi|wofi" >&2
exit 1
}
BACKEND="${2-}"
Expand Down

0 comments on commit ddc200e

Please sign in to comment.