Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gorouflex committed Apr 13, 2024
1 parent 1fe5064 commit d4e45ad
Show file tree
Hide file tree
Showing 32 changed files with 50 additions and 46 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@ jobs:
- name: Make file executable
run: |
chmod +x UXTU4Mac/Assets/ryzenadj
chmod +x UXTU4Mac/UXTU4Mac.command
chmod +x UXTU4Linux/Assets/ryzenadj
- name: Zip folder
chmod +x macOS/Assets/ryzenadj
chmod +x macOS/UXTU4Unix.command
chmod +x Linux/Assets/ryzenadj
- name: Rename and Zip folders
run: |
zip -r UXTU4Mac.zip UXTU4Mac
zip -r UXTU4Linux.zip UXTU4Linux
env:
TAG: ${{ env.TAG }}
mv macOS UXTU4Unix
zip -r macOS.zip UXTU4Unix
rm -rf UXTU4Unix
mv Linux UXTU4Unix
zip -r Linux.zip UXTU4Unix
rm -rf UXTU4Unix
env:
TAG: ${{ env.TAG }}
- id: generate-notes
name: Generate Release Notes
Expand All @@ -44,6 +49,6 @@ jobs:
name: v${{ env.TAG }}
tag_name: ${{ env.TAG }}
body_path: ${{ github.workspace }}-RELEASE_NOTES.txt
files: UXTU4Mac.zip, UXTU4Linux.zip
files: macOS.zip, Linux.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions UXTU4Linux/Assets/SU.py → Linux/Assets/SU.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import os, urllib.request, zipfile, shutil, subprocess

def update():
url = "https://github.com/AppleOSX/UXTU4Unix/releases/latest/download/UXTU4Linux.zip"
url = "https://github.com/AppleOSX/UXTU4Unix/releases/latest/download/Linux.zip"
script_dir = os.path.dirname(os.path.realpath(__file__))
current_dir = os.path.dirname(os.path.dirname(script_dir))
current_folder = os.path.join(current_dir, "UXTU4Linux")
new_folder = os.path.join(current_dir, "UXTU4Linux_new")
current_folder = os.path.join(current_dir, "UXTU4Unix")
new_folder = os.path.join(current_dir, "UXTU4Unix_new")
config_file = os.path.join(current_folder, "Assets", "config.ini")
backup_config = os.path.join(current_dir, "config.ini.bak")
zip_file_path = os.path.join(current_dir, "UXTU4Linux.zip")
zip_file_path = os.path.join(current_dir, "Linux.zip")
try:
if os.path.exists(config_file):
shutil.copy2(config_file, backup_config)
urllib.request.urlretrieve(url, zip_file_path)
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(new_folder)
shutil.rmtree(current_folder)
inner_folder = os.path.join(new_folder, "UXTU4Linux")
inner_folder = os.path.join(new_folder, "UXTU4Unix")
shutil.move(inner_folder, current_dir)
shutil.rmtree(new_folder)
command_file_path = os.path.join(current_dir, "UXTU4Linux", "UXTU4Linux.py")
ryzenadj_path = os.path.join(current_dir, "UXTU4Linux", "Assets", "ryzenadj")
command_file_path = os.path.join(current_dir, "UXTU4Unix", "UXTU4Unix.py")
ryzenadj_path = os.path.join(current_dir, "UXTU4Unix", "Assets", "ryzenadj")
subprocess.run(['chmod', '+x', ryzenadj_path], check=True)
if os.path.exists(backup_config):
shutil.move(backup_config, config_file)
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions UXTU4Linux/UXTU4Linux.py → Linux/UXTU4Unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from configparser import ConfigParser

LOCAL_VERSION = "0.2.8"
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Mac/releases/latest"
GITHUB_API_URL = "https://api.github.com/repos/AppleOSX/UXTU4Mac/releases/latest"
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Unix/releases/latest"
GITHUB_API_URL = "https://api.github.com/repos/AppleOSX/UXTU4Unix/releases/latest"
cpu_codename = ["Raven Ridge", "Dali", "Picasso", "Massite", "Renoir", "Lucienne", "Van Gogh", "Mendocino", "Cezanne", "Barcelo", "Barcelo-R", "Rembrandt", "Rembrandt-R", "Dragon Range", "Phoenix", "Hawk Point"]
os.makedirs('Logs', exist_ok=True)
logging.basicConfig(filename='Logs/UXTU4Mac.log', filemode='w', encoding='utf-8',
logging.basicConfig(filename='Logs/UXTU4Unix.log', filemode='w', encoding='utf-8',
level=logging.INFO, format='%(levelname)s %(asctime)s %(message)s',
datefmt='%d/%m/%Y %H:%M:%S')
logging.getLogger().addHandler(logging.StreamHandler())
Expand Down Expand Up @@ -107,8 +107,8 @@ def welcome_tutorial():
if not cfg.has_section('Settings'):
cfg.add_section('Settings')
clear()
logging.info("--------------- Welcome to UXTU4Mac ---------------")
logging.info("Designed for AMD Zen-based processors on macOS")
logging.info("--------------- Welcome to UXTU4Unix ---------------")
logging.info("Designed for AMD Zen-based processors on macOS/Linux")
logging.info("Based on RyzenAdj and inspired by UXTU")
logging.info("Let's get started with some initial setup ~~~")
input("Press Enter to continue...")
Expand Down Expand Up @@ -405,7 +405,7 @@ def get_changelog():
def updater():
clear()
changelog = get_changelog()
logging.info("--------------- UXTU4Mac Software Update ---------------")
logging.info("--------------- UXTU4Unix Software Update ---------------")
logging.info("A new update is available!")
logging.info(
f"Changelog for the latest version ({get_latest_ver()}):\n{changelog}"
Expand Down Expand Up @@ -445,14 +445,14 @@ def check_updates():

def about():
options = {
"1": lambda: webbrowser.open("https://www.github.com/AppleOSX/UXTU4Mac"),
"1": lambda: webbrowser.open("https://www.github.com/AppleOSX/UXTU4Unix"),
"f": updater,
"b": "break"
}
while True:
clear()
logging.info("About UXTU4Unix")
logging.info("The Unix Update (2MACSLOVELINUX)")
logging.info("The Unix Update (2MACLOVELINUX)")
logging.info("----------------------------")
logging.info("Maintainer: GorouFlex\nCLI: GorouFlex")
logging.info("GUI: NotchApple1703\nAdvisor: NotchApple1703")
Expand Down Expand Up @@ -614,11 +614,11 @@ def main():
"1": preset_menu,
"2": settings,
"a": about,
"q": lambda: sys.exit("\nThanks for using UXTU4Mac\nHave a nice day!"),
"q": lambda: sys.exit("\nThanks for using UXTU4Unix\nHave a nice day!"),
}
logging.info("1. Apply power management settings\n2. Settings")
logging.info("")
logging.info("A. About UXTU4Mac")
logging.info("A. About UXTU4Unix")
logging.info("Q. Quit")
choice = input("Option: ").lower().strip()
if action := options.get(choice):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions UXTU4Mac/Assets/SU.py → macOS/Assets/SU.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import os, urllib.request, zipfile, shutil, subprocess

def update():
url = "https://github.com/AppleOSX/UXTU4Mac/releases/latest/download/UXTU4Mac.zip"
url = "https://github.com/AppleOSX/UXTU4Unix/releases/latest/download/macOS.zip"
script_dir = os.path.dirname(os.path.realpath(__file__))
current_dir = os.path.dirname(os.path.dirname(script_dir))
current_folder = os.path.join(current_dir, "UXTU4Mac")
new_folder = os.path.join(current_dir, "UXTU4Mac_new")
current_folder = os.path.join(current_dir, "UXTU4Unix")
new_folder = os.path.join(current_dir, "UXTU4Unix_new")
config_file = os.path.join(current_folder, "Assets", "config.ini")
backup_config = os.path.join(current_dir, "config.ini.bak")
zip_file_path = os.path.join(current_dir, "UXTU4Mac.zip")
zip_file_path = os.path.join(current_dir, "macOS.zip")
try:
if os.path.exists(config_file):
shutil.copy2(config_file, backup_config)
urllib.request.urlretrieve(url, zip_file_path)
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(new_folder)
shutil.rmtree(current_folder)
inner_folder = os.path.join(new_folder, "UXTU4Mac")
inner_folder = os.path.join(new_folder, "UXTU4Unix")
shutil.move(inner_folder, current_dir)
shutil.rmtree(new_folder)
command_file_path = os.path.join(current_dir, "UXTU4Mac", "UXTU4Mac.command")
ryzenadj_path = os.path.join(current_dir, "UXTU4Mac", "Assets", "ryzenadj")
command_file_path = os.path.join(current_dir, "UXTU4Unix", "UXTU4Unix.command")
ryzenadj_path = os.path.join(current_dir, "UXTU4Unix", "Assets", "ryzenadj")
subprocess.run(['chmod', '+x', command_file_path], check=True)
subprocess.run(['chmod', '+x', ryzenadj_path], check=True)
if os.path.exists(backup_config):
Expand Down
File renamed without changes.
File renamed without changes.
23 changes: 11 additions & 12 deletions UXTU4Mac/UXTU4Mac.py → macOS/UXTU4Unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

LOCAL_VERSION = "0.2.7"
CONFIG_PATH = 'Assets/config.ini'
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Mac/releases/latest"
GITHUB_API_URL = "https://api.github.com/repos/AppleOSX/UXTU4Mac/releases/latest"
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Unix/releases/latest"
GITHUB_API_URL = "https://api.github.com/repos/AppleOSX/UXTU4Unix/releases/latest"
cpu_codename = ["Raven Ridge", "Dali", "Picasso", "Massite", "Renoir", "Lucienne", "Van Gogh", "Mendocino", "Cezanne", "Barcelo", "Barcelo-R", "Rembrandt", "Rembrandt-R", "Dragon Range", "Phoenix", "Hawk Point"]
os.makedirs('Logs', exist_ok=True)
logging.basicConfig(filename='Logs/UXTU4Mac.log', filemode='w', encoding='utf-8',
logging.basicConfig(filename='Logs/UXTU4Unixlog', filemode='w', encoding='utf-8',
level=logging.INFO, format='%(levelname)s %(asctime)s %(message)s',
datefmt='%d/%m/%Y %H:%M:%S')
logging.getLogger().addHandler(logging.StreamHandler())
Expand All @@ -21,18 +21,17 @@
def clear():
subprocess.call('clear', shell=True)
logging.info(r"""
__ ___ __________ ______ __ ___
/ / / / |/_/_ __/ / / / / // |/ /__ _____
/ /_/ /> < / / / /_/ /_ _/ /|_/ / _ `/ __/
\____/_/|_| /_/ \____/ /_//_/ /_/\_,_/\__/ """)
_ ___ _______ _ _ _ _ _ _ _
| | | \ \/ /_ _| | | | | || | | |_ _ (_)_ __
| |_| |> < | | | |_| |_ _| |_| | ' \| \ \ /
\___//_/\_\ |_| \___/ |_| \___/|_||_|_/_\_\ """)
logging.info("")
logging.info(
f' {get_hardware_info("sysctl -n machdep.cpu.brand_string")}'
)
#logging.info(f' {get_hardware_info("system_profiler SPDisplaysDataType | grep 'Chipset Model' | cut -d ':' -f2")}')
if cfg.get('Settings', 'Debug', fallback='0') == '1':
logging.info(f" Loaded: {cfg.get('User', 'Preset',fallback = '')}")
logging.info(f" Version: {LOCAL_VERSION} by GorouFlex and AppleOSX")
logging.info(f" Version: {LOCAL_VERSION} by GorouFlex and AppleOSX (macOS Edition)")
logging.info("")

def get_hardware_info(command, use_sudo=False):
Expand Down Expand Up @@ -635,14 +634,14 @@ def check_updates():

def about():
options = {
"1": lambda: webbrowser.open("https://www.github.com/AppleOSX/UXTU4Mac"),
"1": lambda: webbrowser.open("https://www.github.com/AppleOSX/UXTU4Unix"),
"f": updater,
"b": "break"
}
while True:
clear()
logging.info("About UXTU4Mac")
logging.info("The Dynamic Update (2WORLDSCLI)")
logging.info("About UXTU4Unix")
logging.info("The Unix Update (2MACLOVELINUX)")
logging.info("----------------------------")
logging.info("Maintainer: GorouFlex\nCLI: GorouFlex")
logging.info("GUI: NotchApple1703\nAdvisor: NotchApple1703")
Expand Down

0 comments on commit d4e45ad

Please sign in to comment.