Skip to content

Commit

Permalink
fix: update layout for schedule card and add advanced settings suppor…
Browse files Browse the repository at this point in the history
…t for scheduled tasks
  • Loading branch information
hichemfantar committed Nov 18, 2024
1 parent 4d903ec commit 82c1dd1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/frontend/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,14 @@ export function App() {

<Card className="mt-8 bg-gray-600/20 xborder-none">
<CardHeader>
<div className={cn("flex items-center justify-between")}>
<div
className={cn("flex items-center justify-between flex-wrap")}
>
<div className={cn("flex flex-col space-y-1.5")}>
<CardTitle>Schedule</CardTitle>
<CardDescription>Manage your schedule here.</CardDescription>
</div>
<div className="justify-end flex gap-2">
<div className="justify-end flex gap-2 flex-wrap">
{getOsQuery.data === "win32" && (
<Tooltip>
<TooltipTrigger asChild>
Expand Down
25 changes: 25 additions & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,31 @@ const createTask = async ({

try {
await execAsync(schtasksCommand);
// TODO: Add support for more advanced settings
await execAsync(
`$task = Get-ScheduledTask -TaskName "${taskName}"; $task.Settings.WakeToRun = $True; $task.Settings.DisallowStartIfOnBatteries = $False; $task.Settings.StopIfGoingOnBatteries = $False; $task | Set-ScheduledTask`,
{
shell: "powershell.exe",
}
);
// await execAsync(
// `$task = Get-ScheduledTask -TaskName "${taskName}"; $task.Settings.WakeToRun = $True; $task | Set-ScheduledTask`,
// {
// shell: "powershell.exe",
// }
// );
// await execAsync(
// `$task = Get-ScheduledTask -TaskName "${taskName}"; $task.Settings.DisallowStartIfOnBatteries = $False; $task | Set-ScheduledTask`,
// {
// shell: "powershell.exe",
// }
// );
// await execAsync(
// `$task = Get-ScheduledTask -TaskName "${taskName}"; $task.Settings.StopIfGoingOnBatteries = $False; $task | Set-ScheduledTask`,
// {
// shell: "powershell.exe",
// }
// );
console.log(
`${action} timer set for ${scheduledTime} ${windowsScheduledDate}`
);
Expand Down

0 comments on commit 82c1dd1

Please sign in to comment.