Skip to content

Commit d0047bc

Browse files
committed
add launchpad command actions
1 parent ec4e238 commit d0047bc

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

oclp_r/sys_patch/patchsets/hardware/misc/Launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def _modern_audio_patches(self) -> dict:
6666
},
6767
"/System/Applications": {
6868
"Apps.app": f"{self._constants.launchpad_version}",
69+
"Launchpad.app": f"{self._constants.launchpad_version}" if f"{self._constants.launchpad_version}" != f"26.0 Beta 4" else {},
6970
},
7071
},
7172
},

oclp_r/sys_patch/sys_patch.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ def _merge_kdk_with_root(self, save_hid_cs: bool = False) -> None:
179179
self.mount_location,
180180
self.skip_root_kmutil_requirement
181181
).merge(save_hid_cs)
182-
183-
182+
def clean_launchpad(self) -> None:
183+
logging.info("- Cleaning LaunchPad Settings")
184+
subprocess.run(["mkdir", "-p", "/Library/Preferences/FeatureFlags/Domain"],capture_output=True,text=True)
185+
subprocess.run(["defaults", "write", "/Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist", "SpotlightPlus", "-dict", "Enabled", "-bool", "false"],capture_output=True,text=True)
184186
def _unpatch_root_vol(self):
185187
"""
186188
Reverts APFS snapshot and cleans up any changes made to the root and data volume
@@ -191,6 +193,7 @@ def _unpatch_root_vol(self):
191193

192194
self._clean_skylight_plugins()
193195
self._delete_nonmetal_enforcement()
196+
self.clean_launchpad()
194197
kernelcache.KernelCacheSupport(
195198
mount_location_data=self.mount_location_data,
196199
detected_os=self.constants.detected_os,
@@ -554,7 +557,14 @@ def start_patch(self):
554557
if self.patch_set_dictionary == {}:
555558
logging.info("- No Root Patches required for your machine!")
556559
return
557-
560+
if self.constants.change_launchpad is True:
561+
logging.info("- LaunchPad patching enabled, run command......")
562+
subprocess.run(["mkdir", "-p", "/Library/Preferences/FeatureFlags/Domain"],capture_output=True,text=True)
563+
subprocess.run(["defaults", "write", "/Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist", "SpotlightPlus", "-dict", "Enabled", "-bool", "false"])
564+
else:
565+
logging.info("- LaunchPad patching disabled,skip......")
566+
subprocess.run(["mkdir", "-p", "/Library/Preferences/FeatureFlags/Domain"],capture_output=True,text=True)
567+
subprocess.run(["defaults", "write", "/Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist", "SpotlightPlus", "-dict", "Enabled", "-bool", "true"])
558568
logging.info("- Verifying whether Root Patching possible")
559569
if patchset_obj.can_patch is False:
560570
logging.error("- Cannot continue with patching!!!")

oclp_r/wx_gui/gui_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
5050

5151
self.settings = self._settings()
5252

53-
self.frame_modal = wx.Dialog(parent, title=title, size=(600, 685))
53+
self.frame_modal = wx.Dialog(parent, title=title, size=(600, 720))
5454

5555
self._generate_elements(self.frame_modal)
5656
self.frame_modal.ShowWindowModal()

oclp_r/wx_gui/gui_sys_patch_start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def revert_root_patching(self):
354354

355355
self._generate_modal(self.patches, "Revert Root Patches")
356356
self.return_button.Disable()
357-
357+
358358
thread = threading.Thread(target=self._revert_root_patching, args=(self.patches,))
359359
thread.start()
360360

0 commit comments

Comments
 (0)