mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-22 02:50:15 +10:00
Add custom SSD icon
This commit is contained in:
@@ -186,6 +186,8 @@ class Constants:
|
|||||||
@property
|
@property
|
||||||
def icon_path_sd(self): return self.payload_path / Path("Icon/SD-Card/.VolumeIcon.icns")
|
def icon_path_sd(self): return self.payload_path / Path("Icon/SD-Card/.VolumeIcon.icns")
|
||||||
@property
|
@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")
|
def gui_path(self): return self.payload_path / Path("Icon/Resources.zip")
|
||||||
|
|
||||||
# Apple Paylods Paths
|
# 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())
|
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())
|
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"]
|
sd_type = drive_host_info["MediaName"]
|
||||||
|
try:
|
||||||
|
ssd_type = drive_host_info["SolidState"]
|
||||||
|
except KeyError:
|
||||||
|
ssd_type = False
|
||||||
mount_path = Path(partition_info["MountPoint"])
|
mount_path = Path(partition_info["MountPoint"])
|
||||||
disk_type = partition_info["BusProtocol"]
|
disk_type = partition_info["BusProtocol"]
|
||||||
utilities.cls()
|
utilities.cls()
|
||||||
@@ -611,8 +615,10 @@ Please build OpenCore first!"""
|
|||||||
if sd_type in ["SD Card Reader", "SD/MMC"]:
|
if sd_type in ["SD Card Reader", "SD/MMC"]:
|
||||||
print("- Adding SD Card icon")
|
print("- Adding SD Card icon")
|
||||||
shutil.copy(self.constants.icon_path_sd, mount_path)
|
shutil.copy(self.constants.icon_path_sd, mount_path)
|
||||||
else:
|
elif ssd_type is True:
|
||||||
if disk_type == "USB":
|
print("- Adding SSD icon")
|
||||||
|
shutil.copy(self.constants.icon_path_ssd, mount_path)
|
||||||
|
elif disk_type == "USB":
|
||||||
print("- Adding External USB Drive icon")
|
print("- Adding External USB Drive icon")
|
||||||
shutil.copy(self.constants.icon_path_external, mount_path)
|
shutil.copy(self.constants.icon_path_external, mount_path)
|
||||||
else:
|
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