From 29a3d5b7fe37eae1af378195d18e07ed85165be3 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Sun, 8 Jun 2025 22:51:11 -0500 Subject: [PATCH] 2025-06-08 | TUI Challange, Day 1 --- config.toml | 5 +- ...> sunday-afternoon-photo-expirements.html} | 0 content/post/2022/12/check-in-2022-q4.md | 3 +- content/post/2025/06/tui-challenge:-day-1.md | 127 ++++++++++++++++++ 4 files changed, 132 insertions(+), 3 deletions(-) rename content/post/2017/10/{sunday-afternoon-photo-expirements.md => sunday-afternoon-photo-expirements.html} (100%) create mode 100644 content/post/2025/06/tui-challenge:-day-1.md diff --git a/config.toml b/config.toml index ea56381f..7bac503b 100644 --- a/config.toml +++ b/config.toml @@ -6,11 +6,14 @@ theme = "minimage" disqusShortname = "" # Enable Google Analytics by entering your tracking code googleAnalytics = "" -paginate = 5 Copyright = "All rights reserved - 2006-" preserveTaxonomyNames = true +renderer.unsafe = true #canonifyurls = true + +[pagination] + pagerSize = 5 [taxonomies] category = "categories" tag = "tags" diff --git a/content/post/2017/10/sunday-afternoon-photo-expirements.md b/content/post/2017/10/sunday-afternoon-photo-expirements.html similarity index 100% rename from content/post/2017/10/sunday-afternoon-photo-expirements.md rename to content/post/2017/10/sunday-afternoon-photo-expirements.html diff --git a/content/post/2022/12/check-in-2022-q4.md b/content/post/2022/12/check-in-2022-q4.md index adfad965..0ab20e6d 100644 --- a/content/post/2022/12/check-in-2022-q4.md +++ b/content/post/2022/12/check-in-2022-q4.md @@ -15,8 +15,7 @@ Focus_Keyword: "close" # Technology -Since all the changes on [Twitter](https://twitter.com/duckunix), I am now active on [Fosstodon](https://fosstodom/@duckunix), which is a [Mastodon](https://joinmastodon.org/). I joined back in 2018, but I just started using it more. My #introduction toot: -{{}} +Since all the changes on [Twitter](https://twitter.com/duckunix), I am now active on [Fosstodon](https://fosstodom/@duckunix), which is a [Mastodon](https://joinmastodon.org/). I joined back in 2018, but I just started using it more. On the home network front, I finally retired the big server as the drivers were failing. I decided to move the containers running there to my old desktop which was not doing anything. Some new disks, and life is better there. diff --git a/content/post/2025/06/tui-challenge:-day-1.md b/content/post/2025/06/tui-challenge:-day-1.md new file mode 100644 index 00000000..fee0c2ab --- /dev/null +++ b/content/post/2025/06/tui-challenge:-day-1.md @@ -0,0 +1,127 @@ +--- +date: "2025-06-08T04:00:00-07:00" +title: "TUI Challenge: Day 1" +tags: ["cli"] +categories: ["personal,sa"] +#image: "" +#series: [""] +summary: "" +--- + +*tap, tap* Is this thing on? When was the last time I published anything? Oh, back on [January 15, 2024](/post/2024/01/check-in-2024-01). Oops. + +Well, I had to clean up a few things to get this back working with updates to [hugo](https://gohugo.io), the static blogging engine I use for the site. + +So, what prompted me to fire this up again, and actually make it work (unlike the last few times I was going to start this)? +Well, I listen to a bunch of podcasts from [Jupiter Broadcasting](https://jupiterbroadcasting.com), +including one called [Linux Unplugged](https://linuxunplugged.com), and they are running a [7 day TUI Challenge](https://github.com/JupiterBroadcasting/linux-unplugged/blob/main/challenges/TUI-Challenge.md). +Now, since I normally read my email and RSS feeds in a TUI app, and I use VIM as my editor and IDE, I figured it would be fairly easy for me to take part. + +The two big things I use a GUI for are [web browsing with qutebrowser](https://www.qutebrowser.org) and watch youtube vids with MPV, I should be able to adapt. + +Anyway, Day 1 challenge is to write document using a TUI editor of at least 200 words. There are bonus points for using scripts to help things out, and I guess the script I use to start editing a file should work: + +``` +#!/usr/bin/env bash +#=============================================================================== +# +# FILE: dopost +# +# USAGE: ./dopost +# +# DESCRIPTION: make a new post for hugo +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Don Harper (), duck@duckland.org +# ORGANIZATION: +# CREATED: 02/02/2019 08:35:34 PM CDT +# REVISION: Based off of genpost.sh +#=============================================================================== + +set -o nounset # Treat unset variables as an error +trap onexit 1 2 3 15 ERR EXIT +#--- onexit() ----------------------------------------------------- +# @param $1 integer (optional) Exit status. If not set, use `$?' + +function onexit() { + local exit_status=${1:-$?} + if [ "${exit_status}" == 0 ] + then + exit + fi + notify-send "Exiting ${myname} with $exit_status" + cd + exit "${exit_status}" +} + +myname="$(basename ${0} .sh)" +Title="untitled" +Category="none" +TAGS="tagless" + +while getopts "t:T:c:h" OPTIONS +do + case ${OPTIONS} in + t) Title="$OPTARG" ;; + c) Category="$OPTARG" ;; + T) TAGS="$OPTARG" ;; + *) + echo "$0 -t '' -c '<category>' [-T '<tags[,tags2]>']" + exit 1 + ;; + esac +done +shift + +if [ "${Title}" == "untitled" ] +then + echo "Missing title" + echo "$0 -t '<title>' -c '<category>' [-T '<tags[ tags2]>']" + exit 1 +fi +if [ "${Category}" == "none" ] +then + echo "Missing category" + echo "$0 -t '<title>' -c '<category>' [-T '<tags[ tags2]>']" + exit 1 +fi +if $(echo "${TAGS}" | grep -q ' ') +then + TAGS=$(echo "${TAGS}" | sed 's/ /", "/g') +fi + +BASE="${HOME}/src/WWW/sites/duckland.org" +DATE=$(date +%F) +YEAR=$(echo $DATE | awk -F- '{print $1}') +MON=$(echo $DATE | awk -F- '{print $2}') +Name=$(echo ${Title} | sed -e 's/^ //' -e 's/,//' -e 's/ ://' -e 's/ /-/g' -e 's/\?//' -e 's/\!//' | tr '[A-Z]' '[a-z]' ) +cd ${BASE} +git co draft +printf "title - %s\nname - %s\n" "$Title" "$Name" +OUTPUTDIR="${BASE}/content/post/${YEAR}/${MON}/" +mkdir -p ${OUTPUTDIR} +OUTPUT="${OUTPUTDIR}/${Name}.md" +echo "---" > ${OUTPUT} +echo "date: \"${DATE}T04:00:00-07:00\"" >> ${OUTPUT} +echo "title: \"${Title}\"" >> ${OUTPUT} +echo "tags: [\"${TAGS}\"]" >> ${OUTPUT} +echo "categories: [\"${Category}\"]" >> ${OUTPUT} +echo "#image: \"\"" >> ${OUTPUT} +echo "#series: [\"\"]" >> ${OUTPUT} +echo "summary: \"\"" >> ${OUTPUT} +echo "Victor_Hugo: \"true\"" >> ${OUTPUT} +echo "Focus_Keyword: \"\"" >> ${OUTPUT} +echo "---" >> ${OUTPUT} +echo "" >> ${OUTPUT} +#cd ~/src/www.duckland.org +#tmux neww -n "New Post" -t 30 "cd ~/src/www.duckland.org ; hugo serve -D -F" +#tmux split-window -h "${EDITOR} ${OUTPUT}" +#tmux select-layout main-vertical + +#. ~/.myapps +#$TERMPROG -e tmuxp load duckland +tmuxinator start duckland +```