GithubHelp home page GithubHelp logo

sindresorhus / one-thing Goto Github PK

View Code? Open in Web Editor NEW
134.0 4.0 3.0 27 KB

Set the text for the One Thing app

Home Page: https://sindresorhus.com/one-thing

License: MIT License

JavaScript 100.00%
macos nodejs npm-package cli-app command-line-tool one-thing

one-thing's Issues

Error: Command failed: open --background one-thing:?text=Prepare%20for%20important%20meeting

one-thing 'Prepare for important meeting'

Error: Command failed: open --background one-thing:?text=Prepare%20for%20important%20meeting
No application knows how to open URL one-thing:?text=Prepare%20for%20important%20meeting (Error Domain=NSOSStatusErrorDomain Code=-10814 "kLSApplicationNotFoundErr: E.g. no application claims the file" UserInfo={_LSLine=1489, _LSFunction=runEvaluator}).

at ChildProcess.exithandler (node:child_process:397:12)

=========
nodejs v16.13.2
macbook

Unicode escape sequences not correctly displayed in terminal output for `one-thing --get` command

Actual text is "๐Ÿ Finish dark mode"

$: one-thing --get
\ud83d\udc1d Finish **dark** mode

When running the command one-thing --get from the macos terminal, the output containing Unicode characters, such as emojis, is incorrectly encoded as Unicode escape sequences (e.g., \ud83d\udc1d). This leads to the display of escape sequences instead of the actual characters. The issue can be resolved by manually converting the escape sequences to their corresponding characters. I have resolved the issue by making the following modification to the return statement in index.js:

return stdout.trim().replace(/\\u([\dA-F]{4})/gi, (_, p1) => String.fromCodePoint(parseInt(p1, 16)));
$: one-thing --get
๐Ÿ Finish **dark** mode

`open --background` still causes frontmost app to lose focus

Thanks for One Thing! ๐ŸŒˆ ๐Ÿฆ„

Small issue, but when using the URI scheme to set a message

open --background "one-thing:?text=Foo%20Bar"

The frontmost app will lose focus. I have some scripts that set messages using this method and it causes minor frustration when I am e.g. typing in Sublime Text and I have to reach for the mouse to bring it back to the front.

The Node CLI does not have this problem, so I switched to that for now, but the URI scheme is "easier"

edit: actually, the node cli does have the same gotcha.

ENOENT error

Hi there,

Here is the output from my git bash on Windows 10 x64 Node 14.17.3 :

$ npm install --global one-thing
C:\Users\Me\Apps\NodeJs14\one-thing -> C:\Users\Me\Apps\NodeJs14\node_modules\one-thing\cli.js
+ [email protected]
added 61 packages from 46 contributors in 18.173s

$ one-thing 'Meet John Doe for a coffee'
Error: spawn open ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Any idea ?

It says in the readme Require node 12, is it only node 12 or node 12 minimum ?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.