diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/config.toml b/config.toml index 01e2389..fd54b33 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ baseURL = "https://nonsense.dymc.win" -title = "James' Blog :-)" -theme = "etch" +title = "James' Blog" +# theme = "etch" languageCode = "en-GB" enableInlineShortcodes = true pygmentsCodeFences = true @@ -17,6 +17,12 @@ pygmentsUseClasses = true title = "--help" url = "/info/" weight = 20 + # [[menu.main]] + # identifier = "search" + # name = "search" + # title = "search" + # url = "/search/" + # weight = 20 [permalinks] posts = "/:title/" @@ -24,3 +30,7 @@ pygmentsUseClasses = true [markup.goldmark.renderer] # Allows HTML in Markdown unsafe = true + +# allows creation of index.json for search +[outputs] +home = ["HTML", "JSON"] diff --git a/content/posts/chess.com-api-and-the-continuing-search-for-en-passant-checkmate.md b/content/posts/chess.com-api-and-the-continuing-search-for-en-passant-checkmate.md index ae9bf3d..b488125 100644 --- a/content/posts/chess.com-api-and-the-continuing-search-for-en-passant-checkmate.md +++ b/content/posts/chess.com-api-and-the-continuing-search-for-en-passant-checkmate.md @@ -1,5 +1,5 @@ --- -title: chess.com api and the continuing search for en passant checkmate +title: "The search for en passant checkmates 2: Electric Boogaloo" date: 2022-11-08 tags: - chess diff --git a/content/posts/chess.com-api-and-the-search-for-en-passant-checkmate.md b/content/posts/chess.com-api-and-the-search-for-en-passant-checkmate.md index bc7b520..884558f 100644 --- a/content/posts/chess.com-api-and-the-search-for-en-passant-checkmate.md +++ b/content/posts/chess.com-api-and-the-search-for-en-passant-checkmate.md @@ -1,5 +1,5 @@ --- -title: chess.com api and the search for en passant checkmate +title: The search for en passant checkmates date: 2022-10-26 tags: - chess diff --git a/content/posts/declarative-firefox-config-with-home-manager-on-nixos.md b/content/posts/declarative-firefox-config-with-home-manager-on-nixos.md index e09fda2..0d85502 100644 --- a/content/posts/declarative-firefox-config-with-home-manager-on-nixos.md +++ b/content/posts/declarative-firefox-config-with-home-manager-on-nixos.md @@ -1,5 +1,5 @@ --- -title: declarative firefox config with home-manager on nixos +title: Declarative firefox config with home-manager on nixos date: 2022-10-02 tags: - nixos diff --git a/content/posts/docker-on-nixos.md b/content/posts/docker-on-nixos.md index 7c244e1..81656be 100644 --- a/content/posts/docker-on-nixos.md +++ b/content/posts/docker-on-nixos.md @@ -1,5 +1,5 @@ --- -title: translating docker to nix?! +title: Translating docker to nix?! date: 2023-02-28 tags: - docker diff --git a/content/posts/elite-dough-philosophy.md b/content/posts/elite-dough-philosophy.md index bc77399..11e42aa 100644 --- a/content/posts/elite-dough-philosophy.md +++ b/content/posts/elite-dough-philosophy.md @@ -1,5 +1,5 @@ --- -title: elite bread dough for lazy boys +title: Bread dough for lazy boys date: 2023-01-22 tags: - cooking diff --git a/content/posts/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script.md b/content/posts/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script.md index fc213ef..224bf9b 100644 --- a/content/posts/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script.md +++ b/content/posts/get-the-thoughts-out-of-your-head-and-into-a-digital-format-with-this-python-journal-script.md @@ -1,5 +1,5 @@ --- -title: get the thoughts out of your head and into a digital format with this python journal script +title: Get the thoughts out of your head and into a digital format with this python journalling script date: 2022-12-01 tags: - python diff --git a/content/posts/getting-started-with-a-barebones-neovim-plugin-in-lua.md b/content/posts/getting-started-with-a-barebones-neovim-plugin-in-lua.md index 101d7c2..99cefd7 100644 --- a/content/posts/getting-started-with-a-barebones-neovim-plugin-in-lua.md +++ b/content/posts/getting-started-with-a-barebones-neovim-plugin-in-lua.md @@ -1,5 +1,5 @@ --- -title: so you want to write a neovim plugin with lua +title: So you want to write a neovim plugin with lua date: 2024-04-06 tags: - lua diff --git a/content/posts/lowkey-emacs-setup.md b/content/posts/lowkey-emacs-setup.md index 3da646f..3d8b5c2 100644 --- a/content/posts/lowkey-emacs-setup.md +++ b/content/posts/lowkey-emacs-setup.md @@ -1,5 +1,5 @@ --- -title: lowkey emacs setup +title: Lowkey emacs setup bits and bobs date: 2022-11-18 tags: - emacs diff --git a/content/posts/making-nix-colors-talk-to-neovim.md b/content/posts/making-nix-colors-talk-to-neovim.md index 955cfb0..dd43b76 100644 --- a/content/posts/making-nix-colors-talk-to-neovim.md +++ b/content/posts/making-nix-colors-talk-to-neovim.md @@ -1,5 +1,5 @@ --- -title: making nix-colors talk to neovim +title: Making nix-colors talk to neovim date: 2023-08-18 tags: - nix-colors diff --git a/content/posts/multi-user-qtile-fiddling.md b/content/posts/multi-user-qtile-fiddling.md index a393f4e..9bbd7cf 100644 --- a/content/posts/multi-user-qtile-fiddling.md +++ b/content/posts/multi-user-qtile-fiddling.md @@ -1,5 +1,5 @@ --- -title: multi user qtile fiddling +title: Multi user qtile fiddling date: 2022-12-20 tags: - qtile diff --git a/content/posts/nix-colors.md b/content/posts/nix-colors.md index 049f5ee..a8b2f90 100644 --- a/content/posts/nix-colors.md +++ b/content/posts/nix-colors.md @@ -1,5 +1,5 @@ --- -title: theming nirvana +title: Achieve peak rice with nix-colors date: 2023-03-13 tags: - nixos diff --git a/content/posts/nixos-remote-auto-static-site-deploy.md b/content/posts/nixos-remote-auto-static-site-deploy.md index 582c18b..03e6f18 100644 --- a/content/posts/nixos-remote-auto-static-site-deploy.md +++ b/content/posts/nixos-remote-auto-static-site-deploy.md @@ -1,5 +1,5 @@ --- -title: over-engineered (?) nixos blog deployment setup +title: Over-engineered (?) nixos blog deployment setup date: 2025-08-11 tags: - nixos diff --git a/content/posts/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps.md b/content/posts/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps.md index 94653a3..b0bbce3 100644 --- a/content/posts/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps.md +++ b/content/posts/podcast-setup-for-broke-boys-whose-trash-phone-cant-hack-modern-apps.md @@ -1,12 +1,12 @@ --- -title: podcast setup for broke boys whose trash phone cant hack modern apps +title: Python podcast scripting date: 2023-01-24 tags: - python draft: false --- -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 'podcast-player-hopping' without success for the last couple of months trying to find something which doesn'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: +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 'podcast-player-hopping' without success for the last couple of months trying to find something which doesn'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: - write python script to download podcasts - set up cron job on my server to run script every couple of hours diff --git a/content/posts/rudimentary-local-scrobbling-with-bash.md b/content/posts/rudimentary-local-scrobbling-with-bash.md index ad0d3fc..bb884c5 100644 --- a/content/posts/rudimentary-local-scrobbling-with-bash.md +++ b/content/posts/rudimentary-local-scrobbling-with-bash.md @@ -1,6 +1,6 @@ --- -title: rudimentary local scrobbling with bash -date: 2022-09-13 +title: Rudimentary local scrobbling with bash +date: 2022-09-13 tags: - music - bash diff --git a/content/posts/setting-up-a-lean-mean-hugo-blogging-theme.md b/content/posts/setting-up-a-lean-mean-hugo-blogging-theme.md index fff454c..b036f1a 100644 --- a/content/posts/setting-up-a-lean-mean-hugo-blogging-theme.md +++ b/content/posts/setting-up-a-lean-mean-hugo-blogging-theme.md @@ -3,7 +3,7 @@ title: setting up a lean mean hugo blogging theme date: 2022-11-10 tags: - hugo -draft: false +draft: true --- diff --git a/content/posts/simple-nixos-config-for-static-site-on-vps.md b/content/posts/simple-nixos-config-for-static-site-on-vps.md index ec97579..2e1930d 100644 --- a/content/posts/simple-nixos-config-for-static-site-on-vps.md +++ b/content/posts/simple-nixos-config-for-static-site-on-vps.md @@ -1,5 +1,5 @@ --- -title: simple nixos config for vps static site +title: Simple nixos config for vps static site date: 2023-01-29 tags: - nixos diff --git a/content/posts/tailscale-caddy-nixos-containers.md b/content/posts/tailscale-caddy-nixos-containers.md index 57dadbd..1d50dbc 100644 --- a/content/posts/tailscale-caddy-nixos-containers.md +++ b/content/posts/tailscale-caddy-nixos-containers.md @@ -1,5 +1,5 @@ --- -title: tailscale, caddy, and nixos containers - a match made in heaven +title: Tailscale, caddy, and nixos containers date: 2023-05-16 tags: - nixos diff --git a/content/posts/teeny-tiny-bash-fetch-script.md b/content/posts/teeny-tiny-bash-fetch-script.md index 4b5c6bb..0b25f4e 100644 --- a/content/posts/teeny-tiny-bash-fetch-script.md +++ b/content/posts/teeny-tiny-bash-fetch-script.md @@ -1,5 +1,5 @@ --- -title: teeny tiny bash fetch script +title: Teeny tiny bash fetch script date: 2022-12-10 tags: - bash diff --git a/content/posts/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal.md b/content/posts/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal.md index 619d04d..966edbc 100644 --- a/content/posts/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal.md +++ b/content/posts/upgrade-your-qtile-setup-with-a-cute-dropdown-terminal.md @@ -1,5 +1,5 @@ --- -title: upgrade your qtile setup with a cute dropdown terminal +title: Upgrade your qtile setup with a cute dropdown terminal date: 2022-09-23 tags: - python diff --git a/content/posts/vanilla-javascript-theme-toggle-for-simpletons.md b/content/posts/vanilla-javascript-theme-toggle-for-simpletons.md index 694ce24..7ce644a 100644 --- a/content/posts/vanilla-javascript-theme-toggle-for-simpletons.md +++ b/content/posts/vanilla-javascript-theme-toggle-for-simpletons.md @@ -1,5 +1,5 @@ --- -title: vanilla javascript theme toggle for simpletons +title: Vanilla javascript theme toggle for simpletons date: 2023-06-26 tags: - javascript diff --git a/content/posts/writing-a-qtile-widget.md b/content/posts/writing-a-qtile-widget.md index 3758fb2..dc4c380 100644 --- a/content/posts/writing-a-qtile-widget.md +++ b/content/posts/writing-a-qtile-widget.md @@ -1,5 +1,5 @@ --- -title: learning about qtile widgets via the medium of cricket +title: Learning about qtile widgets with cricket date: 2023-04-03 tags: - qtile diff --git a/content/posts/zen-twitch-viewing-script.md b/content/posts/zen-twitch-viewing-script.md new file mode 100644 index 0000000..fd667f7 --- /dev/null +++ b/content/posts/zen-twitch-viewing-script.md @@ -0,0 +1,106 @@ +--- +title: Handy script for a more zen twitch experience +date: 2025-08-13 +tags: bash, script, twitch +draft: false +--- + +I like to watch twitch streams. +Watching them in the browser at `twitch.tv` is generally not an experience which sparks joy though. +I'm buffering. +I'm declining cookies. +I'm getting spammed with notifications to claim a sick new overwatch skin. +There's a little channel point button twerking for me to click it. +You get the idea; it's a heavy noisy experience. + +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 [streamlink](https://github.com/streamlink/streamlink). +Here it is: + +```bash +PLAYER="mpv" +LAUNCHER="tofi" +NOTIFY="dunstify" + +# you need an api key, get them here +# https://dev.twitch.tv/docs/api/get-started/ +CLIENT_ID="id-here" +CLIENT_SECRET="secret-here-please-sssshh" + +# list of streams to check +STREAMS=( + "limmy" + "fl0m" + "northernlion" + "caedrel" +) + +# reassure user that something is happening +"${NOTIFY}" "twitch -- checking who's live beep boop be patient" + +# get auth token from twitch +ACCESS_TOKEN=$(curl -s -X POST \ + "https://id.twitch.tv/oauth2/token" \ + -d "client_id=$CLIENT_ID" \ + -d "client_secret=$CLIENT_SECRET" \ + -d "grant_type=client_credentials" \ + | jq -r '.access_token') + +# define empty list +LIVE=() + +# loop through streams, check if live and append info to list +for STREAM in "${STREAMS[@]}"; do + RESPONSE=$(curl -s -H "Client-ID: $CLIENT_ID" \ + -H "Authorization: Bearer $ACCESS_TOKEN" \ + "https://api.twitch.tv/helix/streams?user_login=$STREAM") + + LIVE_STATUS=$(echo "$RESPONSE" | jq '.data | length') + + if [ "$LIVE_STATUS" -gt 0 ]; then + TITLE=$(echo "$RESPONSE" | jq -r '.data[0].title') + GAME=$(echo "$RESPONSE" | jq -r '.data[0].game_name') + LIVE+=("$STREAM | $GAME | $TITLE") + fi +done + +# pipe list items into tofi with new lines at the end +choice="$( printf "%s\n" "${LIVE[@]}" | "${LAUNCHER}")" + +if [[ -n "$choice" ]]; then + # get first column from selection aka stream name + meat=$(echo "$choice" | awk '{print $1}') + "${NOTIFY}" "twitch -- launching twitch.tv/$meat" + streamlink twitch.tv/"$meat" 1080p60 --player $"{PLAYER}" +fi + +``` + +### What it does: + +- talk to twitch api to get auth token +- loop trough list of streams to check if they're live (using auth token) +- grab some info about streams that are live and append it to a list +- pipe said list into tofi +- capture user's choice +- open choice in mpv using streamlink + +### Dependencies + +- curl +- jq +- tofi (would work with other launchers dmenu etc.) +- mpv (would work with other media players vlc etc.) +- dunst (would work with other notification daemons mako etc.) + +### Positive :) + +- no chat (you don't have to read the degenerates spamming LUL) +- you can customise the script to use your favourite desktop tools +- can rewind! + +### Negative :( + +- no chat (you might want to spam LUL) +- takes a second to talk to the internet so things don't launch immediately +- have to faff with getting api key - [how to get one btw](https://dev.twitch.tv/docs/api/get-started/) diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..e30f8ce --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,19 @@ +# Learn how to use Date format (date, created, updated) +# -> https://gohugo.io/functions/dateformat/ + +[posts] + +[posts.title] +other = "Posts" + +[posts.date] +other = "Jan 2, 2006" + + +[post] + +[post.created] +other = "January 2, 2006" + +[post.updated] +other = "Updated January 2, 2006" diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..326ef8b --- /dev/null +++ b/layouts/404.html @@ -0,0 +1 @@ +
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: ‘oh this is cool I can specify which desktop environment to use in my configuration.nix’. Next thing you know you’ve discovered home-manager 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.
+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: ‘oh this is cool I can specify which desktop environment to use in my configuration.nix’. Next thing you know you’ve discovered home-manager 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.
Nix-colors 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!
This will be a quick rundown of how I’ve got things set up; this is basically just a rehash of this.
@@ -116,9 +123,18 @@ ]That’s it for today. Thank you to the hero that made this.