Login Trigger 🔧

This script is triggered when the user logs in. Starts the timer for the current ultradian cycle.

// Name: Login Trigger
// Description: This script is triggered when the user logs in. Starts the timer for the current ultradian cycle.
// Author: Eduard Uffelmann
// Linkedin: https://www.linkedin.com/in/euffelmann/
// Twitter: @schmedu_
// Website: https://schmedu.com
// System: unlock-screen

import "@johnlindquist/kit";

async function getSystemInfoDb() {
    let database = await db(await kenvPath("db", "system-info.json"), {
        lastLogin: new Date().toString(),
        lastLogout: void 0,
        dates: {},
        currentTasks: [],
        wasShutDown: false,
    });
    return database;
}

let database = await getSystemInfoDb();

database.lastLogin = new Date().toString();
await database.write();

await menu("0m");