From e185aad9ba090bd8423c8bade9b6c2d8a3e44c0d Mon Sep 17 00:00:00 2001 From: MatrixFurry Date: Mon, 20 Jul 2026 04:21:25 -0500 Subject: [PATCH] generate readme from self-documented scripts --- README.md | 93 +++++++++++++++++++---------------------- meta/generate-readme.nu | 81 +++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 50 deletions(-) create mode 100755 meta/generate-readme.nu diff --git a/README.md b/README.md index e9bddc3..bce52fe 100644 --- a/README.md +++ b/README.md @@ -1,96 +1,89 @@ -# Scripts +# MatrixFurry's Scripts +Various scripts that I maintain! -Various scripts that I maintain. +See --help for more info. -## rawrsync -Easily sync or deploy projects over rsync. Intended to somewhat replicate CLion's Deployment feature for use with other IDEs. +# Featured +## adb-auto-connect +Automatically find and connect to an Android device with Wireless Debugging over the local network. -Configure with `.rawrsync.toml` in your project root. For example: -```toml -[org-server-23] -user = "username" -address = "org-server-23.tailnet-name.ts.net" -path = "/home/username/deployment/project/" # Destination path on the server +## atproto-app-passwords +Create an app password for your ATProto account. -[vr-desktop] -user = "username" -address = "vr-desktop.tailnet-name.ts.net" -path = "/home/username/vr/project" -``` +## auto-benchmark +Set up and run a Blender benchmark on the specified device, then automatically +compare your results to the results on [Blender Open Data](https://opendata.blender.org/). -See `--help` for usage. +## ln-bin +Quickly symlink executable files to `~/.local/bin/` + +## rawrsync +Easily sync or deploy projects over rsync. Intended to somewhat replicate CLion's Deployment feature for use with other IDEs. ## update-gitignore Quickly and easily create or update `gitignore` files from predefined templates. +## yt-rss +Get an RSS feed for the specified YouTube channel. + +# Other Scripts +## abs-nu-exec +Useful for executing nushell scripts in GNOME keyboard shortcuts without adding Homebrew PATH to your shell environment + ## adb-auto-connect Automatically find and connect to an Android device with Wireless Debugging over the local network. -You'll need to create a file at `~/.config/adb-auto-connect.nuon` with the MAC Addresses you want to search for. For example: -```json -[ - "ff:ff:ff:ff:ff:ff", - "aa:aa:aa:aa:aa:aa" -] -``` +## atproto-app-passwords +Create an app password for your ATProto account. ## auto-benchmark Set up and run a Blender benchmark on the specified device, then automatically compare your results to the results on [Blender Open Data](https://opendata.blender.org/). -## steam-disable-update -Completely disable steam updates for a game or app. - -Usage: `steam-disable-update ` -Allow updates: `steam-disable-update --revert ` - -Caveats to this approach: -- Your "last played" time will never update -- I haven't used it in a long time, so I can't guarantee it will work -- It might cause other bugs, I haven't tested it extensively +## clean-bin +Remove broken symlinks from `~/.local/bin` ## detect-gpu-issues Detect issues with the GPU. -This was created for my own use on a Framework Laptop 16 with an external dock. -Sometimes, the external GPU will have issues caused by my hacky m.2 to oculink adapter. - -I can't guarantee this will work for you, but it does reliably detect when there is an issue on my system. +## extract-m4a +Extract audio from a m4a file to the codec's native container ## homepod-mini-workaround -See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3279 +see https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3279 ## ln-bin Quickly symlink executable files to `~/.local/bin/` -## clean-bin -Quickly remove broken symlinks from `~/.local/bin` - ## lyricfetch +> [!NOTE] +> I reccomend using a [lrclib](https://lrclib.net/) client such as [lrcget](https://github.com/tranxuanthang/lrcget) or [Chronograph](https://flathub.org/apps/io.github.dzheremi2.lrcmake-gtk) instead! -> NOTE: I reccomend using a [lrclib](https://lrclib.net/) client such as [lrcget](https://github.com/tranxuanthang/lrcget) or [Chronograph](https://flathub.org/apps/io.github.dzheremi2.lrcmake-gtk) instead! +## pods-remote +This will not work with Tailscale SSH, see https://github.com/tailscale/tailscale/issues/5295 -Fetches lyrics from Genius using a [Dumb](https://github.com/rramiachraf/dumb) instance, and adds them to your music library's metadata. - -Currently only supports FLAC files. +## rawrsync +Easily sync or deploy projects over rsync. Intended to somewhat replicate CLion's Deployment feature for use with other IDEs. ## relink Update symlink targets from an old target directory to a new one -Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all -symlinks in `~/.local/bin` that point to the old location with -`relink ~/.local/bin ~/Development/tools ~/Applications` - ## reset-envision-prefix Resets an Envision prefix and the downloaded repos. Useful to work around [#65](https://gitlab.com/gabmus/envision/-/issues/65) -## start-service-if-neeeded +## start-service-if-needed Starts a systemd service if it is not already started, otherwise do nothing. Useful if you only want to ask for the password when the service actually needs to be started. +## steam-disable-update +Completely disable steam updates for a game or app. + ## toggle-extension Provides an easy way to toggle a GNOME extension. Useful for setting up keyboard shortcuts. +## update-gitignore +Quickly and easily create or update `gitignore` files from predefined templates. + ## yt-rss Get an RSS feed for the specified YouTube channel. diff --git a/meta/generate-readme.nu b/meta/generate-readme.nu new file mode 100755 index 0000000..986b513 --- /dev/null +++ b/meta/generate-readme.nu @@ -0,0 +1,81 @@ +#!/usr/bin/env nu +# SPDX-License-Identifier: AGPL-3.0-only +# Copyright (c) 2026 MatrixFurry + +# -> Editable <- # +const h1 = "# MatrixFurry's Scripts +Various scripts that I maintain! + +See --help for more info." + +const featured_names = [ + rawrsync + atproto-app-passwords + update-gitignore + adb-auto-connect + auto-benchmark + ln-bin + yt-rss +] + +# -> Start <- # +const repo = path self .. + +# Generate a readme using the `main` documentation from each script +export def main [ + --debug (-d) # Print the README instead of saving it +] { + let md_comments = [ + "" + $"" + "" + "\n" + ] | str join "\n" + + let paths = ls ($repo + "/scripts") + | where type == file + | get name + let names = $paths | path parse | get stem + let use_statements = $paths | each {|path| $"use ($path)"} | str join ";" + + let scripts = nu -nc $"($use_statements); scope commands | where name in ($names | to nuon) | to nuon" | from nuon + + let deprecated = $scripts | where {|it| ($it.attributes | where name == deprecated | length) != 0} | sort-by name + let not_deprecated = $scripts | where {|it| ($it.attributes | where name == deprecated | length) == 0} + + let unfeatured = $not_deprecated | where $it.name not-in $featured_names | sort-by name + + # Order according to featured_names + let rank = $featured_names | enumerate | reduce --fold {} {|it, acc| $acc | insert $it.item $it.index} + let featured = $not_deprecated | where $it.name in $featured_names | insert rank {|row| $rank | get $row.name} | sort-by rank | reject rank + + [ + $md_comments + $h1 + "\n# Featured" + (generate-section $featured) + "\n# Other Scripts" + (generate-section $unfeatured) + "\n# Deprecated" + (generate-section $deprecated) + ] + | str join "\n" + | if $debug { + print $in + } else { + $in | save -fp ($repo | path join README.md) + } +} + +def generate-section [scripts: table] { + $scripts + | each {|e| + if ($e.description | is-empty) { + log warning $"No documentation provided for `($e.name)`, it will be excluded from the readme." + return null + } + + return $"\n## ($e.name)\n($e.description)\n" + } + | str join +} -- 2.51.2