fixing merge

This commit is contained in:
Andrew Davidson 2020-05-20 09:39:47 -04:00
commit 5ca47450ad
Signed by: amd
GPG key ID: 17AF8F2A49CF25C6
9 changed files with 86 additions and 47 deletions

View file

@ -34,3 +34,5 @@
default = simple
[commit]
gpgsign = true
[gpg]
program = /usr/bin/gpg2

View file

@ -0,0 +1,3 @@
pinentry-program /usr/bin/pinentry
default-cache-ttl 600
max-cache-ttl 7200

12
gnupg/bin/pinentry-smart Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
set -eu
PINENTRY_TUI='/usr/bin/pinentry-curses'
PINENTRY_GUI='/usr/bin/pinentry-gnome3'
if [ -n "${DISPLAY-}" -a -z "${TERM-}" ]; then
exec "$PINENTRY_GUI" "$@"
else
exec "$PINENTRY_TUI" "$@"
fi

View file

@ -142,8 +142,8 @@ set pgp_verify_command="gpg --pinentry-mode loopback --no-verbose --batch --outp
set pgp_decrypt_command="gpg --pinentry-mode loopback --passphrase-fd 0 --no-verbose --batch --output - %f"
set pgp_sign_command="gpg --pinentry-mode loopback --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg --pinentry-mode loopback --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x49CF25C6 -- -r %r -- %f"
set pgp_encrypt_sign_command="pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x49CF25C6 -- -r %r -- %f"
set pgp_encrypt_only_command="/usr/lib/neomutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x49CF25C6 -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/neomutt/pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x49CF25C6 -- -r %r -- %f"
set pgp_import_command="gpg --no-verbose --import -v %f"
set pgp_export_command="gpg --no-verbose --export --armor %r"
set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r"

View file

@ -1,10 +1,10 @@
# Lazy
alias ..='cd ..'
alias lh='ls -d .*' # show hidden files/directories only
alias lsd='ls -aFhlG'
alias l='ls -al'
alias ls='ls -GFh' # Colorize output, add file type indicator, and put sizes in human readable format
alias ll='ls -GFhl' # Same as above, but in long listing format
alias lh='ls --color -d .*' # show hidden files/directories only
alias lsd='ls -aFhlG --color'
alias l='ls -al --color'
alias ls='ls -GFh --color' # Colorize output, add file type indicator, and put sizes in human readable format
alias ll='ls -GFhl --color' # Same as above, but in long listing format
# List directories sorted by size
alias dus='du -sckx * | sort -nr'
@ -21,6 +21,12 @@ alias mroyal='mosh royal -- tmux new-session -A -s main'
alias mari='mosh ari -- tmux new-session -A -s main'
alias muzi='mosh uzi -- tmux new-session -A -s main'
# fix sudo autocorrections
alias sudo="nocorrect sudo"
# A crude speedtest with curl
alias speedtest="curl -o /dev/null http://speedtest-nyc1.digitalocean.com/100mb.test"
# blank-chrome
function blank-chrome {
if [ "$@" ]; then

View file

@ -12,11 +12,11 @@ export PR_RED PR_GREEN PR_YELLOW PR_BLUE PR_WHITE PR_BLACK
export PR_BOLD_RED PR_BOLD_GREEN PR_BOLD_YELLOW PR_BOLD_BLUE
export PR_BOLD_WHITE PR_BOLD_BLACK
# Clear LSCOLORS
unset LSCOLORS
# Main change, you can see directories on a dark background
#expor tLSCOLORS=gxfxcxdxbxegedabagacad
export CLICOLOR=1
export LS_COLORS=exfxcxdxbxegedabagacad
## Clear LSCOLORS
#unset LSCOLORS
#
## Main change, you can see directories on a dark background
#export LSCOLORS=gxfxcxdxbxegedabagacad
#
#export CLICOLOR=1
#export LS_COLORS=exfxcxdxbxegedabagacad

View file

@ -15,3 +15,7 @@ export EDITOR='nvim'
# Fix gnupg
export GPG_TTY=$(tty)
# Fix GOPATH
export GOPATH="$HOME/dev/go"
export PATH="$HOME/dev/go/bin:$PATH"

View file

@ -1,30 +1,12 @@
# Truncate working directory
function truncated_pwd() {
n=$1
path=`collapse_pwd`
dirs=("${(s:/:)path}")
dirs_length=$#dirs
if [[ $dirs_length -ge $n ]]; then
((max=dirs_length - n))
for (( i = 1; i <= $max; i++ )); do
step="$dirs[$i]"
if [[ -z $step ]]; then
continue
fi
if [[ $stem =~ "^\." ]]; then
dirs[$i]=$step[0,2]
else
dirs[$i]=$step[0,1]
fi
done
# Show what requires a reboot if one is required
reboot_for() {
if test -f /var/run/reboot-required; then
echo "Reboot required for:"
cat /var/run/reboot-required.pkgs
else
echo "Nothing requires a reboot."
fi
echo ${(j:/:)dirs}
}
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
# Extract anything

View file

@ -5,32 +5,62 @@ autoload -U colors && colors # Enable colors in prompt
function git_branch {
local FULL_BRANCH="$(git symbolic-ref -q HEAD 2>/dev/null || git name-rev --name-only --no-undefined --always HEAD 2>/dev/null)"
local SHORT_BRANCH="$(echo $FULL_BRANCH | sed 's/refs\/heads\///')"
echo " %F{blue}$SHORT_BRANCH%f"
echo "$SHORT_BRANCH"
}
function git_is_ahead {
local NUM_AHEAD="$(git log --oneline @{u}.. 2>/dev/null | wc -l | tr -d ' ')"
if [ "$NUM_AHEAD" -gt 0 ]; then
echo " %F{red}↑%f"
echo ""
fi
}
function git_is_behind {
local NUM_BEHIND="$(git log --oneline ..@{u} 2>/dev/null | wc -l | tr -d ' ' )"
if [ "$NUM_BEHIND" -gt 0 ]; then
echo " %F{blue}↓%f"
echo ""
fi
}
function git_unstaged {
local CHANGED=$(git status --porcelain --ignore-submodule -unormal 2>/dev/null | wc -l)
if [ $CHANGED -gt 0 ]; then
echo -e "%F{yellow}~%f\c"
echo -e "\c"
fi
}
function current_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
# Truncate working directory
function truncated_pwd() {
n=$1
path=`current_pwd`
dirs=("${(s:/:)path}")
dirs_length=$#dirs
if [[ $dirs_length -ge $n ]]; then
((max=dirs_length - n))
for (( i = 1; i <= $max; i++ )); do
step="$dirs[$i]"
if [[ -z $step ]]; then
continue
fi
if [[ $stem =~ "^\." ]]; then
dirs[$i]=$step[0,2]
else
dirs[$i]=$step[0,1]
fi
done
fi
echo ${(j:/:)dirs}
}
PROMPT='%m ${PR_BOLD_YELLOW}$(truncated_pwd 3)$(git_branch)%{$reset_color%}$(git_unstaged)$(git_is_ahead)$(git_is_behind) %(?.%F{magenta}.%F{red})%f '
function current_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function check_reboot {
test -f /var/run/reboot-required && echo "R "
}
#PROMPT='${PR_BOLD_RED}$(check_reboot)${reset_color}%m ${PR_BOLD_YELLOW}$(truncated_pwd 3)$(git_branch)%{$reset_color%}$(git_unstaged)$(git_is_ahead)$(git_is_behind) %(?.%F{magenta}.%F{red})%f '
PROMPT='$(check_reboot)%m $(truncated_pwd 3) $(git_branch) $(git_unstaged)$(git_is_ahead)$(git_is_behind)> '