Skip to content

Buttons + Replies for Linux #428

Description

@alichtman

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions