dustin
/
zdotdir
Archived
1
0
Fork 0

Compare commits

...

6 Commits

Author SHA1 Message Date
Dustin 4e63427646 zshrc: Always use Gentoo prompt 2020-05-03 13:25:16 -05:00
Dustin 6c18587fcf zshrc: Launch gpg-agent
I like to use `gpg-agent` as my SSH agent now.  This makes it possible
to use hardware keys (Yubikey, and hopefully soon Solo), and helps keep
the keys more secure by periodically locking them and requiring the
password to unlock them again.

Occasionally, `gpg-agent` gets in a weird state where it stops
responding.  I usually fix this with:

    echo KILLAGENT | gpg-connect-agent
    gpg-connect-agent /bye
    gpg-connect-agent updatestartuptty /bye
2020-05-03 13:21:33 -05:00
Dustin 8844aead74 functions: vmip: Print all addresses
Since I no longer test FMOS in IPv6-only environments, I need `vmip` to
show IPv4 addresses, too.
2020-05-03 13:20:40 -05:00
Dustin 2ff70f36b5 zshrc: Load precmd in Alacritty
Alacritty has its own TERM string now.
2020-05-03 13:19:44 -05:00
Dustin d48954bf81 zshrc: Set LESS
Fedora et al. do not set the `LESS` environment variable like Gentoo
does.  As a result, `less` does not interpret ANSI color codes by
default, making the output from `gs`, etc. aliases unreadable.
2020-05-03 13:18:11 -05:00
Dustin ec41e37b4b Add .zshenv
`.zshenv` is read for all shells, interactive or not, making it the best
place to set variables that always apply.  Unfortunately, it cannot be
kept in `ZDOTDIR`, since that variable has to be set in that same
script.  To work around this, the "real" `.zshenv` can source the one in
`ZDOTDIR`.
2020-05-03 13:12:46 -05:00
5 changed files with 14 additions and 17 deletions

View File

@ -1,6 +0,0 @@
typeset -U path
path[1,0]=~/.local/bin
if [[ -r ${ZDOTDIR:-${HOME}}/.zprofile.local ]]; then
. ${ZDOTDIR:-${HOME}}/.zprofile.local
fi

6
.zshenv Normal file
View File

@ -0,0 +1,6 @@
export EDITOR=vim
typeset -U path
path[1,0]=~/.npm/bin
path[1,0]=~/.cargo/bin
path[1,0]=~/.local/bin

14
.zshrc
View File

@ -7,6 +7,7 @@ setopt HIST_IGNORE_SPACE
setopt INTERACTIVE_COMMENTS
export LESSCOLOR=1
export LESS='-R'
export PYTHONWARNINGS=default,ignore::ImportWarning
export NOSE_REDNOSE=1
@ -38,7 +39,7 @@ typeset -U fpath
fpath[1,0]=~/.zsh/functions
case $TERM in
*xterm*|rxvt)
alacritty|*xterm*|rxvt|screen)
autoload precmd
;;
esac
@ -57,12 +58,7 @@ done
autoload -U compinit promptinit
compinit
promptinit
prompt gentoo
case "$(. /etc/os-release; echo $ID)" in;
gentoo)
prompt gentoo
;;
centos|redhat|rhel)
prompt redhat
;;
esac
gpg-connect-agent /bye
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"

3
README
View File

@ -1,4 +1,5 @@
Add this line to ~/.zshenv in order to use these ZSH configuration files
Add these lines to ~/.zshenv in order to use these ZSH configuration files
without copying/linking them to the "standard" paths:
export ZDOTDIR=${HOME}/.zsh
source ${ZDOTDIR}/.zshenv

View File

@ -1,2 +1,2 @@
virsh qemu-agent-command $1 '{"execute":"guest-network-get-interfaces"}' \
| jq -r '.return | .[] | select(.name=="eth0") | .["ip-addresses"] | map(select(.["ip-address-type"] == "ipv6" and (.["ip-address"]|startswith("fe80")|not)))[0]["ip-address"]'
| jq -r '.return | .[] | select(.name!="lo") | .["ip-addresses"] | .[] | .["ip-address"]'