Set simple one-shot reminders and texts with an easy, approachable CLI with notifications on all your devices
-
Dead simple - all of 130 lines in a single script file
-
No server process to run. Uses
atd
daemon and most likely that’s already running -
Telegram clients are available for pretty much every platform
-
Handles fuzzy, human friendly dates and times (like
friday after next
); Handles timezone conversions as well (so9AM EST
)- But my machine isn’t ONLINE 24x7
-
Install it on a server and with password-less ssh and setup a shell script or alias to execute
hey
on the server.
# clone the repo
# cd into the folder
./install.sh
# check if at daemon is enabled & running
sudo systemctl status atd
# Enable and start it if needed.
sudo systemctl enable atd
sudo systemctl start atd
That’s about it for installation You’ll need to configure a telegram bot before you can get started. See the section below
- Create a telegram BOT
-
-
Create a telegram bot and send it a message
-
search for BotFather
-
type
/newbot
-
give it a friendly name and a bot name (bot name must end in _bot)
-
Pick up the bot token from botfather.
-
-
Get a chat id
-
Telegram global search, type your bot name or id
-
type
/start
-
send any text.
-
Run
curl https://api.telegram.org/bot$TOKEN/getUpdates
{ "ok": true, "result": [ { "update_id": 519260759, "message": { "message_id": 2, "from": { "id": 535955002, "is_bot": false, }, "chat": { "id": 123456789, //(1) "type": "private" }, "date": 1567922393, "text": "hello" } } ] }
-
-
Update the
config
file in the folder with the bot token and chat id
-
In case you run this on a server that’s on UTC (As with most cloud providers),
then set the TIMEZONE=<Tz code>
to set the timezone of the client machine.
NOTE Once again, this isn’t the server timezone. If your client and server are in the same timezone, then DO NOT specify the timezone (key should not present)
NOTE 2: Timezone code is one of TZ database names, like so - TIMEZONE=Asia/Kolkata
see TZ Database
Files are read in the following sequence, later files override earlier entries defined in earlier ones.
. Alongside hey.py
, named as config
. /etc/hey.conf
. ~/.config/hey.conf
> hey.py /t 10 AM Friday /m Get a hair cut
# My local timezone is India (IST, 0530), hey is on a server on UTC
# and you can have tz info in the string - say some office opens at 9 AM EST
> hey.py -t 9 AM EST -m call customer support
reminder 'call customer support' set for 10:30 PM 2019-10-16
Note
|
arg parsing is basic and does not follow typical shell parsing conventions.
First arg has to be /t and then it scans forward till a /m . The gathered string is
parsed to a date. Anything after the /m is just concatenated to the message.
|