- commit
- 450c807
- parent
- 2871ca1
- author
- xxwhirlpool
- date
- 2026-03-12 17:05:21 -0400 EDT
misc
8 files changed,
+20,
-12
+1,
-0
1@@ -11,6 +11,7 @@ fi
2 if [[ ! "$(command -v batcat)" ]]; then
3 cat_cmd="cat"
4 else
5+ export BAT_PAGER=""
6 cat_cmd="batcat"
7 fi
8
+8,
-1
1@@ -1,3 +1,10 @@
2 #!/usr/bin/env bash
3
4-micro "$(command -v "$1")"
5+cmd="$1"
6+
7+if [[ ! $(command -v "$cmd") ]]; then
8+ echo "command does not exist"
9+ exit 1
10+fi
11+
12+micro "$(command -v "$cmd")"
+2,
-2
1@@ -6,7 +6,7 @@
2 # - `lowerd -i`
3
4 default() {
5- tr '[:upper:]' '[:lower:]' | tee >(xclip -selection clipboard)
6+ tr '[:upper:]' '[:lower:]' | perl -pe "chomp if eof" | tee >(xclip -selection clipboard)
7 }
8
9 takearg() {
10@@ -14,7 +14,7 @@ takearg() {
11 }
12
13 stdinpaste() {
14- gum write --header="paste text here" | tr '[:upper:]' '[:lower:]' | batcat --paging=never | tee >(xclip -selection clipboard)
15+ gum write --header="paste text here" | tr '[:upper:]' '[:lower:]' | perl -pe "chomp if eof" | batcat --paging=never | tee >(xclip -selection clipboard)
16 }
17
18 case "$1" in
+1,
-1
1@@ -11,7 +11,7 @@
2 # functions
3 fromstdin() {
4 # declare some vars
5- MDFILE="/tmp/$(openssl rand -hex 5).md"
6+ MDFILE=$(mktemp --suffix .md)
7 HTMLFILE="${MDFILE%.*}.html"
8 HTMLFILE_FINAL="${HTMLFILE%.*}_final.html"
9 # prompt user to paste markdown formatted text, then write it to a temp file
+1,
-1
1@@ -8,4 +8,4 @@ cd "$WORKDIR" || exit 1
2
3 for f in *.jpg; do mv "$f" "$TMPDIR"; done
4
5-cd "$TMPDIR" && magick -size 3000x4000 ./*glob*.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf ./*glob*.jpg
6+cd "$TMPDIR" && magick -size 3000x4000 *.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf *.jpg
+3,
-3
1@@ -1,7 +1,7 @@
2 #!/usr/bin/env bash
3
4 unwraptxt() {
5- TXTFILE="/tmp/$(openssl rand -hex 5).txt"
6+ TXTFILE=$(mktemp --suffix .txt)
7 TXTFILE_FIN="${TXTFILE%.*}_final.txt"
8 gum write --header="paste wrapped text below" > "$TXTFILE"
9 perl -00 -lpe 's/\n/ /g' < "$TXTFILE" > "$TXTFILE_FIN"
10@@ -11,7 +11,7 @@ unwraptxt() {
11 }
12
13 wraptxt() {
14- WRTXTFILE="/tmp/$(openssl rand -hex 5).txt"
15+ WRTXTFILE=$(mktemp --suffix .txt)
16 WRTXTFILE_FIN="${WRTXTFILE%.*}_final.txt"
17 gum write --header="paste text below" > "$WRTXTFILE"
18 FOLDNUM=$(gum input --placeholder "number of characters to wrap to")
19@@ -22,7 +22,7 @@ wraptxt() {
20 }
21
22 wdcount() {
23- WCTXTFL="/tmp/$(openssl rand -hex 5).txt"
24+ WCTXTFL=$(mktemp --suffix .txt)
25 gum write --header="paste text below" > "$WCTXTFL"
26 WCNUM=$(wc -w "$WCTXTFL" | awk '{print $1}')
27 echo -e "$(gum style --foreground=#f4b8e4 --border none 'total word count'): $WCNUM"
+2,
-2
1@@ -6,7 +6,7 @@
2 # - `upperd -i`
3
4 default() {
5- tr '[:lower:]' '[:upper:]' | tee >(xclip -selection clipboard)
6+ tr '[:lower:]' '[:upper:]' | perl -pe "chomp if eof" | tee >(xclip -selection clipboard)
7 }
8
9 takearg() {
10@@ -14,7 +14,7 @@ takearg() {
11 }
12
13 stdinpaste() {
14- gum write --header="paste text here" | tr '[:lower:]' '[:upper:]' | batcat --paging=never | tee >(xclip -selection clipboard)
15+ gum write --header="paste text here" | tr '[:lower:]' '[:upper:]' | perl -pe "chomp if eof" | batcat --paging=never | tee >(xclip -selection clipboard)
16 }
17
18 case "$1" in
+2,
-2
1@@ -8,5 +8,5 @@ if [ $# -eq 0 ]; then
2 fi
3
4 # format:
5-# best audio + best video, excluding AI upscales
6-yt-dlp -f "ba/best[format_id!*=-sr]+bv*[format_id!*=-sr]" "$URL"
7+# best audio + best video
8+yt-dlp -f "ba+bv" "$URL"