/UsefulBatchFiles

Some odd small batch files I've made that have proven useful.

Primary LanguagePython

UsefulBatchFiles

A general repository to collect various small batch files I've made that have been useful.

raplaylist.cmd

Creates basic RetroArch playlists in the current JSON format from plain text files containing a list of roms with their full paths. Works with both Windows paths and Unix-like paths. Requires dos2unix.exe in the current directory or in your PATH for the generated playlist to be readable by RetroArch: https://waterlan.home.xs4all.nl/dos2unix.html

For example, to create a playlist with all .sfc/.smc Super NES roms in the current directory and sub-directories:

dir /B /S *.s?c >"SNES.txt"
raplaylist "SNES.txt"

The above will generate SNES.lpl which can then be copied to RetroArch's playlists directory. Thumbnails and playlist icons are not required for playlists to function, but if you want them remember that they need to be named according to the playlist name chosen. In this example, thumbnails would need to go in thumbnails\SNES\Named_Boxarts etc. and icons need to be named SNES.png and SNES-content.png in the various folders within assets, depending on what UI driver you are using.

Note that rom CRCs are not generated by this script, and are not usually required. For more info on RetroArch's JSON playlist format see http://docs.libretro.com/guides/roms-playlists-thumbnails/

vesync.py

This is a really basic example python script for controlling VeSync-enabled devices from the command line. There's no web interface or VeSync app for Windows/Linux, so this is a good alternative to having to use Alexa for PC control of VeSync devices. This script uses and requires pyvesync, see https://pypi.org/project/pyvesync/.

This features only the relevant options/values for controlling Levoit Core 200S air purifiers, but can be easily adapted for other VeSync purifiers or as an example for other VeSync-compatible devices. You will need to already have a VeSync account and to have added your devices to your account with the VeSync app.

For available command line options run vesync.py -h, and to list all VeSync devices on your account run vesync.py -i

smtctl.sh & smtgui.sh

Some simple shell scripts to control the SMT (simultaneous multithreading) state of a CPU under Linux, intended for use on the Valve Steam Deck. smtctl.sh can be used to enable, disable, or display the status of SMT. smtgui.sh uses KDE's kdialog to produce a popup dialogue for the former, allowing changes without needing to use the console. These allow you to control SMT from a shortcut added to Steam as a non-Steam game, in both desktop mode and SteamOS's game mode, without needing to enter the root password every time. This means you can easily change the SMT status on the fly without needing other third-party tools like Decky loader and the PowerTools plugin.

To install, in desktop mode place both scripts in a folder somewhere inside your home directory, such as /home/deck/scripts, open a console window in that folder and enter chmod 755 smtctl.sh and chmod 755 smtgui.sh to make both scripts executable. You will also need to set a sudo password in the console using passwd if you have not done so already, and replace your_sudo_password in smtctl.sh with this sudo password. You can then add smtgui.sh to Steam by right clicking on it in the Dolphin file manager and selecting the option to add to Steam. I have included some Steam graphics for the shortcut in /assets/steam.

smtgui.sh popup dialog under KDE.

smtctl.sh is also usable in the console, with the options smtctl.sh -h for help/status, and smtctl.sh -s on and smtctl.sh -s off to control SMT.

steamcsspatcher.ps1

A powershell script to remove the What's New, Add Shelf and (optionally) left column from Valve's Steam client. Updated for May 2024 when the css was changed to obfuscate element names. Just straight text substitution, no RegEx, so if the rules are changed at all this script will need to be updated.

If you get an error in powershell saying running scripts is disabled, you can open a powershell session as admin and run this to allow local scripts:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned