Commit 27840b5

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