Add install/uninstall scripts, icon, rename to OMA-RIODS

- install.sh: clones from Forgejo, installs Love2D, desktop entry, icon, walker refresh
- uninstall.sh: removes everything cleanly
- install.sh uninstall: built-in uninstall flag
- Drops oma-riods-uninstall command into ~/.local/bin for easy removal
- SVG icon (wireframe asteroids)
- Renamed game to OMA-RIODS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
28allday 2026-04-13 15:28:25 +01:00
parent bc88613e07
commit f2ee0c40f8
5 changed files with 217 additions and 2 deletions

View file

@ -1,5 +1,5 @@
function love.conf(t) function love.conf(t)
t.window.title = "ASTEROIDS" t.window.title = "OMA-RIODS"
t.window.width = 1024 t.window.width = 1024
t.window.height = 768 t.window.height = 768
t.window.resizable = true t.window.resizable = true

32
icon.svg Normal file
View file

@ -0,0 +1,32 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!-- Main asteroid -->
<polygon
points="256,80 310,95 355,130 370,170 390,210 375,260 380,310 350,355 310,380 270,390 220,385 175,365 145,330 130,280 125,230 140,180 155,140 190,105 230,85"
fill="none"
stroke="white"
stroke-width="6"
stroke-linejoin="round"
/>
<!-- Main asteroid surface detail -->
<line x1="190" y1="105" x2="230" y2="180" stroke="white" stroke-width="3" opacity="0.5"/>
<line x1="355" y1="130" x2="310" y2="210" stroke="white" stroke-width="3" opacity="0.5"/>
<line x1="220" y1="385" x2="250" y2="310" stroke="white" stroke-width="3" opacity="0.5"/>
<!-- Small asteroid top-right -->
<polygon
points="420,70 440,60 460,68 468,85 462,105 445,112 425,108 415,90"
fill="none"
stroke="white"
stroke-width="4"
stroke-linejoin="round"
/>
<!-- Tiny asteroid bottom-left -->
<polygon
points="85,400 100,392 112,398 115,412 105,422 90,420"
fill="none"
stroke="white"
stroke-width="3"
stroke-linejoin="round"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

138
install.sh Executable file
View file

@ -0,0 +1,138 @@
#!/bin/bash
set -euo pipefail
# OMA-RIODS Installer / Uninstaller
# Usage: ./install.sh — install the game
# ./install.sh uninstall — remove the game
GAME_NAME="oma-riods"
DISPLAY_NAME="OMA-RIODS"
COMMENT="Classic asteroids arcade game with Omarchy theme integration"
REPO_URL="https://git.no-signal.uk/nosignal/oma-riods.git"
INSTALL_DIR="$HOME/.local/share/$GAME_NAME"
DESKTOP_FILE="$HOME/.local/share/applications/$GAME_NAME.desktop"
ICON_DIR="$HOME/.local/share/icons/hicolor"
UNINSTALL_BIN="$HOME/.local/bin/$GAME_NAME-uninstall"
# ── UNINSTALL ──
if [ "${1:-}" = "uninstall" ]; then
echo "=== Uninstalling $DISPLAY_NAME ==="
[ -f "$DESKTOP_FILE" ] && rm "$DESKTOP_FILE" && echo "Removed desktop entry"
for size in 16 32 48 64 128 256 512; do
local_icon="$ICON_DIR/${size}x${size}/apps/$GAME_NAME.png"
[ -f "$local_icon" ] && rm "$local_icon"
done
[ -f "$ICON_DIR/scalable/apps/$GAME_NAME.svg" ] && rm -f "$ICON_DIR/scalable/apps/$GAME_NAME.svg"
echo "Removed icons"
[ -d "$INSTALL_DIR" ] && rm -rf "$INSTALL_DIR" && echo "Removed game files"
[ -f "$UNINSTALL_BIN" ] && rm "$UNINSTALL_BIN" && echo "Removed uninstall command"
command -v gtk-update-icon-cache &>/dev/null && gtk-update-icon-cache -f -t "$ICON_DIR" 2>/dev/null || true
command -v omarchy-restart-walker &>/dev/null && omarchy-restart-walker 2>/dev/null || true
echo "=== $DISPLAY_NAME uninstalled ==="
exit 0
fi
# ── INSTALL ──
echo "=== Installing $DISPLAY_NAME ==="
# Check for Love2D
if ! command -v love &>/dev/null; then
echo "Installing Love2D..."
if command -v pacman &>/dev/null; then
sudo pacman -S --noconfirm love
else
echo "Error: Love2D (love) is not installed and pacman not found."
echo "Install Love2D manually and re-run this script."
exit 1
fi
fi
# Clone or update the game
if [ -d "$INSTALL_DIR/.git" ]; then
echo "Updating existing installation..."
cd "$INSTALL_DIR"
git pull --ff-only
else
[ -d "$INSTALL_DIR" ] && rm -rf "$INSTALL_DIR"
echo "Cloning game repository..."
git clone "$REPO_URL" "$INSTALL_DIR"
fi
# Install icon
echo "Installing icon..."
ICON_SVG="$INSTALL_DIR/icon.svg"
if command -v rsvg-convert &>/dev/null; then
for size in 16 32 48 64 128 256 512; do
mkdir -p "$ICON_DIR/${size}x${size}/apps"
rsvg-convert -w "$size" -h "$size" "$ICON_SVG" -o "$ICON_DIR/${size}x${size}/apps/$GAME_NAME.png"
done
elif command -v magick &>/dev/null; then
for size in 16 32 48 64 128 256 512; do
mkdir -p "$ICON_DIR/${size}x${size}/apps"
magick "$ICON_SVG" -resize "${size}x${size}" "$ICON_DIR/${size}x${size}/apps/$GAME_NAME.png"
done
else
echo "No SVG converter found, using SVG icon directly"
mkdir -p "$ICON_DIR/scalable/apps"
cp "$ICON_SVG" "$ICON_DIR/scalable/apps/$GAME_NAME.svg"
fi
# Create .desktop file
echo "Creating desktop entry..."
mkdir -p "$(dirname "$DESKTOP_FILE")"
cat > "$DESKTOP_FILE" << EOF
[Desktop Entry]
Type=Application
Name=$DISPLAY_NAME
Comment=$COMMENT
Exec=uwsm app -- love $INSTALL_DIR
Icon=$GAME_NAME
Terminal=false
Categories=Game;ArcadeGame;
StartupNotify=true
TryExec=love
EOF
# Install uninstall command so user can remove it any time
mkdir -p "$HOME/.local/bin"
cat > "$UNINSTALL_BIN" << 'UNINSTALL'
#!/bin/bash
# Uninstall OMA-RIODS
SCRIPT_URL="https://git.no-signal.uk/nosignal/oma-riods/raw/branch/master/install.sh"
curl -sL "$SCRIPT_URL" | bash -s uninstall 2>/dev/null || bash "$HOME/.local/share/oma-riods/install.sh" uninstall 2>/dev/null || {
# Fallback: inline uninstall
rm -f "$HOME/.local/share/applications/oma-riods.desktop"
rm -rf "$HOME/.local/share/oma-riods"
for s in 16 32 48 64 128 256 512; do
rm -f "$HOME/.local/share/icons/hicolor/${s}x${s}/apps/oma-riods.png"
done
rm -f "$HOME/.local/share/icons/hicolor/scalable/apps/oma-riods.svg"
rm -f "$HOME/.local/bin/oma-riods-uninstall"
command -v omarchy-restart-walker &>/dev/null && omarchy-restart-walker 2>/dev/null
echo "OMA-RIODS uninstalled"
}
UNINSTALL
chmod +x "$UNINSTALL_BIN"
# Update icon cache
command -v gtk-update-icon-cache &>/dev/null && gtk-update-icon-cache -f -t "$ICON_DIR" 2>/dev/null || true
# Restart walker
if command -v omarchy-restart-walker &>/dev/null; then
echo "Refreshing app launcher..."
omarchy-restart-walker 2>/dev/null || true
fi
echo ""
echo "=== $DISPLAY_NAME installed ==="
echo ""
echo " Launch: search '$DISPLAY_NAME' in app launcher or run: love $INSTALL_DIR"
echo " Uninstall: $GAME_NAME-uninstall"
echo ""

View file

@ -109,7 +109,7 @@ local function drawTitleScreen()
love.graphics.setFont(Fonts.large) love.graphics.setFont(Fonts.large)
love.graphics.setColor(p.bright) love.graphics.setColor(p.bright)
love.graphics.printf("ASTEROIDS", 0, centerY, sw, "center") love.graphics.printf("OMA-RIODS", 0, centerY, sw, "center")
-- Decorative wireframe lines -- Decorative wireframe lines
love.graphics.setColor(p.asteroid[1], p.asteroid[2], p.asteroid[3], 0.2) love.graphics.setColor(p.asteroid[1], p.asteroid[2], p.asteroid[3], 0.2)

45
uninstall.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/bash
set -euo pipefail
# OMA-RIODS Uninstaller
GAME_NAME="oma-riods"
DISPLAY_NAME="OMA-RIODS"
INSTALL_DIR="$HOME/.local/share/$GAME_NAME"
DESKTOP_FILE="$HOME/.local/share/applications/$GAME_NAME.desktop"
ICON_DIR="$HOME/.local/share/icons/hicolor"
echo "=== Uninstalling $DISPLAY_NAME ==="
# Remove desktop entry
if [ -f "$DESKTOP_FILE" ]; then
rm "$DESKTOP_FILE"
echo "Removed desktop entry"
fi
# Remove icons
for size in 16 32 48 64 128 256 512; do
local_icon="$ICON_DIR/${size}x${size}/apps/$GAME_NAME.png"
[ -f "$local_icon" ] && rm "$local_icon"
done
[ -f "$ICON_DIR/scalable/apps/$GAME_NAME.svg" ] && rm "$ICON_DIR/scalable/apps/$GAME_NAME.svg"
echo "Removed icons"
# Remove game files
if [ -d "$INSTALL_DIR" ]; then
rm -rf "$INSTALL_DIR"
echo "Removed game files"
fi
# Update icon cache
if command -v gtk-update-icon-cache &>/dev/null; then
gtk-update-icon-cache -f -t "$ICON_DIR" 2>/dev/null || true
fi
# Restart walker
if command -v omarchy-restart-walker &>/dev/null; then
omarchy-restart-walker 2>/dev/null || true
fi
echo "=== $DISPLAY_NAME uninstalled ==="