From b28940db625e6f36ae6813c8bc648729c525b5ec Mon Sep 17 00:00:00 2001 From: GorouFlex <98001973+gorouflex@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:43:48 +0700 Subject: [PATCH] ver 0.0.94 --- Changelog.md | 7 ++++ UXTU4Mac/{ => Assets}/ryzenadj | Bin .../DirectHW.kext/Contents/Info.plist | 0 .../DirectHW.kext/Contents/MacOS/DirectHW | Bin .../DirectHW.kext/Contents/PkgInfo | 0 UXTU4Mac/UXTU4Mac.py | 30 +++++++++++++----- 6 files changed, 29 insertions(+), 8 deletions(-) rename UXTU4Mac/{ => Assets}/ryzenadj (100%) rename UXTU4Mac/{Kexts => Kexts ( Placed to OC:Kexts )}/DirectHW.kext/Contents/Info.plist (100%) rename UXTU4Mac/{Kexts => Kexts ( Placed to OC:Kexts )}/DirectHW.kext/Contents/MacOS/DirectHW (100%) rename UXTU4Mac/{Kexts => Kexts ( Placed to OC:Kexts )}/DirectHW.kext/Contents/PkgInfo (100%) diff --git a/Changelog.md b/Changelog.md index 6ddf4fb..2348252 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,10 @@ +## [0.0.94] + +- Bring back some UXTU preset +- Add a `SkipCFU` in config file to skip CFU when start (user customized) +- Adjust some guide + + ## [0.0.93] - Support for Login Items in macOS ( aka Startup App ) diff --git a/UXTU4Mac/ryzenadj b/UXTU4Mac/Assets/ryzenadj similarity index 100% rename from UXTU4Mac/ryzenadj rename to UXTU4Mac/Assets/ryzenadj diff --git a/UXTU4Mac/Kexts/DirectHW.kext/Contents/Info.plist b/UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/Info.plist similarity index 100% rename from UXTU4Mac/Kexts/DirectHW.kext/Contents/Info.plist rename to UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/Info.plist diff --git a/UXTU4Mac/Kexts/DirectHW.kext/Contents/MacOS/DirectHW b/UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/MacOS/DirectHW similarity index 100% rename from UXTU4Mac/Kexts/DirectHW.kext/Contents/MacOS/DirectHW rename to UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/MacOS/DirectHW diff --git a/UXTU4Mac/Kexts/DirectHW.kext/Contents/PkgInfo b/UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/PkgInfo similarity index 100% rename from UXTU4Mac/Kexts/DirectHW.kext/Contents/PkgInfo rename to UXTU4Mac/Kexts ( Placed to OC:Kexts )/DirectHW.kext/Contents/PkgInfo diff --git a/UXTU4Mac/UXTU4Mac.py b/UXTU4Mac/UXTU4Mac.py index ee811d0..ee1a08a 100644 --- a/UXTU4Mac/UXTU4Mac.py +++ b/UXTU4Mac/UXTU4Mac.py @@ -8,14 +8,15 @@ from configparser import ConfigParser PRESETS = { - "Performance": "--tctl-temp=95 --apu-skin-temp=95 --stapm-limit=30000 --fast-limit=34000 --stapm-time=64 --slow-limit=32000 --slow-time=128 --vrm-current=180000 --vrmmax-current=180000 --vrmsoc-current=180000 --vrmsocmax-current=180000 --vrmgfx-current=180000", + "Eco": "--tctl-temp=95 --apu-skin-temp=45 --stapm-limit=6000 --fast-limit=8000 --stapm-time=64 --slow-limit=6000 --slow-time=128 --vrm-current=180000 --vrmmax-current=180000 --vrmsoc-current=180000 --vrmsocmax-current=180000 --vrmgfx-current=180000", + "Performance": "--tctl-temp=95 --apu-skin-temp=95 --stapm-limit=28000 --fast-limit=28000 --stapm-time=64 --slow-limit=28000 --slow-time=128 --vrm-current=180000 --vrmmax-current=180000 --vrmsoc-current=180000 --vrmsocmax-current=180000 --vrmgfx-current=180000 ", "Extreme": "--max-performance", "Auto": "--power-saving" } CONFIG_PATH = 'config.ini' LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Mac/releases/latest" -LOCAL_VERSION = "0.0.93" +LOCAL_VERSION = "0.0.94" def clr_print_logo(): os.system('cls' if os.name == 'nt' else 'clear') @@ -64,11 +65,11 @@ def create_cfg() -> None: print(f"{i}. {mode}") print() - print("We recommend using Auto preset for normal tasks and better power management, and Extreme preset for unlocking full potential performance") - choice = input("Choose your preset power plan by pressing a number followed by the preset: ") + print("We recommend using Auto preset for normal tasks and better power management,\nand Extreme preset for unlocking full potential performance") + choice = input("Choose your preset by pressing a number followed by the preset (1,2,3,4): ") password = getpass.getpass("Enter your login password: ") skip_welcome = input("Do you want to skip the welcome menu? (y/n): ").lower() - start_with_macos = input("Do you want the script to start with macOS? (y/n): ").lower() + start_with_macos = input("Do you want this script to start with macOS? (Login Items) (y/n): ").lower() if start_with_macos == 'y': current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -82,7 +83,8 @@ def create_cfg() -> None: cfg.set('User', 'Mode', preset_name) cfg.set('User', 'Password', password) cfg.set('User', 'SkipWelcome', '1' if skip_welcome == 'y' else '0') - + cfg.set('User', 'SkipCFU', '0') + with open(CONFIG_PATH, 'w') as config_file: cfg.write(config_file) except ValueError: @@ -135,7 +137,7 @@ def run_cmd(args, user_mode): cfg = ConfigParser() cfg.read(CONFIG_PATH) password = cfg.get('User', 'Password', fallback='') - command = ["sudo", "-S", "./ryzenadj"] + args.split() + command = ["sudo", "-S", "Assets/ryzenadj"] + args.split() while True: result = subprocess.run(command, input=password.encode(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) print(result.stdout.decode()) @@ -169,7 +171,19 @@ def open_releases(): ) def main(): - check_updates() + cfg = ConfigParser() + cfg.read(CONFIG_PATH) + try: + if cfg.get('User', 'skipcfu', fallback = '0') == '0': + try: + check_updates() + except: + clr_print_logo() + print("No internet connection, failed to fetch update. Try again") + sys.exit() + except: + create_cfg() + check_cfg_integrity() user_mode = read_cfg()