sindresorhus / one-thing Goto Github PK
View Code? Open in Web Editor NEWSet the text for the One Thing app
Home Page: https://sindresorhus.com/one-thing
License: MIT License
Set the text for the One Thing app
Home Page: https://sindresorhus.com/one-thing
License: MIT License
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
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
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.
I would love it so much to be able to modify this a little to work perfectly for my workflow.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.