/* * Change the skin of a screen in env:mui/screens.txt * by Thomas Igracki * * The change will take effect immediatly, if you want it to be permanently (after reboot), * just remove the command around the last "Copy" command, then it will be copied * to envarc: too! * * Usage: rx ChangeSkin.rexx * * Example: rx ChangeSkin.rexx Ambient Nox * * 31-Jan-2019: v1.0 */ OPTIONS RESULTS PARSE ARG Screen" "newSkin IF Screen = "" | newSkin = "" THEN Say "Usage: rx ChangeSkin.rexx " ELSE; DO IF ~EXISTS("MOSSYS:Prefs/Skins/"newSkin) & ~EXISTS("SYS:Prefs/Skins/"newSkin) THEN Say "The skin '"newSkin"' didn't exists!" ELSE; DO IF Open(fhIn, "env:mui/screens.txt", "R") THEN; DO IF Open(fhOut, "t:new_screens.txt", "W") THEN; DO found = 0 DO UNTIL EOF(fhIn) line = ReadLn(fhIn); PARSE VAR line "N="scr" "dummy" S="skin" "dummy2 IF scr = Screen THEN; DO found = 1 line = "N="scr" "dummy" S="newSkin" "dummy2 oldSkin = skin END WriteLn(fhOut, line) END Close(fhIn) Close(fhOut) IF found=0 THEN Say "Didn't found the screen '"Screen"'!" ELSE; DO Say "Found the screen '"Screen"'!" Say "Changed the skin from '"oldSkin"' to '"newSkin"'." SHELL COMMAND "Copy t:new_screens.txt env:mui/screens.txt" SHELL COMMAND "Delete >NIL t:new_screens.txt" /* remove these comment if you want to save the new screens! SHELL COMMAND "Copy env:mui/screens.txt envarc:mui/screens.txt" */ END END END END END