diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-01-11 13:19:52 +0100 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-01-11 13:19:52 +0100 |
commit | 449f969b19e1b6a5e402305f2c968d9ed09dedf7 (patch) | |
tree | e3c963bd18f4d8a27800449e0ec1def2da61d6ee | |
parent | 0467fa38e57589f2bcd5cfeca5643f360800460e (diff) |
checkpoint
-rwxr-xr-x | bin/common/gt | 5 | ||||
-rwxr-xr-x | bin/common/gt-cmd | 21 | ||||
-rwxr-xr-x | bin/extra/include.sh | 8 | ||||
-rwxr-xr-x | config/home/.xprofile | 2 | ||||
-rw-r--r-- | config/home/.zshenv | 3 |
5 files changed, 28 insertions, 11 deletions
diff --git a/bin/common/gt b/bin/common/gt index e048912..2fb5840 100755 --- a/bin/common/gt +++ b/bin/common/gt @@ -102,7 +102,6 @@ while getopts ":a:c:f:lsheu" opt; do list_repos | parallel gt-cmd {} pull else list_repos | xargs -I{} gt-cmd {} pull - fi >&2 printf 'push:\n' @@ -111,9 +110,9 @@ while getopts ":a:c:f:lsheu" opt; do awk -F: '/↑/ {print $1}' | sed "s@^~@$HOME@" | if [ "$parallel" ]; then - parallel gt-cmd {} push + parallel gt-cmd {} push else - xargs -I{} gt-cmd {} push + xargs -I{} gt-cmd {} push fi ;; h) help ;; diff --git a/bin/common/gt-cmd b/bin/common/gt-cmd index 8cf30ae..56b8df6 100755 --- a/bin/common/gt-cmd +++ b/bin/common/gt-cmd @@ -21,14 +21,25 @@ fi # path to key: ~/.ssh/<hostname>.pub # where <hostname> is the same in ssh config r="$(grep "$repo" "$REPOS" | cut -f 2 -d ' ' | cut -f 2 -d '@' | cut -f 1 -d ':')" -if { [ "$command" = "push" ] || [ "$command" = "pull" ] || [ "$command" = "fetch" ]; } && - # key not registered in agent - ! { ssh-add -L | grep "$(cat "$HOME/.ssh/$r.pub")" > /dev/null; } +if { [ "$command" = "push" ] || + [ "$command" = "pull" ] || + [ "$command" = "fetch" ]; } then - printf '%s: '\''%s'\'' not in ssh-agent\n' "$repo_pretty" "$r" - exit 1 + Keyfile="$HOME/.ssh/$r.pub" + if [ ! -f "$Keyfile" ] + then + printf '%s: no identity file '\''%s'\''\n' "$repo_pretty" "$Keyfile" + exit 1 + fi + + if ! ssh-add -L | grep "$(cat "$Keyfile")" > /dev/null + then + printf '%s: '\''%s'\'' not in ssh-agent\n' "$repo_pretty" "$r" + exit 1 + fi fi + git -C "$repo" "$command" $args >/dev/null 2>&1 [ $? -gt 0 ] && s="x" || s="o" printf '%s: %s\n' "$repo_pretty" "$s" diff --git a/bin/extra/include.sh b/bin/extra/include.sh index 1a2c1f4..2b5d536 100755 --- a/bin/extra/include.sh +++ b/bin/extra/include.sh @@ -1,2 +1,8 @@ #!/bin/sh -man -s 2,3p,3 -P cat "$1" | grep -m 1 -o '#include <[^>]\+>' + +# Show which C header needs to be included for '$1' by looking at the manpages for that keyword. + +{ man -c 2 "$1" || + man -c 3p "$1" || + man -c 3 "$1"; } 2>/dev/null | col -b | +grep -m 1 -o '#include <[^>]\+>' diff --git a/config/home/.xprofile b/config/home/.xprofile index 718a319..9051049 100755 --- a/config/home/.xprofile +++ b/config/home/.xprofile @@ -2,7 +2,7 @@ feh --no-fehbg --bg-scale "$HOME"/pics/wallpaper & -setxkbmap us -variant colemak -option ctrl:swapcaps,menu:altwin & +setxkbmap us -variant colemak -option ctrl:swapcaps,altwin:menu_win & # TODO: check if this is home if [ "$(hostname)" = "winter" ]; then diff --git a/config/home/.zshenv b/config/home/.zshenv index 9a295d2..5fbc1b9 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -101,7 +101,8 @@ export PATH="$PATH:$GOPATH/bin" export PLAN9=/usr/lib/plan9 export PATH="$PATH:$PLAN9/bin" -export LD_LIBRARY_PATH=/usr/local/lib/ +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/usr/local/lib/ +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":. export MAKEFLAGS="-j$(nproc)" |