Skip to content

Commit 6d9b4d5

Browse files
committedMar 19, 2022
config/shell: fix some debugging leftovers
1 parent e040ac0 commit 6d9b4d5

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed
 
File renamed without changes.

‎.config/shell/functions

+5-2
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,13 @@ sshl() {
210210
lemonade server -allow 127.0.0.1 &
211211
file="/var/tmp/ssh-$1"
212212
if test ! -e "$file"; then
213-
ssh-copy-id -i "$(ssh -G "$1" | grep "^identityfile " | head -1 | cut -d " " -f2- | sed "s|^~|$HOME|")" "$1" && touch "$file"
213+
if ! ssh -G "$1" | grep --silent "^user root$" && touch "$file"; then
214+
ssh-copy-id -i "$(ssh -G "$1" | grep --max-count 1 "^identityfile " | cut -d " " -f2- | sed "s|^~|$HOME|")" "$1" && touch "$file"
214215
TERM=xterm-256color kitty +kitten ssh -R 2489:127.0.0.1:2489 "$@"
215-
else TERM=xterm-256color ssh "$@"
216+
return $?
217+
fi
216218
fi
219+
TERM=xterm-256color pass ssh "$@"
217220
}
218221

219222
# Listen to loopback of mic

‎.local/bin/scripts/b

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ done
122122
# timg: images
123123
# timga: potentially viewable as image
124124
if test "$timg"; then
125+
# Don't show info on all images for gifs
125126
$inspect || $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \
126127
$(test $# -gt 1 && grid=$(expr $(tput cols) / \( 30 - $# \& $# \< 25 \| 5 \)) &&
127128
echo "-t0.2 --center $(test $# -lt 30 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \

‎.local/bin/scripts/git-repo

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ case "$1" in
1313
(lab) host=git@gitlab.com;;
1414
(*) host=$1;;
1515
esac
16-
echo "${host:-git.jfischer.org}:${3:-${user:-$(git config user.name)}}/${2:-$(basename $PWD)}.git" ;;
16+
echo "${host:-gitea@git.jfischer.org}:${3:-${user:-$(git config user.name)}}/${2:-$(basename $PWD)}.git" ;;
1717
esac

‎.local/bin/scripts/mp

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ PLAYLISTS="$MUSIC/Playlists"
77
LINKS="$MUSIC/links"
88
if test "$1" = "-r"
99
then shift
10-
test "$1" = "-v" && verbose=-v && shift
10+
test "$1" = "-v" && verbose=-v && set -x && shift
11+
# TODO this is sooo slow...
1112
for arg
1213
do filepath="$({ find "$(dirname -- "$arg")" -maxdepth 1 -name "$(basename -- "$arg")*" -exec realpath {} + ||
13-
arg-test find "$MUSIC/$(dirname -- "$arg")" "$MUSIC/Playlists/$(dirname -- "$arg")" -maxdepth 1 \
14+
find "$MUSIC/$(dirname -- "$arg")" "$MUSIC/Playlists/$(dirname -- "$arg")" -maxdepth 1 \
1415
-name "$(basename -- "$arg")*" -exec realpath {} +; } 2>/dev/null)"
1516
test -n "$verbose" && echo "Scanning path '$filepath' $(
1617
test "$arg" != "$filepath" && echo "from '$arg' ")(MUSIC: '$MUSIC', PWD: '$PWD')" >&2

0 commit comments

Comments
 (0)
Please sign in to comment.