Skip to content

Instantly share code, notes, and snippets.

@zydezu
zydezu / winrun.sh
Created July 28, 2026 22:33
winrun - run .exes with proton directly from your file explorer (this example uses proton-cachyos, but you can adapt it)
#!/bin/bash
PROTON_RUNNER="/usr/share/steam/compatibilitytools.d/proton-cachyos-slr/proton"
PREFIX_DIR="$HOME/.protonprefix/pfx"
FAKE_STEAM="$HOME/.protonprefix/fake-steam"
LOCKFILE="$HOME/.protonprefix/winrun.lock"
export STEAM_COMPAT_DATA_PATH="$PREFIX_DIR"
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$FAKE_STEAM"
export STEAM_COMPAT_MEDIA_PATH="$HOME/.protonprefix/media"
export STEAM_COMPAT_TRANSCODED_MEDIA_PATH="$HOME/.protonprefix/media_transcoded"
@zydezu
zydezu / changelogs
Last active September 9, 2026 23:00
Download and summarise changelogs for Arch/AUR packages, with an option to update afterwards. Probably won't work and requires too many things. Place this in '~/.local/bin' if desired.
#!/usr/bin/env bash
# Show upstream changelogs/release notes for pending pacman + AUR + Flatpak updates
#
# Requires: bash 4+, pacman, pacman-contrib (checkupdates), an AUR helper supporting `-Qua` (yay by default - export AUR_HELPER=paru to swap),
# jq, curl, ncurses (tput), plus awk/sed/grep/seq/wc/tr/head
#
# Optional: flatpak, arch-update (only for the post-run prompt), GITHUB_TOKEN to raise the GitHub API rate limit (60/hr -> 5000/hr)
#
# Usage: changelogs
@zydezu
zydezu / scratch_archive_dl.py
Created June 18, 2026 22:11
Download a Scratch project.json and package it into an sb3 from a Wayback Machine link
"""
fetch_scratch_json.py - download a Scratch project.json and package it into an sb3 from a Wayback Machine link.
a .sb3 is just a zip of project.json + every asset (costumes/sounds), each named
by its md5+ext. the wayback machine archives the page, not the bundle, so we
have to grab project.json from the archived projects.scratch.mit.edu capture and
then pull each asset (those are content-addressed, so the live CDN usually still
has old ones), then zip it all back together.
usage:
@zydezu
zydezu / backupcomputer.bat
Last active January 21, 2026 01:05
Backup the windows user directory to where the directory this .bat file is run.
@echo off
setlocal EnableExtensions EnableDelayedExpansion
REM ===== Configuration =====
set BACKUP_DEST=.
for /f %%I in ('powershell -NoProfile -Command "Get-Date -Format yyyy-MM-dd_HH_mm_ss"') do set TIMESTAMP=%%I
set BACKUP_FILE=%BACKUP_DEST%\%TIMESTAMP% zydesktop.7z
set LOG_FILE=%BACKUP_DEST%\%TIMESTAMP%_backup.log
set FAIL_LOG=%BACKUP_DEST%\%TIMESTAMP%_backup_failed.log
@zydezu
zydezu / watchjxr.ps1
Last active December 17, 2025 03:52
Convert jxr (HDR) screenshots saved by GameBar to HDR pngs, copying them to the clipboard, ready for sharing. Uses https://github.com/ledoge/jxr_to_png. Use Windows + Alt + PrtScn to save a screenshot using GameBar.
# Uses jxr_to_png.exe from https://github.com/ledoge/jxr_to_png
Add-Type -AssemblyName PresentationCore
Add-Type -AssemblyName WindowsBase
Add-Type -AssemblyName System.Windows.Forms
function Copy-FileToClipboard {
param([string]$filePath)
$files = New-Object System.Collections.Specialized.StringCollection