From 4c1860a311b9ed77592a69a6fb99964efffbb3e4 Mon Sep 17 00:00:00 2001 From: zongor Date: Wed, 10 Jun 2026 18:59:58 -0700 Subject: [PATCH] add uxnget script --- bin/sh/uxnget.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 bin/sh/uxnget.sh diff --git a/bin/sh/uxnget.sh b/bin/sh/uxnget.sh new file mode 100644 index 0000000..d3484bc --- /dev/null +++ b/bin/sh/uxnget.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +function add_alias() { + local alias_name="$1" + local alias_cmd="$2" + local shell_config + local alias_line + + case "$SHELL" in + */fish) + shell_config="$HOME/.config/fish/config.fish" + alias_line="alias $alias_name '$alias_cmd'" + ;; + */bash) + shell_config="$HOME/.bashrc" + alias_line="alias $alias_name='$alias_cmd'" + ;; + */zsh) + shell_config="$HOME/.zshrc" + alias_line="alias $alias_name='$alias_cmd'" + ;; + *) + echo "Unknown shell: $SHELL" + return 1 + ;; + esac + + if [ ! -f "$shell_config" ]; then + mkdir -p "$(dirname "$shell_config")" + touch "$shell_config" + fi + + if grep -q "^alias $alias_name" "$shell_config"; then + echo "Alias '$alias_name' already exists in $shell_config" + return + fi + + echo "$alias_line" >> "$shell_config" + echo "Added alias '$alias_name' to $shell_config" +} + +gui_programs=( +calendar +notepad +noodle +oekaki +turye +theme +left +nasu +nebu +dexe +cccc +m291 +drif +) + +cli_programs=( +drifblim +drifloon +uxnfor +uxnlin +hx +) + +for s in "${gui_programs[@]}"; do + echo "$s.tal.txt > $s.rom" + wget -qP /tmp "https://wiki.xxiivv.com/etc/$s.tal.txt" + uxnasm "/tmp/$s.tal.txt" "$HOME/roms/uxn/$s.rom" + add_alias "$s" "uxn11 $HOME/roms/uxn/$s.rom" +done + +for s in "${cli_programs[@]}"; do + echo "$s.tal.txt > $s.rom" + wget -qP /tmp "https://wiki.xxiivv.com/etc/$s.tal.txt" + uxnasm "/tmp/$s.tal.txt" "$HOME/roms/uxn/$s.rom" + add_alias "$s" "uxncli $HOME/roms/uxn/$s.rom" +done +