dietpi-notify

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

dietpi-notify

Post by johnvick »

I saw this in the update to v 123 - how does it work?

Using dietpi-notify on the command line does nothing?

John
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: dietpi-notify

Post by k-plan »

Hi John,

if I understand aright, it is more a function or subroutine so DietPi scripts can use it.

https://github.com/Fourdee/DietPi/blob/ ... tpi-notify

or

Code: Select all

cat /DietPi/dietpi/func/dietpi-notify
But it is not implement in a lot of scripts at the moment.
DietPi-Notify | New program with a goal to display more information on what DietPi is doing, and, if a failure or success occured. I will continue to improve this and add it to all DietPi scripts/programs over time.
But surely Fourdee can explain it better and in more details.

If I remember correctly, the idea is set up here: https://github.com/Fourdee/DietPi/issue ... -230155366

cu
k-plan
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: dietpi-notify

Post by Fourdee »

k-plan wrote:Hi John,

if I understand aright, it is more a function or subroutine so DietPi scripts can use it.
Yep, K-plan got it spot on.

Its basically a function script, that allows us to keep a visual style and colours, across all DietPi scripts.
Because bash scripts can't talk to each other (No class support, like C++), instead of us coding in the colours and styles in each script, we just call the notify script and it does it all for us.

Some examples:

Code: Select all

root@DietPi:~# /DietPi/dietpi/func/dietpi-notify 0 sucess
 [Ok] sucess
root@DietPi:~# /DietPi/dietpi/func/dietpi-notify 1 failure
 [Failed] failure
root@DietPi:~# /DietPi/dietpi/func/dietpi-notify 2 info
 [Info] info
root@DietPi:~# /DietPi/dietpi/func/dietpi-notify 3 DietPi-Program_Name Doingsomething

 DietPi-Program_Name
─────────────────────────────────────────────────────
 Mode: Doingsomething
 Please wait...

Untitled.png
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply