This commit is contained in:
ryfrd 2025-08-14 15:16:21 +01:00
parent c4dcb6e38b
commit 531029a18f
129 changed files with 7765 additions and 6938 deletions

View file

@ -1,27 +1,132 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Categories on James&#39; Blog :-)</title>
<link>https://nonsense.dymc.win/categories/</link>
<description>Recent content in Categories on James&#39; Blog :-)</description>
<title>Categories on James&#39; Blog</title>
<link>http://localhost:1313/categories/</link>
<description>Recent content in Categories on James&#39; Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-GB</language>
<atom:link href="https://nonsense.dymc.win/categories/index.xml" rel="self" type="application/rss+xml" />
<atom:link href="http://localhost:1313/categories/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>over-engineered (?) nixos blog deployment setup</title>
<link>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</link>
<title>Handy script for a more zen twitch experience</title>
<link>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</link>
<pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate>
<guid>http://localhost:1313/handy-script-for-a-more-zen-twitch-experience/</guid>
<description>&lt;p&gt;I like to watch twitch streams.
Watching them in the browser at &lt;code&gt;twitch.tv&lt;/code&gt; is generally not an experience which sparks joy though.
I&amp;rsquo;m buffering.
I&amp;rsquo;m declining cookies.
I&amp;rsquo;m getting spammed with notifications to claim a sick new overwatch skin.
There&amp;rsquo;s a little channel point button twerking for me to click it.
You get the idea; it&amp;rsquo;s a heavy noisy experience.&lt;/p&gt;
&lt;p&gt;As a result I set out to devise a solution which does spark joy.
I came up with a script which leans on DIY desktop staples (dunst, tofi, mpv) and the very nice cli utility &lt;a href=&#34;https://github.com/streamlink/streamlink&#34;&gt;streamlink&lt;/a&gt;.
Here it is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;PLAYER&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;mpv&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;LAUNCHER&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;tofi&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;dunstify&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# you need an api key, get them here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# https://dev.twitch.tv/docs/api/get-started/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;CLIENT_ID&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;id-here&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;CLIENT_SECRET&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;secret-here-please-sssshh&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# list of streams to check&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;STREAMS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;limmy&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;fl0m&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;northernlion&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;caedrel&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# reassure user that something is happening&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- checking who&amp;#39;s live beep boop be patient&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# get auth token from twitch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;ACCESS_TOKEN&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;curl -s -X POST &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://id.twitch.tv/oauth2/token&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;client_id=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$CLIENT_ID&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;client_secret=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$CLIENT_SECRET&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;grant_type=client_credentials&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq -r &lt;span class=&#34;s1&#34;&gt;&amp;#39;.access_token&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# define empty list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;LIVE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# loop through streams, check if live and append info to list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; STREAM in &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;STREAMS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[@]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;RESPONSE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;curl -s -H &lt;span class=&#34;s2&#34;&gt;&amp;#34;Client-ID: &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$CLIENT_ID&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -H &lt;span class=&#34;s2&#34;&gt;&amp;#34;Authorization: Bearer &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$ACCESS_TOKEN&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://api.twitch.tv/helix/streams?user_login=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$STREAM&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;LIVE_STATUS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq &lt;span class=&#34;s1&#34;&gt;&amp;#39;.data | length&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$LIVE_STATUS&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; -gt &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;TITLE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq -r &lt;span class=&#34;s1&#34;&gt;&amp;#39;.data[0].title&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;GAME&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq -r &lt;span class=&#34;s1&#34;&gt;&amp;#39;.data[0].game_name&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;LIVE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+=(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$STREAM&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; | &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$GAME&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; | &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$TITLE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# pipe list items into tofi with new lines at the end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;choice&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;printf&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;%s\n&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;LIVE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[@]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;LAUNCHER&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; -n &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;c1&#34;&gt;# get first column from selection aka stream name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nv&#34;&gt;meat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$choice&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;NOTIFY&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;twitch -- launching twitch.tv/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; streamlink twitch.tv/&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$meat&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; 1080p60 --player &lt;span class=&#34;s2&#34;&gt;$&amp;#34;{PLAYER}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;what-it-does&#34;&gt;What it does:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;talk to twitch api to get auth token&lt;/li&gt;
&lt;li&gt;loop trough list of streams to check if they&amp;rsquo;re live (using auth token)&lt;/li&gt;
&lt;li&gt;grab some info about streams that are live and append it to a list&lt;/li&gt;
&lt;li&gt;pipe said list into tofi&lt;/li&gt;
&lt;li&gt;capture user&amp;rsquo;s choice&lt;/li&gt;
&lt;li&gt;open choice in mpv using streamlink&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;dependencies&#34;&gt;Dependencies&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;curl&lt;/li&gt;
&lt;li&gt;jq&lt;/li&gt;
&lt;li&gt;tofi (would work with other launchers dmenu etc.)&lt;/li&gt;
&lt;li&gt;mpv (would work with other media players vlc etc.)&lt;/li&gt;
&lt;li&gt;dunst (would work with other notification daemons mako etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;positive-&#34;&gt;Positive :)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;no chat (you don&amp;rsquo;t have to read the degenerates spamming LUL)&lt;/li&gt;
&lt;li&gt;you can customise the script to use your favourite desktop tools&lt;/li&gt;
&lt;li&gt;can rewind!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;negative-&#34;&gt;Negative :(&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;no chat (you might want to spam LUL)&lt;/li&gt;
&lt;li&gt;takes a second to talk to the internet so things don&amp;rsquo;t launch immediately&lt;/li&gt;
&lt;li&gt;have to faff with getting api key - &lt;a href=&#34;https://dev.twitch.tv/docs/api/get-started/&#34;&gt;how to get one btw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
<item>
<title>Over-engineered (?) nixos blog deployment setup</title>
<link>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</link>
<pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/over-engineered-nixos-blog-deployment-setup/</guid>
<guid>http://localhost:1313/over-engineered-nixos-blog-deployment-setup/</guid>
<description>&lt;p&gt;As is traditional with people hosting their own blog I&amp;rsquo;m going to do a post detailing EXACTLY how I&amp;rsquo;m hosting my blog.
Down to the last dirty detail.
I have nothing better to talk about.
Here is a diagram I edited to illustrate (credit to xkcd I think?).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/self-hosting.png&#34; alt=&#34;self-hosting&#34;&gt;&lt;/p&gt;
&lt;p&gt;I host my site on a hetzner vps running nixos.
I also have a git repo where all the static files for my blog live.
I had previously been manually rsyncing the website up to my vps from my laptop.
@ -106,11 +211,11 @@ That&amp;rsquo;s the directory of the git repo that the website source lives.&lt
<item>
<title>so you want to write a neovim plugin with lua</title>
<link>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<title>So you want to write a neovim plugin with lua</title>
<link>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</link>
<pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<guid>http://localhost:1313/so-you-want-to-write-a-neovim-plugin-with-lua/</guid>
<description>&lt;p&gt;I&amp;rsquo;ve recently been messing around with writing neovim plugins.
When I initially got going I found it a little tricky to know how to get started.
There&amp;rsquo;s the &lt;a href=&#34;https://neovim.io/doc&#34;&gt;official neovim docs&lt;/a&gt; which are great; but in my beginner experience exhaustive to the point of slight impenetrability.
@ -183,11 +288,11 @@ As a little coda, this is how you can use your fancy new plugin using &lt;a href
<item>
<title>making nix-colors talk to neovim</title>
<link>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</link>
<title>Making nix-colors talk to neovim</title>
<link>http://localhost:1313/making-nix-colors-talk-to-neovim/</link>
<pubDate>Fri, 18 Aug 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/making-nix-colors-talk-to-neovim/</guid>
<guid>http://localhost:1313/making-nix-colors-talk-to-neovim/</guid>
<description>&lt;p&gt;I recently started fiddling around with home-managerifying my neovim config.
After moving across most of my stuff I came across the problem of how to hook things up with with &lt;a href=&#34;https://github.com/misterio77/nix-colors&#34;&gt;nix-colors&lt;/a&gt; so that my neovim theme would follow color changes in home-manager.&lt;/p&gt;
&lt;p&gt;Luckily, I came across &lt;a href=&#34;https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-base16.md&#34;&gt;this&lt;/a&gt; handy little plugin from the lovely &lt;a href=&#34;https://github.com/echasnovski/mini.nvim&#34;&gt;mini.nvim&lt;/a&gt; suite of plugins which lets you create your own theme with your custom colors.&lt;/p&gt;
@ -237,11 +342,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>vanilla javascript theme toggle for simpletons</title>
<link>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</link>
<title>Vanilla javascript theme toggle for simpletons</title>
<link>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</link>
<pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<guid>http://localhost:1313/vanilla-javascript-theme-toggle-for-simpletons/</guid>
<description>&lt;p&gt;Sometimes when I&amp;rsquo;m trawling the internet and happen upon a particularly nice looking website, I develop css and javascript FOMO. The thing I&amp;rsquo;ve been lusting after above all else is one of those fancy little dark theme toggle buttons. As you can probably tell from the website you&amp;rsquo;re looking at my web dev skills are limited. As a result of this I had assumed such niceties were out of reach.&lt;/p&gt;
&lt;p&gt;Last week though I decided it was time for this to change! I would do a teeny bit of javascript. I could have nice things. This is a rundown of the very simple implementation I came up with.&lt;/p&gt;
&lt;h3 id=&#34;html&#34;&gt;HTML&lt;/h3&gt;
@ -324,11 +429,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>tailscale, caddy, and nixos containers - a match made in heaven</title>
<link>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers-a-match-made-in-heaven/</link>
<title>Tailscale, caddy, and nixos containers</title>
<link>http://localhost:1313/tailscale-caddy-and-nixos-containers/</link>
<pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/tailscale-caddy-and-nixos-containers-a-match-made-in-heaven/</guid>
<guid>http://localhost:1313/tailscale-caddy-and-nixos-containers/</guid>
<description>&lt;p&gt;For a little while now I&amp;rsquo;ve been running some services (jellyfin etc.) on an old laptop in my house. I&amp;rsquo;m not trying to sound like a podcast ad but as a networking novice, the simplicity &lt;a href=&#34;https://tailscale.com/&#34;&gt;tailscale&lt;/a&gt; brings to accessing these services remotely is very nice. Until recently though, I had been accessing my services like a heathen with http and port numbers (eg http://tailscale-ip:service-port). This works and is perfectly secure thanks to tailscale though it lacks a certain finesse. In an ideal world you&amp;rsquo;d have a reverse proxy and set up SSL certs so your browser doesn&amp;rsquo;t get stressed and you dont have to rememeber ip addresses and port numbers.&lt;/p&gt;
&lt;p&gt;When I initially looked at how to do this it seemed like it was above my paygrade and not worth the stress; that was until I came across &lt;a href=&#34;https://caddy.community/t/https-in-your-vpn-caddy-now-uses-tls-certificates-from-tailscale/15380&#34;&gt;this&lt;/a&gt;. This works great and is as simple as advertised though there is one drawback: you can only reverse proxy one service per host. So for my usecase of the laptop with multiple services running on it I could only use the magic caddy tailscale auto-https thing for one of them.&lt;/p&gt;
&lt;h3 id=&#34;what-to-do&#34;&gt;what to do?&lt;/h3&gt;
@ -393,11 +498,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>learning about qtile widgets via the medium of cricket</title>
<link>https://nonsense.dymc.win/learning-about-qtile-widgets-via-the-medium-of-cricket/</link>
<title>Learning about qtile widgets with cricket</title>
<link>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</link>
<pubDate>Mon, 03 Apr 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/learning-about-qtile-widgets-via-the-medium-of-cricket/</guid>
<guid>http://localhost:1313/learning-about-qtile-widgets-with-cricket/</guid>
<description>&lt;p&gt;I&amp;rsquo;m a person who has spent an unreasonable amount of time making minute changes to the appearance of my bar in qtile. Despite the very nice selection of widgets availabe by default with qtile, it was only a matter of time before I decided I wanted to experiment with making my own custom widget. Fortunately, if you can do a bit of python this is quite an approachable undertaking.&lt;/p&gt;
&lt;p&gt;The dream widget I was lacking was a little live crikcet score ticker type thing; something which would scroll along on my bar showing me the score in live cricket matches. I&amp;rsquo;m sure this will interest very few people but I learnt some good stuff along the way.&lt;/p&gt;
&lt;h3 id=&#34;hello-world&#34;&gt;Hello World?!&lt;/h3&gt;
@ -505,11 +610,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>theming nirvana</title>
<link>https://nonsense.dymc.win/theming-nirvana/</link>
<title>Achieve peak rice with nix-colors</title>
<link>http://localhost:1313/achieve-peak-rice-with-nix-colors/</link>
<pubDate>Mon, 13 Mar 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/theming-nirvana/</guid>
<guid>http://localhost:1313/achieve-peak-rice-with-nix-colors/</guid>
<description>&lt;p&gt;As I fall deeper and deeper down the nixos rabbit hole, I find myself becoming more and more obsessed with controlling every little thing on my computers declaratively. It starts with: &amp;lsquo;oh this is cool I can specify which desktop environment to use in my configuration.nix&amp;rsquo;. Next thing you know you&amp;rsquo;ve discovered &lt;a href=&#34;https://github.com/nix-community/home-manager&#34;&gt;home-manager&lt;/a&gt; and every program on every linux system you use needs to be controlled in your nix-config. Of course this slightly insane approach has its downsides; it also opens some doors though.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://sr.ht/~misterio/nix-colors/&#34;&gt;Nix-colors&lt;/a&gt; lets you dyanmically change the theming of programs controlled in your nix config. So when you want to change the color of everything and have it match and all be pretty lol, you are able to do so with one word as opposed to poring over everything changing each individual color. For a certain type of person, this is very nice!&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-it-work&#34;&gt;how to make it work&lt;/h3&gt;
@ -604,11 +709,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>translating docker to nix?!</title>
<link>https://nonsense.dymc.win/translating-docker-to-nix/</link>
<title>Translating docker to nix?!</title>
<link>http://localhost:1313/translating-docker-to-nix/</link>
<pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/translating-docker-to-nix/</guid>
<guid>http://localhost:1313/translating-docker-to-nix/</guid>
<description>&lt;p&gt;In my opinion, there are moments when the convenience of docker and its surrounding ecosystem can&amp;rsquo;t be beat. I&amp;rsquo;ve been dabbling in the self hosting world and oftentimes the best maintained packaging option is a docker image. As a result of this I&amp;rsquo;ve been playing around with the nixos approach to managing docker containers.&lt;/p&gt;
&lt;h3 id=&#34;nix---docker-compose---docker-run&#34;&gt;nix -&amp;gt; docker compose -&amp;gt; docker run&lt;/h3&gt;
&lt;p&gt;To illustrate how to translate a simple example from the world of docker to nix let&amp;rsquo;s have a look at the config for my &lt;a href=&#34;https://docs.searxng.org/&#34;&gt;searxng&lt;/a&gt; instance.&lt;/p&gt;
@ -658,11 +763,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>simple nixos config for vps static site</title>
<link>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</link>
<title>Simple nixos config for vps static site</title>
<link>http://localhost:1313/simple-nixos-config-for-vps-static-site/</link>
<pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/simple-nixos-config-for-vps-static-site/</guid>
<guid>http://localhost:1313/simple-nixos-config-for-vps-static-site/</guid>
<description>&lt;p&gt;Setting up a little static site is something I&amp;rsquo;ve done a few different times on a few different operating systems. It&amp;rsquo;s a slightly fiddly task with a few disparate jobs that all need looking after: ssh, let&amp;rsquo;s encrypt, nginx. In my opinion, it is one of the moments where consolidating all the little bits and bobs you need to setup into one common configuration is very useful.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to go through a bit of the nixos config I&amp;rsquo;ve got for my vps.&lt;/p&gt;
&lt;h3 id=&#34;ssh&#34;&gt;SSH&lt;/h3&gt;
@ -718,12 +823,12 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>podcast setup for broke boys whose trash phone cant hack modern apps</title>
<link>https://nonsense.dymc.win/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps/</link>
<title>Python podcast scripting</title>
<link>http://localhost:1313/python-podcast-scripting/</link>
<pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems to struggle with anything but the most lightweight apps. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
<guid>http://localhost:1313/python-podcast-scripting/</guid>
<description>&lt;p&gt;I have an old sad android phone with 2GB of ram which nowadays seems struggles these days. As a result of this I have been &amp;lsquo;podcast-player-hopping&amp;rsquo; without success for the last couple of months trying to find something which doesn&amp;rsquo;t nuke my phone whenever I use it. In a moment of desperation it occured to me that a creative solution might be required. The gameplan was this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write python script to download podcasts&lt;/li&gt;
&lt;li&gt;set up cron job on my server to run script every couple of hours&lt;/li&gt;
@ -810,11 +915,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>elite bread dough for lazy boys</title>
<link>https://nonsense.dymc.win/elite-bread-dough-for-lazy-boys/</link>
<title>Bread dough for lazy boys</title>
<link>http://localhost:1313/bread-dough-for-lazy-boys/</link>
<pubDate>Sun, 22 Jan 2023 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/elite-bread-dough-for-lazy-boys/</guid>
<guid>http://localhost:1313/bread-dough-for-lazy-boys/</guid>
<description>&lt;h3 id=&#34;ingredienti&#34;&gt;INGREDIENTI&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;flour (ideally bread flour but if you don&amp;rsquo;t have it, it&amp;rsquo;s not the end of the world)&lt;/li&gt;
@ -856,11 +961,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>multi user qtile fiddling</title>
<link>https://nonsense.dymc.win/multi-user-qtile-fiddling/</link>
<title>Multi user qtile fiddling</title>
<link>http://localhost:1313/multi-user-qtile-fiddling/</link>
<pubDate>Tue, 20 Dec 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/multi-user-qtile-fiddling/</guid>
<guid>http://localhost:1313/multi-user-qtile-fiddling/</guid>
<description>&lt;p&gt;This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using &lt;code&gt;xdg.configFile&lt;/code&gt;. This is what I do with my qtile &lt;code&gt;config.py&lt;/code&gt;. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.&lt;/p&gt;
&lt;h3 id=&#34;the-nub-of-the-problem&#34;&gt;THE NUB OF THE PROBLEM&lt;/h3&gt;
&lt;p&gt;I basically just want the config to work out which computer it&amp;rsquo;&amp;rsquo;s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:&lt;/p&gt;
@ -936,11 +1041,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>teeny tiny bash fetch script</title>
<link>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</link>
<title>Teeny tiny bash fetch script</title>
<link>http://localhost:1313/teeny-tiny-bash-fetch-script/</link>
<pubDate>Sat, 10 Dec 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/teeny-tiny-bash-fetch-script/</guid>
<guid>http://localhost:1313/teeny-tiny-bash-fetch-script/</guid>
<description>&lt;p&gt;This is my attempt at a neofetch, pfetch, whateverfetch style system info utility. My main concern was making something which looked nice, was easily configurable, and as portable as possible (I didn&amp;rsquo;t really try that hard with the portability). I didn&amp;rsquo;t think much about performance; I&amp;rsquo;m personally not a man who stresses too much when a command takes a quarter of a second instead of a tenth. The basic gameplan was to get an array of bash commands which would fetch various bits and bobs, then loop through this array formatting the text with ANSI escape codes. First things first, this was the associative array I came up with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -A &lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;user&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$USER&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
@ -1009,18 +1114,18 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;random_color&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; \e[0;1;3m&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\e[0m&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;sep&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This had the happy unintended consequence of allowing you to very easily configure which items you wanted in the fetch by simply commenting out keys from the order array. You can check out the script in its entirety &lt;a href=&#34;https://gitlab.com/robbygozzarder/golazo&#34;&gt;here&lt;/a&gt;. This is a pretty picture of a few variations.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/golazo.png&#34; alt=&#34;golazo&#34;&gt;&lt;/p&gt;
</description>
</item>
<item>
<title>get the thoughts out of your head and into a digital format with this python journal script</title>
<link>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script/</link>
<title>Get the thoughts out of your head and into a digital format with this python journalling script</title>
<link>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</link>
<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script/</guid>
<guid>http://localhost:1313/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journalling-script/</guid>
<description>&lt;p&gt;Since getting going with emacs I&amp;rsquo;ve gone down the org-mode rabbit hole a little bit. In particular the very nice &lt;a href=&#34;https://github.com/bastibe/org-journal&#34;&gt;org-journal&lt;/a&gt; package. It basically does what it says on the tin: maintains a journal with a selection of org files. This has been very nice for me. I have often thought about journalling but never really got up a head of steam. Somehow having an entry a keybinding away while I&amp;rsquo;m doing something with my text editor makes it a lot more palletable.&lt;/p&gt;
&lt;p&gt;Having said all this, I am not completely converted to the church of emacs. Thus, I thoght it would be nice to write a little editor agnostic script which would emulate some of org-journal&amp;rsquo;s features but allow you to use whatever editor you like with markdown.&lt;/p&gt;
&lt;h3 id=&#34;whats-the-time&#34;&gt;WHAT&amp;rsquo;S THE TIME?&lt;/h3&gt;
@ -1080,11 +1185,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>lowkey emacs setup</title>
<link>https://nonsense.dymc.win/lowkey-emacs-setup/</link>
<title>Lowkey emacs setup bits and bobs</title>
<link>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</link>
<pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/lowkey-emacs-setup/</guid>
<guid>http://localhost:1313/lowkey-emacs-setup-bits-and-bobs/</guid>
<description>&lt;p&gt;About a month ago I was a little bored and thought I&amp;rsquo;d give emacs a go. There&amp;rsquo;s something fun about trying out these mythical pieces of software that have been around forever; kind of like watching The Godfather for the first time. Like many extensible, super configurable programs, emacs seems kind of impenetrable at first glance. I tried doing the tutorial but kind of glazed over after a while with the endless stream of C-a C-b C-c. There&amp;rsquo;s also the quite jarring default theme which wasn&amp;rsquo;t vibing with the lovely screenshots I had seen on the internet. Anyway, after quite a bit of fiddling I&amp;rsquo;ve landed on a simple little setup that I&amp;rsquo;ve been quite enjoying. Here are a few little pointers to hopefully ease you in.&lt;/p&gt;
&lt;h3 id=&#34;aesthetic-niceties&#34;&gt;AESTHETIC NICETIES&lt;/h3&gt;
&lt;p&gt;First things first, assuming you&amp;rsquo;re on linux emacs is configured with a file at &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. As a terrible aesthete, the first thing I was worried about was changing the theme. This can be achieved with &lt;code&gt;M-x load-theme&lt;/code&gt;; if you want the setting to persist though you can add this to you init.el:&lt;/p&gt;
@ -1157,104 +1262,18 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;use-package&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;ss&#34;&gt;:bind&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;M-c&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;smart-comment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a little pic of the current setup :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/emacs.png&#34; alt=&#34;emacs&#34;&gt;&lt;/p&gt;
</description>
</item>
<item>
<title>setting up a lean mean hugo blogging theme</title>
<link>https://nonsense.dymc.win/setting-up-a-lean-mean-hugo-blogging-theme/</link>
<pubDate>Thu, 10 Nov 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/setting-up-a-lean-mean-hugo-blogging-theme/</guid>
<description>&lt;p&gt;When I first started messing around with hugo, I found the whole thing slihtly mystifying. I downloaded a theme like they asked me, edited the config file to try and customise things a little and quickly broke everything. To be fair, this was mainly due to my tinkering instinct to fly to close to the sun. But anyway, the point at which I started to really appreciate the power of hugo was when I tried to make my own - admittedly less feautureful - theme. This selection of tips and tricks will assume that you&amp;rsquo;ve just run something like &lt;code&gt;hugo new site lovely-new-website&lt;/code&gt;, entered the new directory with &lt;code&gt;cd lovely-new-website&lt;/code&gt; and you&amp;rsquo;ve got a selection of mostly empty directories looking something like this.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── archetypes
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;│   └── default.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── config.toml
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── content
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── data
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── layouts
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── public
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;├── static
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;└── themes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Our first concern will be getting a barebones theme template that can be customised to our liking. I would recommend &lt;a href=&#34;https://github.com/ericmurphyxyz/hugo-starter-theme&#34;&gt;this&lt;/a&gt; guy which I used to get up and running. You could also check out &lt;a href=&#34;https://gitlab.com/robbygozzarder/mcl&#34;&gt;my theme&lt;/a&gt; which I&amp;rsquo;m using on this site that is also very simple (as you can probably see from the website lol). Once you&amp;rsquo;ve got a theme with (I&amp;rsquo;m using mine as an example) &lt;code&gt;git clone https://gitlab.com/robbygozzarder/mcl&lt;/code&gt; and placed it in the themes directory you&amp;rsquo;ll need to adjust your config.toml file to point it to this theme.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;theme&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;mcl&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The directory structure of your new theme will look something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;└── mcl
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ├── archetypes
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   └── default.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ├── layouts
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   ├── 404.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   ├── _default
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   │   ├── list.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   │   └── single.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   ├── index.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   └── partials
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   ├── footer.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   ├── header.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; │   └── nav.html
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ├── README.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; └── static
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; └── css
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; └── style.css
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is where most of the magic happens:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The default.md file in the archetypes directory dictates what template to follow when adding new post files.&lt;/li&gt;
&lt;li&gt;The layouts directory is where most of the meat is:
&lt;ul&gt;
&lt;li&gt;Firstly, there&amp;rsquo;s the partials directory which contains outlines for sections which you want to be used multiple times across the site such as a footer (footer.html)&lt;/li&gt;
&lt;li&gt;Sceondly, we have _default which contains outlines for the two types of hugo pages; singles (single.html) such as this individual post page, and lists (list.html) such as the tags and posts pages on this site.&lt;/li&gt;
&lt;li&gt;Partials also contains index.html which (you guessed it!) is your home page.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Last but not least, there&amp;rsquo;s static which as you can see just has the css for the site (this is all looks though - the action happens in partials).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now the theme is sorted the next three things you need to know anything about (imho) are the content, public, and static directories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Content is where you put your posts - these are just markdown files which hugo converts to html for you.&lt;/li&gt;
&lt;li&gt;Public is where hugo puts your built - ready to be served - site. You can then copy this directory to wherever your webserver is looking eg. /var/www/jdysmcl&lt;/li&gt;
&lt;li&gt;Static is where assets which you want to use with your site are kept. I basically just use it for images which I can then reference from my posts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now we&amp;rsquo;ve got the directory what&amp;rsquo;s happening where admin out the way let&amp;rsquo;s have a look at what some of the html files in the themes directory look like; this is the index.html for my site for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{ partial &amp;#34;header.html&amp;#34; . }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;This is mainly a place for me to document various
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;bits and bobs I&amp;#39;ve been doing on my computers.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;I am a noob in most things so take anything written
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;here with a pinch of salt. Lots of love :)&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{ .Content }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{ range .Site.RegularPages | first 5 }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;{{ .RelPermalink }}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;{{ .Title }}&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ .Summary }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;br&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;br&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ .Date.Format &amp;#34;06 Jan, 2006&amp;#34; }} |
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ .WordCount }} words |
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ .ReadingTime }} mins |
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ range (.GetTerms &amp;#34;tags&amp;#34;) }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;{{ .Permalink }}&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;{{ .LinkTitle }}&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; {{ end }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{ end }}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{ partial &amp;#34;footer.html&amp;#34; . }}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In short, this plops the header and footer partials at the top and bottom of the page respectively, includes a short warning not to listen to me, and then displays my five most recent posts along with a snippet of the post and some accompanyning info: date, word count, reading time, and tags. The keen eyed among you will have noticed that this is a mish mash of normal html tags and strange stuff enclosed in double curly brackets. I&amp;rsquo;m going to end on this cliffhanger but if you want to know more about the curly brackets check out the hugo docs &lt;a href=&#34;https://gohugo.io/templates/introduction&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
</item>
<item>
<title>chess.com api and the continuing search for en passant checkmate</title>
<link>https://nonsense.dymc.win/chess.com-api-and-the-continuing-search-for-en-passant-checkmate/</link>
<title>The search for en passant checkmates 2: Electric Boogaloo</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/chess.com-api-and-the-continuing-search-for-en-passant-checkmate/</guid>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates-2-electric-boogaloo/</guid>
<description>&lt;p&gt;Last time we worked out how to get info for all the games played by titled players in a particular month. Today, we have three objectives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parse this info for the pgn (portable game notation) of each game.&lt;/li&gt;
@ -1277,7 +1296,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pgns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pgn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now a pgn looks something like this if it&amp;rsquo;s just printed as a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/pgn.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;It contains lots of very useful info but for our purposes of finding en passant checkmates, we would ideally just have a list of each move looking something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;moves&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;e5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Bc4&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nc6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qh5&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Nf6&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Qxf7#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&amp;rsquo;t need the headers, we don&amp;rsquo;t need the result, and we don&amp;rsquo;t really need the move numbers (these can be deduced from the list indexes). So the challenge is how to convert the pgn to a list; this is the slightly janky solution I came up wtih.&lt;/p&gt;
@ -1305,11 +1324,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>chess.com api and the search for en passant checkmate</title>
<link>https://nonsense.dymc.win/chess.com-api-and-the-search-for-en-passant-checkmate/</link>
<title>The search for en passant checkmates</title>
<link>http://localhost:1313/the-search-for-en-passant-checkmates/</link>
<pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/chess.com-api-and-the-search-for-en-passant-checkmate/</guid>
<guid>http://localhost:1313/the-search-for-en-passant-checkmates/</guid>
<description>&lt;p&gt;The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.&lt;/p&gt;
&lt;p&gt;First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&amp;rsquo;t think of any obvious way to get completely random players on the site, I used the API&amp;rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&amp;gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;get_archive_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;titled_urls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
@ -1344,18 +1363,18 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;https://api.chess.com/pub/titled/WGM&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&amp;rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/output.webp&#34; alt=&#34;image alt text&#34;&gt;&lt;/p&gt;
</description>
</item>
<item>
<title>declarative firefox config with home-manager on nixos</title>
<link>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</link>
<title>Declarative firefox config with home-manager on nixos</title>
<link>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</link>
<pubDate>Sun, 02 Oct 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<guid>http://localhost:1313/declarative-firefox-config-with-home-manager-on-nixos/</guid>
<description>&lt;p&gt;As a man who finds himself reinstalling his OS more than is probably sensible, any opportunity to minimise the post install admin of sorting out all your settings is an attractive one. With that in mind lets take a look at some of the firefox (my current browser of choice) configuration options avilable to you through home-manager. This assumes you have some sort of home-manager setup working. If you do not I found &lt;a href=&#34;https://github.com/misterio77/nix-starter-configs&#34;&gt;this&lt;/a&gt; friendly githubber&amp;rsquo;s templates to be very helpful.&lt;/p&gt;
&lt;p&gt;First of all you&amp;rsquo;ll need to enable firefox with &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;extensions&#34;&gt;EXTENSIONS&lt;/h3&gt;
@ -1417,11 +1436,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>upgrade your qtile setup with a cute dropdown terminal</title>
<link>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<title>Upgrade your qtile setup with a cute dropdown terminal</title>
<link>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</link>
<pubDate>Fri, 23 Sep 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<guid>http://localhost:1313/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal/</guid>
<description>&lt;p&gt;I didn&amp;rsquo;t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;libqtile.config&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dropdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Scratchpad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
@ -1438,7 +1457,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Though this can easily be altered with the x, y, height, and width keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;ScratchPad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scratchpad&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
@ -1454,7 +1473,7 @@ After moving across most of my stuff I came across the problem of how to hook th
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gives us a little boxy guy in the top left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://nonsense.dymc.win/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://localhost:1313/image/dropdown2.webp&#34; alt=&#34;alt&#34;&gt;&lt;/p&gt;
&lt;p&gt;We also have the option to set keybindings to toggle the appearance of the window. I&amp;rsquo;ve got this in my config.py now:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;keys&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;shift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Return&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
@ -1469,11 +1488,11 @@ After moving across most of my stuff I came across the problem of how to hook th
<item>
<title>rudimentary local scrobbling with bash</title>
<link>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</link>
<title>Rudimentary local scrobbling with bash</title>
<link>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</link>
<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
<guid>https://nonsense.dymc.win/rudimentary-local-scrobbling-with-bash/</guid>
<guid>http://localhost:1313/rudimentary-local-scrobbling-with-bash/</guid>
<description>&lt;p&gt;There are lots of music players on linux. I have used lots of them, I quite like some of them. But for some reason I decided I wanted more. With this in mind, over the past few months I have been constructing a sprawling ecosystem of bash scripts all geared towards delivering a customised listening experience tailored perfectly to my every need. In short, the setup uses a simple dmenu file manager to browse my local files and mpv to play them. Today I&amp;rsquo;ll be talking specifically about my setup for recording the albums I&amp;rsquo;ve been listening to.&lt;/p&gt;
&lt;h3 id=&#34;lets-get-down-to-business&#34;&gt;LET&amp;rsquo;S GET DOWN TO BUSINESS&lt;/h3&gt;
&lt;p&gt;Whenever I select a file to be played with my script I am effectively selecting a path to a file or a path to a directory with files in it which is then fed to mpv. For example, if I&amp;rsquo;m playing the classic album Lemonade by Beyonce it would look like this:&lt;/p&gt;