Merge branch 'master' of github.com:IvanMalison/dotfiles

This commit is contained in:
Ivan Malison 2016-12-11 08:18:18 -08:00
commit 47175bf934
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
6 changed files with 51 additions and 13 deletions

View File

@ -23,14 +23,14 @@
ffr = "!ffr() { git fetch $1 && git ff $1/$(git which-branch) && git suir; }; ffr" ffr = "!ffr() { git fetch $1 && git ff $1/$(git which-branch) && git suir; }; ffr"
file-exists = "!f() { git ls-files $1 --error-unmatch > /dev/null 2> /dev/null; }; f" file-exists = "!f() { git ls-files $1 --error-unmatch > /dev/null 2> /dev/null; }; f"
force-master = "!f() { git fetch origin && git rh && git master; }; f" force-master = "!f() { git fetch origin && git rh && git master; }; f"
icd = "!d() { git difftool --no-prompt --extcmd 'icdiff --cols=200' $@ | $(git config --get core.pager); }; d" icd = "!d() { git difftool --no-prompt --extcmd 'icdiff --cols=200' $@ | $(git config --get core.pager); }; d"
icdl = "!d() { git difftool --no-prompt --extcmd 'icdiff --line-numbers --cols=200' $@ | $(git config --get core.pager); }; d" icdl = "!d() { git difftool --no-prompt --extcmd 'icdiff --line-numbers --cols=200' $@ | $(git config --get core.pager); }; d"
ignore = "!i() { printf \"\n$1\" >> "`git root`/.gitignore"; }; i" ignore = "!i() { printf \"\n$1\" >> "`git root`/.gitignore"; }; i"
ignore-untracked="!git untracked | xargs -n1 git ignore" ignore-untracked="!git untracked | xargs -n1 git ignore"
l = log --pretty=oneline --graph l = log --pretty=oneline --graph
master = checkout origin/master -B master master = checkout origin/master -B master
modified = diff HEAD --name-only modified = diff HEAD --name-only
poh = push origin HEAD poh = push origin HEAD
pohm = push origin HEAD:master pohm = push origin HEAD:master
power-clean = clean -ffd power-clean = clean -ffd
reb = "!r() { git rebase -i HEAD~$1; }; r" # Interactive rebase with the given number of latest commits reb = "!r() { git rebase -i HEAD~$1; }; r" # Interactive rebase with the given number of latest commits
@ -74,10 +74,10 @@
added = green added = green
changed = yellow changed = yellow
untracked = red untracked = red
[merge] [merge]
conflictstyle = diff3 conflictstyle = diff3
[include] [include]
path = ~/.gitconfig.custom path = ~/.gitconfig.custom
path = ~/.gitconfig.this-machine path = ~/.gitconfig.this-machine
@ -92,4 +92,4 @@
insteadOf = https://code.uber.internal/ insteadOf = https://code.uber.internal/
[branch] [branch]
autosetuprebase = always autosetuprebase = always

View File

@ -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"

View File

@ -0,0 +1,3 @@
#!/usr/bin/env zsh
xdotool type --clearmodifiers "$(keepass_system_password)"

View File

@ -87,7 +87,7 @@ function confirm() {
# call with a prompt string or use a default # call with a prompt string or use a default
read -r -p "$1" response read -r -p "$1" response
case $response in case $response in
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
return 0 return 0
;; ;;
*) *)
@ -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'
} }

View 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)"
}

View File

@ -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")