poetaman / arttime

arttime is a CLI application that blends beauty of ASCII / text art with functionality of clock / timer / pattern-based time manager in terminal ⏰
Other
968 stars 15 forks source link

Feature request: Adding custom message to desktop notification #54

Open bjornasm opened 1 year ago

bjornasm commented 1 year ago

This is possibly linked to https://github.com/poetaman/arttime/issues/36 - but it would be nice to add a custom message to be displayed on the desktop notification. Say if you have a timer to remember to take a walk and drink a glass of water every other hour in between other types of timers it would be nice to have a specific textual reminder for that. I can have a quick look on the source to see if this is something I am able to contribute to.

poetaman commented 1 year ago

@bjornasm Yes it is linked to #36. There is a plan for users to be able to specify their timers in more expressive ways, though I don't see it happening anytime soon. There is a workaround one can use for now: arttime's notification does show the name of art. A user can open multiple instances of arttime, and have different timers or time manager programs in each. If the displayed art in each instances is different, they would be able to get the context of notification.

Check for example the "keypoem" file share/arttime/keypoems/timer.banana10learn_8b below.

----
m2 bananas every hour for next 10 hours = 2000 calorie banana diet!
--------
abanana
--------
g1h;loop10
--------
mYou will get 10 notifications, though don't follow this diet :)

It can be loaded from command line like this: arttime -k timer.banana10learn_8b or from within running arttime instance by pressing k followed by Tab/arrow-keys based navigation followed by Enter.

The good part is you can create as many such "keypoems" and save them in the same or different directory. The syntax is the same as the keystrokes one would type in arttime's interface to get an effect. Essentially arttime interprets contents of the file as if each key were pressed (with couple differences). abanana followed by new line changes the art to banana. Art names refer to file names under directory share/arttime/textart. One can easily add a file for "water" or "glass" and save a timer.drinkwater_8b keypoem like this (_8b just slows down the read rate to 8 bytes per second for a visual effect, one can remove it):

----
mwater is essential for life, drink it! 
--------
awater
--------
g2h;loop10

Supporting info: https://github.com/poetaman/arttime/wiki

Here's the GIF that shows timer.banana10learn_8b in action, arttime does the "typing" for you like a ghost:

bananatimer

poetaman commented 1 year ago

@bjornasm Btw... As getting notifications to drink water would be so common, I went ahead and added basic water ASCII art and a keypoem. To give it a try, pull and install the main branch again... Then either launch arttime to load the program at launch time: arttime -k timer.drinkwater_8b or after launching arttime press k followed by Tab/arrow-keys to navigate, and Enter to run the keypoem script.

bjornasm commented 1 year ago

Thank you for your extremely thorough reply as well as this added feature @poetaman !