forked from colonelpanic/dotfiles
Merge branch 'master' of github.com:IvanMalison/dotfiles
This commit is contained in:
commit
47175bf934
@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
PASSWORD="$(keepasshttp.py --get -u "http://system.com" | jq '.[].password' | unescape.py)"
|
|
||||||
sleep .1s
|
|
||||||
xdotool type "$PASSWORD"
|
|
3
dotfiles/lib/bin/type_system_password.sh
Executable file
3
dotfiles/lib/bin/type_system_password.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
xdotool type --clearmodifiers "$(keepass_system_password)"
|
@ -464,6 +464,6 @@ function localip {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function system_password {
|
function all_lines_after {
|
||||||
keepasshttp.py --get -u "http://system.com" | jq '.[].password' | unescape.py
|
sed -n "/$1/"'$p'
|
||||||
}
|
}
|
||||||
|
39
dotfiles/lib/shellenv/keepass.sh
Normal file
39
dotfiles/lib/shellenv/keepass.sh
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
keepass_system_password() {
|
||||||
|
keepasshttp.py --get -u "http://$(hostname).systempassword" |
|
||||||
|
jq '.[].password' | unescape.py
|
||||||
|
}
|
||||||
|
|
||||||
|
keepass_password() {
|
||||||
|
keepasshttp.py --get -u "http://keepass.password" |
|
||||||
|
jq '.[].password' | unescape.py
|
||||||
|
}
|
||||||
|
|
||||||
|
my_kp() {
|
||||||
|
kpcli --kdb "$HOME/SparkleShare/config/db.kdbx" \
|
||||||
|
--key "$HOME/SparkleShare/config/creds/keepass.key" \
|
||||||
|
--pwfile <(keepass_password) "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
list_passwords() {
|
||||||
|
my_kp --command 'ls Root/' | sed -n '/=== Entries ===/,$p' | tail -n +2
|
||||||
|
}
|
||||||
|
|
||||||
|
get_pass_from_entry() {
|
||||||
|
grep -E '^ *Pass:' | get_cols 2
|
||||||
|
}
|
||||||
|
|
||||||
|
select_password() {
|
||||||
|
list_passwords | rofi -dmenu -i | get_cols 2
|
||||||
|
}
|
||||||
|
|
||||||
|
get_password() {
|
||||||
|
my_kp --command "show -f Root/$1" | get_pass_from_entry
|
||||||
|
}
|
||||||
|
|
||||||
|
echo_selected_password() {
|
||||||
|
get_password "$(select_password)"
|
||||||
|
}
|
||||||
|
|
||||||
|
type_selected_password() {
|
||||||
|
xdotool type --clearmodifiers "$(echo_selected_password)"
|
||||||
|
}
|
@ -624,7 +624,7 @@ addKeys conf@XConfig {modMask = modm} =
|
|||||||
, ((mod3Mask .|. controlMask, xK_1), toggleFadingForActiveScreen)
|
, ((mod3Mask .|. controlMask, xK_1), toggleFadingForActiveScreen)
|
||||||
, ((mod3Mask, xK_e), moveTo Next EmptyWS)
|
, ((mod3Mask, xK_e), moveTo Next EmptyWS)
|
||||||
, ((mod3Mask, xK_v), spawn "copyq_rofi.sh")
|
, ((mod3Mask, xK_v), spawn "copyq_rofi.sh")
|
||||||
, ((mod3Mask, xK_p), spawn "system_password.sh")
|
, ((mod3Mask, xK_p), spawn "type_system_password.sh")
|
||||||
, ((mod3Mask, xK_h), spawn "screenshot.sh")
|
, ((mod3Mask, xK_h), spawn "screenshot.sh")
|
||||||
, ((mod3Mask, xK_c), spawn "shell_command.sh")
|
, ((mod3Mask, xK_c), spawn "shell_command.sh")
|
||||||
, ((mod3Mask .|. shiftMask, xK_l), spawn "dm-tool lock")
|
, ((mod3Mask .|. shiftMask, xK_l), spawn "dm-tool lock")
|
||||||
|
Loading…
Reference in New Issue
Block a user