dots


commit
27840b5
parent
ab480b4
author
xxwhirlpool
date
2025-10-22 18:48:02 -0400 EDT
today, md2html, bashrc-pc
3 files changed,  +78, -3
M config/.bashrc-pc
+7, -3
 1@@ -129,7 +129,8 @@ alias neofetch="hyfetch"
 2 alias fastfetch="hyfetch"
 3 alias bat="batcat"
 4 alias cat="bat --paging=never"
 5-alias iconsubfolalias iconsubfol="find . -mindepth 2 -type f -print -exec mv {} . \;"
 6+alias iconsubfol="find . -mindepth 2 -type f -print -exec mv {} . \;"
 7+alias rced="micro ~/.bashrc && source ~/.bashrc"
 8 
 9 # lazy ass way for me to get my idol mp3s from youtube
10 # usage: ytmp3 url
11@@ -159,7 +160,8 @@ alias gmine="cd /home/kat/Documents/Git/-mine"
12 alias fujo="kitty +kitten ssh fujo"
13 alias fujohost="kitty +kitten ssh fujohost"
14 alias fujobuild="kitty +kitten ssh fujobuild"
15-alias steff="kitty +kitten ssh steff"
16+alias goldstar="kitty +kitten ssh goldstar"
17+alias ncc="kitty +kitten ssh ncc1701"
18 
19 ######################################
20 # variables
21@@ -189,6 +191,8 @@ export NVM_DIR="$HOME/.config/nvm"
22 
23 . "$HOME/.cargo/env"
24 
25+. "/home/kat/.deno/env"
26+
27 ######################################
28 # functions
29 ######################################
30@@ -243,7 +247,7 @@ playart() {
31 # after long commands
32 notif() {
33 	notify-send "done!"
34-	aplay -q /usr/share/sounds/sound-icons/start
35+	paplay /usr/share/sounds/sound-icons/start
36 	spd-say -t female3 -r +25 "done!"
37 }
38 
A config/.local/bin/md2html
+54, -0
 1@@ -0,0 +1,54 @@
 2+#!/usr/bin/env bash
 3+#
 4+# convert markdown to HTML
 5+# can read from STDIN or file
 6+#
 7+# this is a *very* opinionated script, using:
 8+# gum, bat, perl, and xclip
 9+# pandoc is mandatory!!!
10+# edit to suit your system
11+
12+# functions
13+read() {
14+	# declare some vars
15+	MDFILE="/tmp/$(today time && openssl rand -hex 5).md"
16+	HTMLFILE="${MDFILE%.*}.html"
17+	HTMLFILE_FINAL="${HTMLFILE%.*}_final.html"
18+	# prompt user to paste markdown formatted text, then write it to a temp file
19+	gum write > "$MDFILE"
20+	# the conversion!
21+	pandoc --no-highlight --wrap=none "$MDFILE" -o "$HTMLFILE"
22+	# swap unicode/HTML entities to their actual characters
23+	perl -C -MHTML::Entities -pe 'decode_entities($_);' < "$HTMLFILE" > "$HTMLFILE_FINAL"
24+	# show final file
25+	batcat --paging=never "$HTMLFILE_FINAL"
26+	# copy file to clipboard too
27+	xclip -sel clip "$HTMLFILE_FINAL"
28+}
29+
30+fromfile() {
31+	# declare some vars
32+	MDFILE=$(gum filter)
33+	HTMLFILE="${MDFILE%.*}.html"
34+	HTMLFILE_FINAL="${HTMLFILE%.*}_final.html"
35+	# the conversion!
36+	pandoc --no-highlight --wrap=none "$MDFILE" -o "$HTMLFILE"
37+	# swap unicode/HTML entities to their actual characters
38+	perl -C -MHTML::Entities -pe 'decode_entities($_);' < "$HTMLFILE" > "$HTMLFILE_FINAL"
39+	# show final file
40+	batcat --paging=never "$HTMLFILE_FINAL"
41+	# copy file to clipboard too
42+	xclip -sel clip "$HTMLFILE_FINAL"
43+}
44+
45+# execute it
46+choice() {
47+	choose=$(gum choose "paste" "file")
48+	case "$choose" in
49+		*paste) read ;;
50+		*file) fromfile ;;
51+		*) exit ;;
52+	esac
53+}
54+
55+choice
A config/.local/bin/today
+17, -0
 1@@ -0,0 +1,17 @@
 2+#!/usr/bin/env bash
 3+#
 4+# current date in ISO format
 5+
 6+# if you also want time then supply `time` arg:
 7+# today time
 8+today() {
 9+	if [ $# -eq 0 ]; then
10+		echo -e "$(date '+%Y-%m-%d')"
11+	fi
12+
13+	if [ "$1" == "time" ]; then
14+		echo -e "$(date '+%Y-%m-%d_%I:%M%p')"
15+	fi
16+}
17+
18+today