Commit e511608

xxwhirlpool  ·  2026-10-22 10:26:18 -0400 EDT
parent 12d2e74
lotta cleanup
25 files changed,  +77, -128
+3, -20
 1@@ -93,7 +93,6 @@ alias rced="micro ~/.bashrc && source ~/.bashrc"
 2 alias icat="kitty +kitten icat"
 3 alias ps="ps auxww"
 4 alias dd="ask dd"
 5-alias freeze="freeze -c user"
 6 alias qrcode="qrencode -t ansiutf8"
 7 alias ffmpeg="ffmpeg -hide_banner"
 8 alias open="xdg-open"
 9@@ -101,10 +100,8 @@ alias c="clear"
10 alias unfuckwifi="sudo systemctl restart NetworkManager"
11 alias uptime="uptime -p"
12 alias irc="senpai"
13-alias xmpp="profanity"
14 alias email="aerc"
15 alias updupgr="sudo apt update && sudo apt upgrade"
16-alias winek="wineserver -k"
17 alias docker="sudo docker"
18 
19 # weather stuff
20@@ -112,20 +109,19 @@ alias wttr="curl https://wttr.in/nyc?F0Au"
21 alias weather="wttr"
22 alias wttrlg="curl https://wttr.in/nyc?F1uq"
23 alias weatherlg="wttrlg"
24-alias sun="daylight --short --timezone='America/New_York' | lolcat"
25+alias sun="daylight --short --timezone='America/New_York'"
26 
27 # git
28 alias gitall="git remote | xargs -L1 git push --all"
29 alias gyolo="git add . && git commit -m 'yolo'"
30 alias gitd="git diff --staged"
31-alias gdiff="gitd"
32 alias gits="git status"
33 alias gita="git add ."
34 alias gitlc="git diff HEAD~"
35 
36 # dev
37 alias irb="rv run irb"
38-alias ipy="python3 -i"
39+alias ijs="node"
40 
41 # vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn
42 alias mftp="mvpn filezilla"
43@@ -226,20 +222,7 @@ passgen() {
44 	date +%s | sha256sum | base64 | head -c "$PASSLENGTH"; echo
45 }
46 
47-# display random ASCII art from
48-# custom dir of art in dotfiles
49-# using arttime (github: poetaman/arttime)
50-playart() {
51-	ARTDIR="/home/kat/dotfiles/config/.local/share/arttime/textart"
52-	ARTSHUF=$(find "$ARTDIR" -type f | shuf -n1)
53-
54-	for art in $ARTSHUF; do
55-		arttime --nolearn -a "$art" --ac 5
56-	done
57-}
58-
59-# to get quick notifs
60-# after long commands
61+# to get quick notifs after long commands
62 notif() {
63 	notify-send "done!"
64 	sfx chime
+0, -8
1@@ -1,8 +0,0 @@
2-é latin small letter e with acute (U+00E9) [rosé]
3-É latin capital letter E with acute (U+00C9) [ROSÉ]
4-ñ latin small letter n with tilde (U+00F1) [mañana]
5-Ñ latin capital letter N with tilde (U+00D1) [MAÑANA]
6-— em dash (U+2014)
7-♡ white heart suit (U+2661)
8-♥ black heart suit (U+2665)
9-❥ rotated heavy black heart bullet (U+2765)
+1, -1
1@@ -2,7 +2,7 @@
2 #
3 # basic confirmation dialog
4 
5-if [[ $# -eq 0 ]]; then
6+if [[ "$#" -eq 0 ]]; then
7 	echo "usage: $(basename "$0") [COMMAND]"
8 	exit 1
9 fi
+1, -1
1@@ -2,7 +2,7 @@
2 
3 warning() {
4 	if [[ "$*" =~ $(df . | awk "{print $1}" | tail -n1) ]]; then
5-		if ! gum confirm "WARNING: you are executing this command on your current drive! be careful!" --default="false" --timeout="15s"; then
6+		if [[ ! "$(gum confirm 'WARNING: you are executing this command on your current drive! be careful!' --default='false' --timeout='15s')" ]]; then
7 			echo "nope"
8 			exit 1
9 		fi
+1, -1
1@@ -3,7 +3,7 @@
2 # blatantly copied from evan hahn:
3 # https://github.com/EvanHahn/dotfiles/blob/main/home/bin/bin/catbin
4 
5-if [[ $# -eq 0 ]]; then
6+if [[ "$#" -eq 0 ]]; then
7 	echo "usage: $(basename "$0") [FILENAME]"
8 	exit 1
9 fi
R config/.local/bin/loot => config/.local/bin/gitloot
+0, -0
+0, -10
 1@@ -1,10 +0,0 @@
 2-#!/usr/bin/env bash
 3-
 4-if [[ $(command -v deno ) ]]; then
 5-	deno repl
 6-elif [[ $(command -v node) ]]; then
 7-	node
 8-else
 9-	echo "no JS runtime found :("
10-	exit 1
11-fi
+6, -5
 1@@ -1,9 +1,9 @@
 2 #!/usr/bin/env bash
 3-#
 4-# usage:
 5-#   - `echo "EXAMPLE" | lowerd`
 6-#   - `lowerd "EXAMPLE"`
 7-#   - `lowerd -i`
 8+
 9+usage() {
10+	echo "usage: $(basename "$0") [TEXT]"
11+	echo "options: -i (input text) | -h (print usage & exit)"
12+}
13 
14 default() {
15 	tr '[:upper:]' '[:lower:]' | tr -d "\n" | tee >(xclip -selection clipboard) && echo -e "\n"
16@@ -20,5 +20,6 @@ stdinpaste() {
17 case "$1" in
18 	"") default ;;
19 	"-i") stdinpaste ;;
20+	"-h") usage ;;
21 	*) takearg "$@" ;;
22 esac
+17, -1
 1@@ -2,9 +2,25 @@
 2 #
 3 # open a temp file as a scratchpad
 4 
 5+# check if $EDITOR is defined
 6+# if empty, fall back to `nano`
 7+if [[ -z "$EDITOR" ]]; then
 8+	EDITOR="$(command -v nano)"
 9+fi
10+
11+# make the file
12 file="$(mktemp --suffix _scratchpad)"
13 
14+# open file
15 "$EDITOR" "$file"
16 
17+# if file is empty, exit
18+if [[ ! -s "$file" ]]; then
19+	echo "file is empty, nvm"
20+	rm -f "$file"
21+	exit 1
22+fi
23+
24+# if file is not empty, show path to file
25 gum_echo "FILEPATH: " | tr -d "\n"
26-realpath "$file" | lolcat -p 1.5
27+realpath "$file"
+2, -2
 1@@ -2,11 +2,11 @@
 2 
 3 # check for deps (messily)
 4 if [[ ! "$(command -v timer)" ]]; then
 5-	echo "missing required dependency: timer"
 6+	echo "missing required dep: timer"
 7 	echo "github.com/caarlos0/timer"
 8 	exit 1
 9 elif [[ ! "$(command -v gum)" ]]; then
10-	echo "missing required dependency: gum"
11+	echo "missing required dep: gum"
12 	echo "github.com/charmbracelet/gum"
13 	exit 1
14 fi
+0, -1
1@@ -4,7 +4,6 @@ arrayprg=(
2 	"librewolf"
3 	"Discord"
4 	"obsidian"
5-	"strawberry"
6 	"senpai"
7 	"SoulseekQt-2018"
8 )
+6, -1
 1@@ -1,15 +1,20 @@
 2 #!/usr/bin/env bash
 3 
 4-if [[ $# -eq 0 || ! -f "$1" ]]; then
 5+# if no args given, or the img file doesn't exist,
 6+# print this and exit
 7+if [[ "$#" -eq 0 || ! -f "$1" ]]; then
 8 	echo "usage: $(basename "$0") [IMAGE]"
 9 	exit 1
10 fi
11 
12+# check for tesseract dep
13 if [[ ! $(command -v tesseract) ]]; then
14 	echo "missing required dep: tesseract"
15 	exit 1
16 fi
17 
18+# img is first arg
19 img="$1"
20 
21+# do the ocr
22 tesseract --dpi 254 "$img" stdout
+0, -27
 1@@ -1,27 +0,0 @@
 2-#!/usr/bin/env bash
 3-
 4-if [[ $# -eq 0 ]]; then
 5-	echo "usage: $(basename "$0") [PROBLEM]"
 6-	exit 1
 7-fi
 8-
 9-# printf cmd will escape spaces & add quotes
10-# so 1+2 and 1 + 2 will have the same result
11-# (i think)
12-problem=$(printf "%q" "$@")
13-
14-# if $problem contains spaces, trim it down
15-[[ "$problem" =~ [[:space:]] ]]; problem2="${problem//[[:space:]]/}"
16-
17-# if $problem contains an "x", change to "*"
18-# sometimes i type "x" for multiplication
19-# perl by default does something else with "x"
20-[[ "$problem" =~ x ]]; problem2="${problem2//x/*}"
21-
22-# fixes some weird thing where a backslash
23-# would fuck with the math
24-[[ "$problem" =~ \/ ]]; problem2="${problem2//\\}"
25-
26-# -l adds a newline
27-# -e executes $problem
28-perl -le "print $problem2"
+1, -1
1@@ -1,6 +1,6 @@
2 #!/usr/bin/env bash
3 
4-if [[ $# -eq 0 ]]; then
5+if [[ "$#" -eq 0 ]]; then
6 	echo "usage: $(basename "$0") [FILENAME]"
7 	exit 1
8 fi
+12, -10
 1@@ -3,32 +3,34 @@
 2 # inspired by evan hahn:
 3 # https://codeberg.org/EvanHahn/dotfiles/src/commit/f7a9d94ae2254cb7e5f67e6e5bdb74b6467f6dec/home/bin/bin/serveit
 4 
 5+# vars
 6+port="6969"
 7+
 8+# usage text
 9 usage_help() {
10-	echo "usage: $(basename "$0") [-p] [-r | -y | -c]"
11-	echo "Options: -p (port, optional) | -r (ruby) | -y (python) | -c (python CGI)"
12+	echo "usage: $(basename "$0") [-r | -y | -c]"
13+	echo "options: -r (ruby) | -y (python) | -c (python CGI)"
14 }
15 
16-if [[ $# -eq 0 ]]; then
17+# print usage if no opts given
18+if [[ "$#" -eq 0 ]]; then
19 	usage_help
20 fi
21 
22-port_default="6969"
23-
24 py_server() {
25-	[[ "$(command -v python3)" ]]; python3 -m http.server "${port:-$port_default}" || echo "could not run python server"
26+	[[ "$(command -v python3)" ]]; python3 -m http.server "$port" || echo "could not run python server"
27 }
28 
29 pycgi_server() {
30-	[[ "$(command -v python3)" ]]; python3 -m http.server --bind localhost --cgi "${port:-$port_default}" || echo "could not run python CGI server"
31+	[[ "$(command -v python3)" ]]; python3 -m http.server --bind localhost --cgi "$port" || echo "could not run python CGI server"
32 }
33 
34 rb_server() {
35-	[[ "$(command -v ruby)" ]]; ruby -run -e httpd . -p "${port:-$port_default}" || echo "could not run ruby server"
36+	[[ "$(command -v ruby)" ]]; ruby -run -e httpd . -p "$port" || echo "could not run ruby server"
37 }
38 
39-while getopts "p:rych" opt; do
40+while getopts "rych" opt; do
41 	case "$opt" in
42-		p) port="$OPTARG" ;;
43 		y) py_server ;;
44 		c) pycgi_server ;;
45 		r) rb_server ;;
+5, -3
 1@@ -9,10 +9,12 @@
 2 URL="$1"
 3 FILE_OUT_NAME="$2"
 4 
 5-if [[ $# -eq 0 || $# -ne 2 ]]; then
 6+# if no args or <2 args (needs 2),
 7+# print usage & exit
 8+if [[ "$#" -eq 0 || "$#" -ne 2 ]]; then
 9 	echo "usage: $(basename "$0") [URL] [FILENAME]"
10 	exit 1
11 fi
12 
13-# best audio + best video under 1080p (excl. AI upscale) && incl. file extension in output
14-yt-dlp -f "ba+bv*[height<=1080p][format_id!*=-sr]" -o "$FILE_OUT_NAME.%(ext)s" "$URL" --merge-output-format mp4
15+# best audio + best video under 1080p && incl. file extension in output
16+yt-dlp -f "ba+bv*[height<=1080p]" -o "$FILE_OUT_NAME.%(ext)s" "$URL" --merge-output-format mp4
+2, -2
 1@@ -1,11 +1,11 @@
 2 #!/usr/bin/env bash
 3 
 4 if [[ ! "$(command -v exiftool)" ]]; then
 5-	echo "missing required dependency: exiftool"
 6+	echo "missing required dep: exiftool"
 7 	exit 1
 8 fi
 9 
10-if [[ $# -eq 0 ]]; then
11+if [[ "$#" -eq 0 ]]; then
12 	echo "usage: $(basename "$0") [FILENAME]"
13 	exit 1
14 fi
+1, -1
1@@ -1,7 +1,7 @@
2 #!/usr/bin/env bash
3 
4 # current date in ISO format
5-if [[ $# -eq 0 ]]; then
6+if [[ "$#" -eq 0 ]]; then
7 	echo -e "$(date '+%Y-%m-%d')"
8 fi
9 
+9, -0
 1@@ -1,5 +1,14 @@
 2 #!/usr/bin/env bash
 3 
 4+# check for deps
 5+if [[ ! "$(command -v festival)" ]]; then
 6+	echo "missing required dep: festival"
 7+	echo "github.com/festvox/festival"
 8+	exit 1
 9+fi
10+
11+# prompt for text to be read out
12 readtxt=$(gum write --header "text to be read out loud")
13 
14+# pipe the text to tts engine
15 echo "$readtxt" | festival --tts
+2, -2
 1@@ -25,7 +25,7 @@ wdcount() {
 2 	WCTXTFL=$(mktemp --suffix .txt)
 3 	gum write --header="paste text below" > "$WCTXTFL"
 4 	WCNUM=$(wc -w "$WCTXTFL" | awk '{print $1}')
 5-	echo -e "$(gum style --foreground=#f4b8e4 --border none 'total word count'): $WCNUM"
 6+	echo "total word count: $WCNUM"
 7 	rm "$WCTXTFL"
 8 }
 9 
10@@ -35,7 +35,7 @@ choice() {
11 		*unwrap) unwraptxt ;;
12 		*wrap) wraptxt ;;
13 		*wordcount) wdcount ;;
14-		*) exit 0;;
15+		*) exit 1;;
16 	esac
17 }
18 
+0, -12
 1@@ -1,12 +0,0 @@
 2-#!/usr/bin/env bash
 3-#
 4-# this is just a chopped up `shmoji`
 5-
 6-unidir="$HOME/.config/unilist"
 7-unifile="$unidir/unilist.txt"
 8-
 9-uniprint() {
10-    printf "%s" "$1" | cut -d " " -f 1 | tr -d '\n'
11-}
12-
13-unipick=$(cat "$unifile" | dmenu -i -c -l 10) && uniprint "$unipick" | xclip -selection clipboard
+0, -12
 1@@ -1,12 +0,0 @@
 2-#!/usr/bin/env bash
 3-#
 4-# lazy ass way to update discord
 5-
 6-DL_FOLDER="/home/kat/Downloads/Installers"
 7-DISCORD_DL_URL="https://discord.com/api/download/stable?platform=linux&format=deb"
 8-DEB_FILE="new_discord_$(today time).deb"
 9-DEB_FOL="$DL_FOLDER/$DEB_FILE"
10-
11-wget -O "$DEB_FOL" "$DISCORD_DL_URL"
12-sudo dpkg -i "$DEB_FOL"
13-rm "$DEB_FOL"
+6, -5
 1@@ -1,9 +1,9 @@
 2 #!/usr/bin/env bash
 3-#
 4-# usage:
 5-#   - `echo "EXAMPLE" | upperd`
 6-#   - `upperd "EXAMPLE"`
 7-#   - `upperd -i`
 8+
 9+usage() {
10+	echo "usage: $(basename "$0") [TEXT]"
11+	echo "options: -i (input text) | -h (print usage & exit)"
12+}
13 
14 default() {
15 	tr '[:lower:]' '[:upper:]' | tr -d "\n" | tee >(xclip -selection clipboard) && echo -e "\n"
16@@ -20,5 +20,6 @@ stdinpaste() {
17 case "$1" in
18 	"") default ;;
19 	"-i") stdinpaste ;;
20+	"-h") usage ;;
21 	*) takearg "$@" ;;
22 esac
+1, -1
1@@ -12,7 +12,7 @@ weasel_wordfile="$weasel_worddir/weasel"
2 # basic functions
3 usage_help() {
4 	echo "usage: $(basename "$0") [OPTIONS]"
5-	echo "Options: -f | -h"
6+	echo "options: -f | -h"
7 }
8 
9 die() {
+1, -1
1@@ -2,7 +2,7 @@
2 	"schemaVersion": "0.1.0",
3 	"name": "Ghost Article",
4 	"behavior": "create",
5-	"noteContentFormat": "{{selectorHtml:.post-body|markdown}}",
6+	"noteContentFormat": "{{selectorHtml:article|markdown}}",
7 	"properties": [
8 		{
9 			"name": "url",