mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-23 20:38:16 +08:00
[dev] GPG agent forwarding; improve riot, sagt, tmux and zsh (#46)
* feat(riot): support literal ipv6 addresses (with or without ports given) feat(riot): -v, -4, and -6 fix(riot): do not call external binaries if possible * feat(riot): command git * build(riot-config): nasp.fit -> jump.nasp.fit * feat: add bnd and nor and completions * fix(zshrc): bnd exit when build error * fix(tmux): press ^a twice to send ^a * feat(riot): sshl supports specifying local port and unix sock * feat(riot): sshr for ssh -R * feat(riot): -o ServerAliveInterval=60 * feat(riot): conditionally RequestTTY * feat: zsh completion for beam and beaml * fix(frigg): ddns get ip * fix(riot): tmux error with window number and spaces The fix to spaces is just a workaround. Issue may still exist when command contains spaces. * feat(riot): ControlPersist=60s * fix(ci): riot * feat(tmux): prevent tmux from exiting copy mode after selection with mouse see: - https://www.reddit.com/r/tmux/comments/v73005/how_to_prevent_tmux_from_exiting_copy_mode_after/ - https://www.reddit.com/r/tmux/comments/1ltms6a/how_to_select_text_in_tmux_without_having_it_jump/ * feat(tmux): F12 to passthru * fix(riot): ControlPersist 60s -> 5s * feat: sne: search and edit * feat(ssh): add key ip17/sep * feat(tmux): press ESC to exit copy mode * feat(ssh): add key sk1/piv/9a * feat(ssh): add key sk1/fido2 * feat(ssh): add key openpgp:0x8774BF70 and remove key ip14/sep and ltp2 (asu127) * feat(sagent): sagt gpg; improve code * feat(sagent): check pinentry and give notes * feat(riot): add GPG agent forwarding Signed-off-by: Dict Xiong <me@beardic.cn> * feat: gitconf add gpg signature; remove macos from ci * feat(eid): add sk1 9a cert * feat(riot): better help and fix option quite->quiet * feat(riot): separate command options from riot options * feat(sagt): gpg-pin and associated tests * feat(riot): zsh completions * fix: Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix(riot): simplify and secure * fix: syntax --------- Signed-off-by: Dict Xiong <me@beardic.cn> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
31
.zshrc2
31
.zshrc2
@@ -9,6 +9,7 @@ else
|
||||
fi
|
||||
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
export PATH="$PATH:$DOTFILES/scripts"
|
||||
fpath=($DOTFILES/functions $fpath)
|
||||
export EDITOR='vim'
|
||||
# env for apps
|
||||
export PYTHONIOENCODING='UTF-8'
|
||||
@@ -130,9 +131,33 @@ alias "jcf"='jc -f'
|
||||
alias "jcfu"='jc -fu'
|
||||
alias "sc"='systemctl'
|
||||
alias "t"='tmux'
|
||||
gbes() { git for-each-ref --sort=-committerdate refs/heads refs/remotes --format="%(authordate:format:%y-%m-%d.%a %H:%M %z)|%(color:red)%(objectname:short)|%(color:yellow)%(refname:short)%(color:reset)|%(color:reset)%(authorname): %(color:green)%(subject)" --color=always | column -ts"|" | less -FX }
|
||||
sagt() { eval "$($DOTFILES/tools/sagent.sh $@)" }
|
||||
use() { nix --experimental-features nix-command --extra-experimental-features flakes shell "${(*)@/#%(#b)([^#]#)/nixpkgs#$match}" }
|
||||
gbes() { git for-each-ref --sort=-committerdate refs/heads refs/remotes --format="%(authordate:format:%y-%m-%d.%a %H:%M %z)|%(color:red)%(objectname:short)|%(color:yellow)%(refname:short)%(color:reset)|%(color:reset)%(authorname): %(color:green)%(subject)" --color=always | column -ts"|" | less -FX ; }
|
||||
sagt() {
|
||||
local output
|
||||
output="$("$DOTFILES/tools/sagent.sh" "$@")" || return $?
|
||||
eval "$output"
|
||||
}
|
||||
## nixos
|
||||
use() { nix --experimental-features nix-command --extra-experimental-features flakes shell "${(*)@/#%(#b)([^#]#)/nixpkgs#$match}" ; }
|
||||
bnd() {
|
||||
if [[ -n "$1" && -d "./hosts/$1" ]]; then
|
||||
nixos-rebuild --flake .#$1 build || return $?
|
||||
nix-diff /opt/NixOS-Config/results/hosts/$1 ./result --color=always | less
|
||||
else
|
||||
echo host $1 does not exist
|
||||
fi
|
||||
}
|
||||
nor() {
|
||||
test -n "$1" || { echo fatal: no verb given; return 1; }
|
||||
nixos-rebuild "$1" --flake .${2:+#}$2
|
||||
}
|
||||
alias 'nors'='nor switch'
|
||||
alias 'norbt'='nor boot'
|
||||
alias 'nort'='nor test'
|
||||
alias 'norb'='nor build'
|
||||
alias 'nordb'='nor dry-build'
|
||||
alias 'norda'='nor dry-activate'
|
||||
|
||||
|
||||
# key bindings
|
||||
bindkey "^b" beginning-of-line # ctrl+b
|
||||
|
||||
Reference in New Issue
Block a user