Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Source/RebootButtonController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ -(void)reboot
}
else
{
pid_t pid;
int status;
const char* args[] = {"mobileldrestart", NULL};
posix_spawn(&pid, "/usr/bin/mobileldrestart", NULL, NULL, (char* const*)args, NULL);
waitpid(pid, &status, WEXITED);
if ([[prefsDict objectForKey:@"rebootAction"] isEqualToString:@"userspace"])
{
pid_t pid;
int status;
const char* args[] = {"launchctl", "reboot", "userspace", NULL};
posix_spawn(&pid, "/bin/launchctl", NULL, NULL, (char* const*)args, NULL);
waitpid(pid, &status, WEXITED);
} else {
pid_t pid;
int status;
const char* args[] = {"mobileldrestart", NULL};
posix_spawn(&pid, "/usr/bin/mobileldrestart", NULL, NULL, (char* const*)args, NULL);
waitpid(pid, &status, WEXITED);
}
}
}
@end
41 changes: 20 additions & 21 deletions Source/powermoduleprefs/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@
<dict>
<key>cell</key>
<string>PSSegmentCell</string>
<key>default</key>
<string>2x2</string>
<key>defaults</key>
<string>com.muirey03.powermoduleprefs</string>
<key>key</key>
<string>moduleSize</string>
<key>validValues</key>
<key>validTitles</key>
<array>
<string>1x1</string>
<string>2x2</string>
</array>
<key>validTitles</key>
<key>validValues</key>
<array>
<string>1x1</string>
<string>2x2</string>
</array>
<key>default</key>
<string>2x2</string>
<key>defaults</key>
<string>com.muirey03.powermoduleprefs</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
Expand All @@ -40,24 +39,25 @@
<dict>
<key>cell</key>
<string>PSSegmentCell</string>
<key>default</key>
<string>userspace</string>
<key>defaults</key>
<string>com.muirey03.powermoduleprefs</string>
<key>key</key>
<string>rebootAction</string>
<key>validValues</key>
<key>validTitles</key>
<array>
<string>reboot</string>
<string>Reboot</string>
<string>ldrestart</string>
<string>Userspace</string>
</array>
<key>validTitles</key>
<key>validValues</key>
<array>
<string>Reboot</string>
<string>reboot</string>
<string>ldrestart</string>
<string>userspace</string>
</array>
<key>default</key>
<string>ldrestart</string>
<key>defaults</key>
<string>com.muirey03.powermoduleprefs</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
Expand Down Expand Up @@ -136,18 +136,17 @@
<key>label</key>
<string>Power down confirmation</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Created By:</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>action</key>
<string>creatorMethod</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Muirey03 (@Muirey03)</string>
</dict>
Expand All @@ -158,10 +157,10 @@
<string>Icons Created By:</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>action</key>
<string>creditsMethod</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Macs (u/thecoderkiller)</string>
</dict>
Expand Down