mirror of
https://github.com/ksherlock/ample.git
synced 2026-10-24 22:02:19 +00:00
* Initialize and finalize AmpleWin: Full-featured Windows Port with Adaptive UI, optimized engine, and internationalized documentation * Update media args * AmpleWin: Finalized Windows Port with Adaptive UI, Optimized Engine, VGM Recording, and Shared Directory Support * Fix NameError: subprocess not defined in main.py * UI: Remove redundant MAME path label from Paths tab * UI: Implement smart slot validation for disabled options and click-to-browse Shared Directory * feat(win): editable console, launch logic fixes & doc updates * Fix path quoting issues, add file selectors for A/V, and normalize shared dir path * feat: sync with Ample v0.285 resources, update to MAME 0.285, and add ROM search filter * v0.285: Expand ROM library, implement download failover, and advanced SCSI sub-slot emulation * Adjust ROM download priority: prefer callapple.org for stability, mdk.cab as fallback * Sync roms.plist with upstream/master * docs(agent): record upstream synchronization session * refactor: rename mame_bin to mame directory * chore: update .gitignore for mame directory rename * fix(main): update download and detection paths to 'mame' * fix(main): robust path resolution for pyinstaller builds * docs(readme): add build_exe.bat to project structure * fix(build): remove creation of empty mame directory to avoid confusion * feat(build): auto-generate application icon from Assets.xcassets * Add AmpleLinux - Linux Port of Ample (Apple II/Mac emulator frontend) - Ported from AmpleWin with ~20 Linux-specific adaptations - Replaced winreg with gsettings/KDE dark mode detection - Replaced os.startfile with xdg-open - Removed MAME auto-download (users install via package manager) - Added system-wide MAME detection (PATH, /usr/bin, /usr/games) - Removed all .exe suffixes from binary references - Created AmpleLinux.sh launcher script - Dual-language READMEs (English + Traditional Chinese) * Fix: use python3 -m pip instead of pip3/pip for modern Linux compatibility * feat(linux): Finalize AmpleLinux port documentation and build scripts * Fix formatting for Windows and Linux user notes Updated user guidance for Windows and Linux users. * feat(linux): interactive .desktop install, runtime icon loading, updated docs * docs(linux): clarify mame_downloader.py usage status * docs: add PR draft template * fix(linux): add binutils dependency check for pyinstaller * Update: mame 0.286 --------- Co-authored-by: User <user@example.com>
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
from PIL import Image
|
|
import os
|
|
import sys
|
|
|
|
def create_linux_icons(source_png, output_dir):
|
|
"""Generate multiple PNG icon sizes for Linux desktop integration."""
|
|
print(f"Opening source: {source_png}")
|
|
try:
|
|
img = Image.open(source_png)
|
|
except Exception as e:
|
|
print(f"Error opening image: {e}")
|
|
return False
|
|
|
|
# Standard Linux icon sizes (freedesktop.org spec)
|
|
icon_sizes = [512, 256, 128, 64, 48, 32, 16]
|
|
|
|
os.makedirs(output_dir, exist_ok=True)
|
|
|
|
for size in icon_sizes:
|
|
resized = img.resize((size, size), Image.LANCZOS)
|
|
out_path = os.path.join(output_dir, f"ample_{size}x{size}.png")
|
|
resized.save(out_path, format='PNG')
|
|
print(f" Saved: {out_path}")
|
|
|
|
# Also save a default icon at top level
|
|
default_icon = os.path.join(os.path.dirname(output_dir), "ample.png")
|
|
img.resize((256, 256), Image.LANCZOS).save(default_icon, format='PNG')
|
|
print(f" Saved default icon: {default_icon}")
|
|
|
|
print("Success!")
|
|
return True
|
|
|
|
if __name__ == "__main__":
|
|
src = os.path.join("..", "Ample", "Assets.xcassets", "AppIcon.appiconset", "icon-1024.png")
|
|
dst_dir = "icons"
|
|
|
|
# Check if source exists
|
|
if not os.path.exists(src):
|
|
print(f"Source file not found: {src}")
|
|
print("Make sure you run this script from the AmpleLinux directory.")
|
|
sys.exit(1)
|
|
|
|
if create_linux_icons(src, dst_dir):
|
|
sys.exit(0)
|
|
else:
|
|
sys.exit(1)
|