Bash script for copying and autotyping data from password-store, gopass or prs.

feat: add config option to disable notifications

authored by

Jan Möller and committed by
GitHub
79f05b8c 3128569c

+13 -2
+3
config
··· 45 45 # want to use it 46 46 # if this key is set, xdg-open will not be used even if it's installed 47 47 # web_browser="" 48 + 49 + # whether to send notifications about copied data via notify-send 50 + # notify="true"
+5
man/tessen.5.scd
··· 127 127 The default web browser that should be used for opening URLs. If this is 128 128 specified, *xdg-open*(1) will not be used even if it's installed. 129 129 130 + *notify* 131 + 132 + Whether to send notifications about copied data via *notify-send*(1). 133 + Either *true* or *false* (default is *true*). 134 + 130 135 # SEE ALSO 131 136 132 137 *tessen*(5), *pass*(1), *gopass*(1) *pass-otp*(1), *fuzzel*(1), *tofi*(1),
+5 -2
tessen
··· 14 14 declare _PASS_BACKEND _DMENU_BACKEND _TSN_ACTION _TSN_CONFIG 15 15 declare -a _DMENU_BACKEND_OPTS _TMP_TOFI_OPTS _TMP_ROFI_OPTS _TMP_WOFI_OPTS 16 16 declare -a _TMP_FUZZEL_OPTS _TMP_YOFI_OPTS 17 - declare _TSN_USERKEY _TSN_URLKEY _TSN_AUTOKEY _TSN_WEB_BROWSER _TSN_OTP 17 + declare _TSN_USERKEY _TSN_URLKEY _TSN_AUTOKEY _TSN_WEB_BROWSER _TSN_OTP _TSN_NOTIFY 18 18 declare -i _TSN_DELAY 19 19 # show both actions, 'autotype' and 'copy', to choose from by default 20 20 _TSN_ACTION="default" ··· 23 23 _TSN_URLKEY="url" 24 24 _TSN_AUTOKEY="autotype" 25 25 _TSN_DELAY=100 26 + _TSN_NOTIFY=true 26 27 if [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/tessen/config ]]; then 27 28 _TSN_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}"/tessen/config 28 29 elif [[ -f "${XDG_CONFIG_DIRS:-/etc/xdg}"/tessen/config ]]; then ··· 408 409 # feature 409 410 # https://github.com/bugaevc/wl-clipboard/issues/107 410 411 printf "%s" "$1" | wl-copy 411 - if is_installed notify-send; then 412 + if [[ $_TSN_NOTIFY == true ]] && is_installed notify-send; then 412 413 notify-send -t $((tsn_cliptime * 1000)) \ 413 414 "data has been copied and will be cleared from the clipboard after $tsn_cliptime seconds" 414 415 fi ··· 673 674 _TSN_DELAY="$val" 674 675 elif [[ $key == "web_browser" ]] && is_installed "$val"; then 675 676 _TSN_WEB_BROWSER="$val" 677 + elif [[ $key == "notify" ]]; then 678 + _TSN_NOTIFY="$val" 676 679 fi 677 680 done 678 681 fi