|
@@ -136,7 +136,7 @@ package() { |
|
|
|
|
|
|
|
|
editor() { |
|
|
editor() { |
|
|
#handle spacing in filenames bug |
|
|
#handle spacing in filenames bug |
|
|
file=$(mru list | dmenu -i -l 10 -p 'edit what?') |
|
|
|
|
|
|
|
|
file=$(mru list | dmenu -i -l 10 -p 'edit file') |
|
|
if [ -z "$file" ]; then exit; fi |
|
|
if [ -z "$file" ]; then exit; fi |
|
|
first=$(printf "$file" | head -n1 -) |
|
|
first=$(printf "$file" | head -n1 -) |
|
|
d=$(dirname "$first") |
|
|
d=$(dirname "$first") |
|
@@ -146,7 +146,7 @@ editor() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
opener() { |
|
|
opener() { |
|
|
mru list | dmenu -i -l 20 -p 'open' | while read f; do mru insert "$f" & xdg-open $f; done |
|
|
|
|
|
|
|
|
mru list | dmenu -i -l 20 -p 'open' | while read f; do xdg-open "$f"; done |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
screenshot() { |
|
|
screenshot() { |
|
@@ -272,10 +272,17 @@ cmd_clip() { |
|
|
printf "%s" "$value" | xclip -selection clipboard |
|
|
printf "%s" "$value" | xclip -selection clipboard |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
username() { |
|
|
|
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
|
|
|
|
|
|
sel_account() { |
|
|
|
|
|
account=$( |
|
|
|
|
|
find ~/.password-store/[!\.]* -type f | |
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
dmenu -p 'account') |
|
|
|
|
|
|
|
|
dmenu -p 'account' |
|
|
|
|
|
) |
|
|
|
|
|
if [ -z "$account" ]; then exit; fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
username() { |
|
|
|
|
|
account=$(sel_account) |
|
|
if [ -z "$account" ]; then exit; fi |
|
|
if [ -z "$account" ]; then exit; fi |
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
dmenu -p 'which username' | xclip -f -selection clipboard) |
|
|
dmenu -p 'which username' | xclip -f -selection clipboard) |
|
@@ -284,6 +291,8 @@ username() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
password() { |
|
|
password() { |
|
|
|
|
|
rm prompt-login-* |
|
|
|
|
|
touch /tmp/prompt-login-$$ |
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
dmenu -p 'which service') |
|
|
dmenu -p 'which service') |
|
@@ -293,31 +302,27 @@ password() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
other_password() { |
|
|
other_password() { |
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
|
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
|
|
|
dmenu -p 'service') |
|
|
|
|
|
if [ -z "$account" ]; then exit; fi |
|
|
|
|
|
|
|
|
account=$(sel_account) |
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
dmenu -p 'which user password') |
|
|
dmenu -p 'which user password') |
|
|
if [ -z "$name" ]; then exit; fi |
|
|
if [ -z "$name" ]; then exit; fi |
|
|
|
|
|
pass show $account | sed "/^$/,/^username: $name/ { /^$/n }" | head -n1 | tr -d '\n' | xclip -selection clipboard |
|
|
|
|
|
|
|
|
notify-send -u low -t 2000 "password copied" "$account: $name" |
|
|
notify-send -u low -t 2000 "password copied" "$account: $name" |
|
|
|
|
|
|
|
|
#figure out range selections |
|
|
|
|
|
sed -n -e "" |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
show_password() { |
|
|
show_password() { |
|
|
ls |
|
|
|
|
|
|
|
|
account=$(sel_account) |
|
|
|
|
|
info=$(pass show "$account") |
|
|
|
|
|
st -e sh -lc "printf '$info' | less" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
edit_password() { |
|
|
edit_password() { |
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
|
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
|
|
|
dmenu -p 'which service') |
|
|
|
|
|
if [ -z "$account" ]; then exit; fi |
|
|
|
|
|
error=$(st -e pass edit "$account" 2>&1) |
|
|
|
|
|
if [ -n "$error" ]; then notify-send -u low -t 3000 "password edit error" "$error"; fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
account=$(sel_account) |
|
|
|
|
|
if [ -z "$account" ]; then exit; fi |
|
|
|
|
|
error=$(st -e pass edit "$account" 2>&1) |
|
|
|
|
|
if [ -n "$error" ]; then notify-send -u low -t 3000 "password edit error" "$error"; fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
chooser() { |
|
|
chooser() { |
|
|
f=$(mru list | dmenu -i -l 20 -p 'choose file') |
|
|
f=$(mru list | dmenu -i -l 20 -p 'choose file') |
|
@@ -327,8 +332,12 @@ chooser() { |
|
|
$c "$f" |
|
|
$c "$f" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
vpn() { |
|
|
|
|
|
ls |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
case $1 in |
|
|
case $1 in |
|
|
launch) launch;; |
|
|
|
|
|
|
|
|
launch ) launch;; |
|
|
action) action;; |
|
|
action) action;; |
|
|
cmd) cmd;; |
|
|
cmd) cmd;; |
|
|
cmd_clip) cmd_clip;; |
|
|
cmd_clip) cmd_clip;; |
|
@@ -336,5 +345,6 @@ case $1 in |
|
|
search) do_search;; |
|
|
search) do_search;; |
|
|
open) opener;; |
|
|
open) opener;; |
|
|
choose) chooser;; |
|
|
choose) chooser;; |
|
|
|
|
|
vpn) vpn;; |
|
|
*) printf "Invalid argument";; |
|
|
*) printf "Invalid argument";; |
|
|
esac |
|
|
esac |