Commit 46c7e7b
xxwhirlpool
·
2026-04-01 21:12:15 -0400 EDT
parent eeab81c
passmenu support for pass-otp, bashrc laptop
2 files changed,
+21,
-5
+10,
-0
| ... | ... | @@ -101,6 +101,7 @@ alias c="clear" | |
| 101 | 101 | alias updupgr="sudo apt update && sudo apt upgrade" | |
| 102 | 102 | alias freeze="freeze -c user" | |
| 103 | 103 | alias glow="glow -p" | |
| 104 | + | alias unfuckwifi="sudo systemctl restart NetworkManager" | |
| 104 | 105 | ||
| 105 | 106 | # some cd bookmarks | |
| 106 | 107 | alias dotf="cd /home/kat/dotfiles" |
| ... | ... | @@ -160,6 +161,15 @@ export FZF_DEFAULT_OPTS=" \ | |
| 160 | 161 | --color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \ | |
| 161 | 162 | --color=border:#414559,label:#C6D0F5" | |
| 162 | 163 | ||
| 164 | + | export FZF_CTRL_T_OPTS=" | |
| 165 | + | --walker-skip .git,node_modules,target | |
| 166 | + | --preview 'batcat -n --color=always {}' | |
| 167 | + | --bind 'ctrl-/:change-preview-window(down|hidden|)'" | |
| 168 | + | ||
| 169 | + | export FZF_ALT_C_OPTS=" | |
| 170 | + | --walker-skip .git,node_modules,target | |
| 171 | + | --preview 'tree -C {}'" | |
| 172 | + | ||
| 163 | 173 | export LEDGER_FILE=~/.config/hledger/katmoney.journal | |
| 164 | 174 | ||
| 165 | 175 | ###################################### |
| ... | ... | @@ -1,9 +1,9 @@ | |
| 1 | 1 | #!/usr/bin/env bash | |
| 2 | 2 | ||
| 3 | - | shopt -s nullglob globstar | |
| 3 | + | shopt -s nullglob globstar extglob | |
| 4 | 4 | ||
| 5 | 5 | typeit=0 | |
| 6 | - | if [[ $1 == "--type" ]]; then | |
| 6 | + | if [[ "$1" == "--type" ]]; then | |
| 7 | 7 | typeit=1 | |
| 8 | 8 | shift | |
| 9 | 9 | fi |
| ... | ... | @@ -15,10 +15,16 @@ password_files=( "${password_files[@]%.gpg}" ) | |
| 15 | 15 | ||
| 16 | 16 | password=$(printf '%s\n' "${password_files[@]}" | dmenu -i -c -l 10 "$@") | |
| 17 | 17 | ||
| 18 | - | [[ -n $password ]] || exit | |
| 18 | + | [[ -n "$password" ]] || exit | |
| 19 | 19 | ||
| 20 | - | if [[ $typeit -eq 0 ]]; then | |
| 21 | - | pass show -c "$password" 2>/dev/null | |
| 20 | + | if [[ "$typeit" -eq 0 ]]; then | |
| 21 | + | # if you pick something in the "2fa" folder, generate a code | |
| 22 | + | # else it's a normal password, copy it to clipboard | |
| 23 | + | if [[ "${password_files[*]}" =~ 2fa && "$password" =~ 2fa ]]; then | |
| 24 | + | pass otp "$password" | perl -pe "chomp if eof" | xclip -sel clipboard | |
| 25 | + | else | |
| 26 | + | pass show -c "$password" 2>/dev/null | |
| 27 | + | fi | |
| 22 | 28 | else | |
| 23 | 29 | pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | |
| 24 | 30 | fi |