|
|
@@ -17,19 +17,19 @@ launch() { |
|
|
|
Processes" | tr -d '\t' | |
|
|
|
dmenu -i -p "Launcher") |
|
|
|
|
|
|
|
case $app in |
|
|
|
Notes) st -e vim "+cd ~/Notes/text" "+CtrlP";; |
|
|
|
Files) st -e nnn;; |
|
|
|
Editor) st -e vim;; |
|
|
|
Terminal) st;; |
|
|
|
Multiplexer) st -e tmux $*;; |
|
|
|
LBRY) lbry;; |
|
|
|
Chat) element-desktop;; |
|
|
|
Music) st -e ncmpcpp;; |
|
|
|
Browser) $browser_cmd;; |
|
|
|
Email) $browser_cmd mail.protonmail.com/login;; |
|
|
|
Processes) st -e htop;; |
|
|
|
esac |
|
|
|
case $app in |
|
|
|
Notes) st -e vim "+cd ~/Notes/text" "+CtrlP";; |
|
|
|
Files) st -e sh -lc nnn;; |
|
|
|
Editor) st -e vim;; |
|
|
|
Terminal) st;; |
|
|
|
Multiplexer) st -e tmux $*;; |
|
|
|
LBRY) lbry;; |
|
|
|
Chat) element-desktop;; |
|
|
|
Music) st -e ncmpcpp;; |
|
|
|
Browser) $browser_cmd;; |
|
|
|
Email) $browser_cmd mail.protonmail.com/login;; |
|
|
|
Processes) st -e htop;; |
|
|
|
esac |
|
|
|
} |
|
|
|
|
|
|
|
action() { |
|
|
@@ -50,6 +50,9 @@ action() { |
|
|
|
Rebind Keys |
|
|
|
Disable Bar |
|
|
|
Man |
|
|
|
Password |
|
|
|
Username |
|
|
|
Alternate password |
|
|
|
Enable Bar" | tr -d '\t' | |
|
|
|
dmenu -i -p "Actions") |
|
|
|
|
|
|
@@ -66,6 +69,9 @@ case $action in |
|
|
|
'Open page') pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";; |
|
|
|
'Command') cmd;; |
|
|
|
'Command to clipboard') cmd_clip;; |
|
|
|
'Username') username;; |
|
|
|
'Password') password;; |
|
|
|
'Alternate password') other_password;; |
|
|
|
'Man') st -e man "$(printf "" | dmenu -p 'man')";; |
|
|
|
'Go page') num=$(go_page); pages pager $num;; |
|
|
|
esac |
|
|
@@ -181,7 +187,9 @@ infowindow() { |
|
|
|
} |
|
|
|
|
|
|
|
cmd() { |
|
|
|
sh -c "$(printf '' | dmenu -i -p 'cmd')" |
|
|
|
c="$(printf '' | dmenu -i -p 'cmd')" |
|
|
|
output=$( $c ) |
|
|
|
notify-send -u low 'command output' "$output" |
|
|
|
} |
|
|
|
|
|
|
|
cmd_clip() { |
|
|
@@ -191,6 +199,49 @@ cmd_clip() { |
|
|
|
printf "%s" "$value" | xclip -selection clipboard |
|
|
|
} |
|
|
|
|
|
|
|
username() { |
|
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
|
dmenu -p 'account') |
|
|
|
if [ -z "$account" ]; then exit; fi |
|
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
|
dmenu -p 'which username' | xclip -f -selection clipboard) |
|
|
|
if [ -z "$name" ]; then exit; fi |
|
|
|
notify-send -u low -t 2000 "username copied" "$account: $name" |
|
|
|
} |
|
|
|
|
|
|
|
password() { |
|
|
|
account=$(find ~/.password-store/[!\.]* -type f | |
|
|
|
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" | |
|
|
|
dmenu -p 'which service') |
|
|
|
pass -c $account |
|
|
|
notify-send -u low -t 1000 'password copied' "Copied $account" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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 |
|
|
|
name=$(pass show "$account" | sed -n -e "s/^username: //p" | |
|
|
|
dmenu -p 'which user password') |
|
|
|
if [ -z "$name" ]; then exit; fi |
|
|
|
notify-send -u low -t 2000 "password copied" "$account: $name" |
|
|
|
|
|
|
|
#figure out range selections |
|
|
|
sed -n -e "" |
|
|
|
} |
|
|
|
|
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
case $1 in |
|
|
|
launch) launch;; |
|
|
|
action) action;; |
|
|
@@ -201,5 +252,9 @@ case $1 in |
|
|
|
godoc) godoc;; |
|
|
|
goinfo) goinfo;; |
|
|
|
manual) manual;; |
|
|
|
username) username;; |
|
|
|
password) password;; |
|
|
|
other_password) other_password;; |
|
|
|
edit_password) edit_password;; |
|
|
|
*) printf "Invalid argument";; |
|
|
|
esac |