File tree 6 files changed +23
-33
lines changed
6 files changed +23
-33
lines changed Original file line number Diff line number Diff line change @@ -41,4 +41,7 @@ alias cp="cp -v"
41
41
alias mv=" mv -v"
42
42
43
43
# https://gist.github.com/pudquick/29bc95b6c49703992981864e48f8e341
44
- alias brew=~ /.local/homebrew/bin/brew
44
+ alias brew=" ~/.local/homebrew/bin/brew"
45
+
46
+ # View inline images in w3m with iTerm2
47
+ alias w3m=" w3m -sixel"
Original file line number Diff line number Diff line change 2
2
3
3
set -Eeuo pipefail
4
4
5
- # #############################################################################
6
- #
7
- # kpf
8
- # fzf for keepassxc-cli
9
- # (c) Steven Saus 2021
10
- # Licensed under the MIT license
11
- #
12
- # BEFORE RUNNING - two environment variables
13
- # export KPPW="Your KeepassxC password"
14
- # export KPDB=/path/to/keepassxc.kdbx
15
- #
16
- # #############################################################################
17
-
18
5
readonly TIMEOUT=${TIMEOUT:- 0} # Timeout before clearing the clipboard (default is 10 seconds, set to 0 for unlimited).
19
6
SCRIPT_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd -P)
20
7
FZF_DEFAULT_OPTS=" ${FZF_DEFAULT_OPTS:- --ansi --exact --multi --no-hscroll} "
@@ -27,8 +14,10 @@ if [ $# -eq 0 ]; then
27
14
KPVALUE=$( keepassxc-cli ls --recursive --flatten " ${KPDB} " 2> /dev/null < <( echo " ${KPPW} " ) | fzf-tmux ${FZF_DEFAULT_OPTS} --preview=" $SCRIPT_NAME {}" )
28
15
keepassxc-cli show " ${KPDB} " " ${KPVALUE} " --show-attachments 2> /dev/null < <( echo " ${KPPW} " ) | bat --highlight-line=1 --language=http --plain
29
16
echo -n " TOTP: "
30
- keepassxc-cli show " ${KPDB} " " ${KPVALUE} " --totp 2> /dev/null < <( echo " ${KPPW} " )
17
+ keepassxc-cli show " ${KPDB} " " ${KPVALUE} " --totp 2> /dev/null < <( echo " ${KPPW} " ) || echo
31
18
keepassxc-cli clip --attribute password " ${KPDB} " " ${KPVALUE} " " ${TIMEOUT} " 2> /dev/null < <( echo " ${KPPW} " )
32
19
else
33
20
keepassxc-cli show " ${KPDB} " " ${1} " 2> /dev/null < <( echo " ${KPPW} " ) | bat --highlight-line=1 --language=http --plain
21
+ echo -n " TOTP: "
22
+ keepassxc-cli show " ${KPDB} " " ${1} " --totp 2> /dev/null < <( echo " ${KPPW} " ) || echo
34
23
fi
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
mutt
2
2
password
3
3
,balance-checkbook
4
- ,mount-fritz
5
4
,shutdown_raspberrypi
6
5
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ set -Eeuo pipefail
4
4
5
5
FZF_DEFAULT_OPTS=" ${FZF_DEFAULT_OPTS:- --ansi --exact --multi --no-hscroll} "
6
6
readonly HEADER_DB_SELECTION=" Choose KeepassXC database:"
7
- readonly HEADER_PASSWORD=" Please enter the password for the KeepassX database \" %s\" : "
7
+ readonly HEADER_PASSWORD=" Please enter the password for the KeepassX database \" %s\" :"
8
8
9
9
export KPDB
10
10
export KPPW
@@ -15,9 +15,17 @@ if [ -z "${KPDB+x}" ] || [ ! -f "${KPDB}" ]; then
15
15
fi
16
16
17
17
if [ -z " ${KPPW+x} " ]; then
18
- prompt=$( printf " ${HEADER_PASSWORD} " " $( basename " ${KPDB} " ) " )
19
- IFS= read -r -s -p " ${prompt} " KPPW < /dev/tty
20
- keepassxc-cli open " ${KPDB} " < <( echo " ${KPPW} " ) 1> /dev/null 2>&1
21
- ret_code=$?
22
- return $ret_code
18
+ PROMPT=$( printf " ${HEADER_PASSWORD} $( echo $' \n Password:' ) " " $( basename " ${KPDB} " ) " )
19
+ readonly PROMPT
20
+
21
+ for _ in {1..3}; do
22
+ IFS= read -r -s -p " ${PROMPT} " KPPW < /dev/tty
23
+ keepassxc-cli open " ${KPDB} " < <( echo " ${KPPW} " ) 1> /dev/null 2>&1 && ret_code=0 && break || ret_code=$?
24
+ printf ' \nSorry, try again.\n'
25
+ done
26
+
27
+ if [[ ret_code -ne 0 ]]; then
28
+ printf " 3 incorrect password attempts"
29
+ fi
30
+ return " ${ret_code} "
23
31
fi
Original file line number Diff line number Diff line change @@ -343,6 +343,8 @@ tmux_conf_copy_to_os_clipboard=false
343
343
# -- user customizations -------------------------------------------------------
344
344
# this is the place to override or undo settings
345
345
346
+ set-option default-terminal "screen-256color"
347
+
346
348
# increase history size
347
349
#set -g history-limit 10000
348
350
@@ -369,7 +371,6 @@ set -g mode-keys vi
369
371
370
372
# Open default windows
371
373
new-session -d -s ssh_tmux
372
- new-window -n emacs -S emacs
373
374
new-window -n mutt -S neomutt
374
375
new-window -n bash -S
375
376
You can’t perform that action at this time.
0 commit comments