Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons + Replies for Linux #428

Open
alichtman opened this issue Jan 24, 2023 · 0 comments
Open

Buttons + Replies for Linux #428

alichtman opened this issue Jan 24, 2023 · 0 comments

Comments

@alichtman
Copy link

It seems like it's not currently possible to get replies to notifications on Ubuntu at the moment. It would be awesome if I could! Same for buttons on Linux notifs.

#!/usr/bin/env node

import {execa} from 'execa';
import {Notification} from 'node-notifier';
const jrnl = (...args) => execa("jrnl", args);

(async () => {
    const desiredFrequency = "1 minute"
    const recentEntries = (await jrnl(`-from "${desiredFrequency} ago"`)).stdout;
    if (recentEntries != "") {
        console.log(`jrnl has entries within the last ${desiredFrequency}`);
        return;
    }

    Notification().notify({
        title: "jrnl reminder",
        message: "You haven't added a jrnl entry in a while. Write one now?",
        closeLabel: "Not now",
        reply: true,
        wait: true,
        timeout: 60
    },
        function (err, response, metadata) {
            jrnl(response);
        }
    );
})();

image

Missing reply box, and custom button text.

Example notification with a button:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant