dots


commit
d4648a4
parent
64a5671
author
xxwhirlpool
date
2025-12-07 10:01:29 -0500 EST
add txt tool
1 files changed,  +21, -0
A config/.local/bin/txttools
+21, -0
 1@@ -0,0 +1,21 @@
 2+#!/usr/bin/env bash
 3+
 4+unwraptxt() {
 5+	TXTFILE="/tmp/$(openssl rand -hex 5).txt"
 6+	TXTFILE_FIN="${TXTFILE%.*}_final.txt"
 7+	gum write --header="paste wrapped text below" > "$TXTFILE"
 8+	perl -00 -lpe 's/\n/ /g' < "$TXTFILE" > "$TXTFILE_FIN"
 9+	batcat --paging=never "$TXTFILE_FIN"
10+	xclip -sel clip "$TXTFILE_FIN"
11+	rm "$TXTFILE" "$TXTFILE_FIN"
12+}
13+
14+choice() {
15+	choose=$(gum choose "unwrap")
16+	case "$choose" in
17+		*unwrap) unwraptxt ;;
18+		*) exit 0;;
19+	esac
20+}
21+
22+choice