mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 11:30:15 +10:00
Add custom SSD icon
This commit is contained in:
@@ -186,6 +186,8 @@ class Constants:
|
||||
@property
|
||||
def icon_path_sd(self): return self.payload_path / Path("Icon/SD-Card/.VolumeIcon.icns")
|
||||
@property
|
||||
def icon_path_ssd(self): return self.payload_path / Path("Icon/SSD/.VolumeIcon.icns")
|
||||
@property
|
||||
def gui_path(self): return self.payload_path / Path("Icon/Resources.zip")
|
||||
|
||||
# Apple Paylods Paths
|
||||
|
||||
@@ -591,6 +591,10 @@ Please build OpenCore first!"""
|
||||
drive_host_info = plistlib.loads(subprocess.run(f"diskutil info -plist {disk_identifier}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||
partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {disk_identifier}s{response}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||
sd_type = drive_host_info["MediaName"]
|
||||
try:
|
||||
ssd_type = drive_host_info["SolidState"]
|
||||
except KeyError:
|
||||
ssd_type = False
|
||||
mount_path = Path(partition_info["MountPoint"])
|
||||
disk_type = partition_info["BusProtocol"]
|
||||
utilities.cls()
|
||||
@@ -611,8 +615,10 @@ Please build OpenCore first!"""
|
||||
if sd_type in ["SD Card Reader", "SD/MMC"]:
|
||||
print("- Adding SD Card icon")
|
||||
shutil.copy(self.constants.icon_path_sd, mount_path)
|
||||
else:
|
||||
if disk_type == "USB":
|
||||
elif ssd_type is True:
|
||||
print("- Adding SSD icon")
|
||||
shutil.copy(self.constants.icon_path_ssd, mount_path)
|
||||
elif disk_type == "USB":
|
||||
print("- Adding External USB Drive icon")
|
||||
shutil.copy(self.constants.icon_path_external, mount_path)
|
||||
else:
|
||||
|
||||
BIN
images/OC-Picker-SSD.png
Normal file
BIN
images/OC-Picker-SSD.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
payloads/Icon/SSD/.VolumeIcon.icns
Normal file
BIN
payloads/Icon/SSD/.VolumeIcon.icns
Normal file
Binary file not shown.
Reference in New Issue
Block a user