Hi. Sorry, I'm not sure I understand. I'm a bit obtuse! Do you mean install Attract Mode on Windows and use the exe for console? Or change the plugin so the case is "Windows" rather than "Linux", remove the line beginning system(" etc?
The "favourites.sh" calls a series of bash scripts that are in my /opt/retropie/configs/all folder. I can confirm that these bash scripts all work to regenerate my Favourites romlist automatically in the background after being invoked by favourites.sh.
Here they are:
The plugin:
// This plugin regenerates the "Favourites.txt" romlist when a game is selected as a favourite or deselected as a favourite
fe.add_transition_callback( "favourites" );
function favourites( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ChangedTag:
system( "sudo /bin/bash /opt/retropie/configs/all/favourites.sh" ); // Starts the Favourites bash script to update the Favourites romlist whenever a game is tagged or untagged
return false;
}}
"favourites.sh":
#!/bin/bash
sudo nohup /opt/retropie/configs/all/favourites1.sh &
"favourites1.sh":
#!/usr/bin/env bash
# Adds a semi-colon at the end of each line of a tag file, so that it decreases the possibility of every game called "1942" (for example) being added to Favourites (eg "1942;" is more limiting than "1942").
sleep 7
cd /home/pi/.attract/romlists
for i in "*.tag"; do
sed -i 's/$/;/' $i
done
sudo nohup /opt/retropie/configs/all/favourites2.sh &
favourites2.sh:
#!/usr/bin/env bash
# The grep command is limited to Fixed Strings eg "1942;".
# The original command for grep was: cat "${romlist}.txt"|grep -F -w "${gamename}" >> Favorites.txt
# But the "whole word" option -w would not pick up any game with a semi-colon at the end eg it would pick up "1942" but would not pick up "1942;"
# The next command I used was: cat "${romlist}.txt"|grep -F "${gamename}" >> Favorites.txt. With the semi-colon added, this would ensure that the name of the game was treated as a Fixed String. It would not capture every single 1942, only those ending with the semi-colon. However, not only would it capture "mario", it would capture "drmario" ie words with other letters at the front. In order to avoid this, I had to use the following:
# cat "${romlist}.txt"|grep "\<${gamename}" >> Favorites.txt. Together with placing the semi-colon at the end, the \< meant that it would ignore games where there were letters at the beginning eg drmario.
# The Favorities.tag file is renamed so that it is not included in the creation of the new Favorites romlist.
cd /home/pi/.attract/romlists
# rm -f Favorites.tag
mv -f Favorites.tag Favorites.tag.backup
mv -f Favorites.txt Favorites.txt.backup
ls *.tag > tagfiles
while read filename
do
while read gamename
do
romlist=`echo ${filename} |cut -f 1 -d '.'`
cat "${romlist}.txt"|grep "\<${gamename}" >> Favorites.txt
done < "${filename}"
done < tagfiles
rm -f tagfiles
sort Favorites.txt > Favorites1.txt
rm -f Favorites.txt
mv -f Favorites1.txt Favorites.txt
sort Favorites.txt | uniq >> Favorites1.txt
rm -f Favorites.txt
mv -f Favorites1.txt Favorites.txt
sudo nohup /opt/retropie/configs/all/favourites3.sh &
favourites3.sh:
#!/usr/bin/env bash
# Removes the trailing semi-colon at the end of all tag files so the tag files go back to "normal".
cd /home/pi/.attract/romlists
for i in "*.tag"; do
sed -i 's/;*$//g' $i
done
sudo nohup /opt/retropie/configs/all/favourites4.sh &
favourites4.sh:
#!/usr/bin/env bash
# Changes ownership of Favorites.txt to pi and makes it read and write compatible by anyone.
sudo chown pi:pi /home/pi/attract/romlists/Favorites.txt
sudo chmod 0777 /home/pi/attract/romlists/Favorites.txt
sudo nohup /opt/retropie/configs/all/favourites5.sh &
favourites5.sh:
#!/usr/bin/env bash
# Copies the first field (ie the name of each game) from the new Favorites.txt and creates a Favorites.tag with it and ensures that only one copy of the game appears in the tags.
# Changes ownership of Favorites.tag to pi and makes it read and write compatible by anyone.
cd /home/pi/.attract/romlists
# cut -f 1 -d '.' Favorites.txt > Favorites.tag
sudo awk -F';' '{print $1}' Favorites.txt > Favorites.tag
sort Favorites.tag | uniq >> Favorites1.tag
rm -f Favorites.tag
mv -f Favorites1.tag Favorites.tag
sudo chown pi:pi /home/pi/attract/romlists/Favorites.tag
sudo chmod 0777 /home/pi/attract/romlists/Favorites.tag
# sudo nohup /opt/retropie/configs/all/favourites6.sh
Also, I'm just wondering whether your debug plugin could be used to send output to a file rather than to the console. I'm using ssh from my Windows PC so it would pretty easy to check what the output error was if errors were redirected to a file.