summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Agarwal <ayush@fastmail.in>2021-09-21 20:20:26 +0530
committerAyush Agarwal <ayush@fastmail.in>2021-09-21 20:20:26 +0530
commitddc200edd1a2c7494403174b0ea2b5feeecb4822 (patch)
treea071a1ee8651790dcf82be129907a6c300104dc2
parentc035849e95f48d12a828a2665c5156dd4f408496 (diff)
add support for wofi as a backend
updated the fish completion and the README as well
-rw-r--r--README.md21
-rw-r--r--completion/tessen.fish-completion2
-rwxr-xr-xtessen13
3 files changed, 20 insertions, 16 deletions
diff --git a/README.md b/README.md
index efae1cc..338df63 100644
--- a/README.md
+++ b/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.
@@ -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)
@@ -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
```
@@ -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)
```
@@ -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
```
diff --git a/completion/tessen.fish-completion b/completion/tessen.fish-completion
index 57892b9..0811867 100644
--- a/completion/tessen.fish-completion
+++ b/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"
diff --git a/tessen b/tessen
index a90a273..286fa56 100755
--- a/tessen
+++ b/tessen
@@ -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
@@ -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"
@@ -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
}
@@ -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-}"