zero resource - task reminders

Share your own howto's etc. Not for support questions!

zero resource - task reminders

Postby sickpig » 2019-04-14 09:46

this how to explains how to leverage systemd to create time sensetive popup task reminders, which don't consume any RAM whatsoever

what will it do?
give u 2 icons on desktop to create and set time sensetive reminders which pop on your screen no matter what application you are running

how to do it?
create a timer and a corresponding service in /home/a/.config/systemd/user. Replace /home/a with the path specific to your system (where-ever applicable below).

timer file
Code: Select all
[Unit]
Description=display alert noti

[Timer]
OnCalendar=2019-04-14 16:57:00
Persistent=true

[Install]
WantedBy=timers.target


save the above with alertnoti.timer (or any name you fancy)

service file

Code: Select all
[Unit]
Description=display screen alerts

[Service]
Type=simple

ExecStart=/home/a/Applications/alertnotifile.sh


save the above with alertnoti.service (or any name you fancy, only the part preceeding .service is changeable)

create your /home/a/Applications/alert.noti file at the path specific to your system

mine looks like below

Code: Select all
send bbc article to office teams
https://www.bbc.com/news/business-47879798


create another file like /home/a/Applications/alertnotifile.sh

Code: Select all
#!/bin/bash

leafpad /home/a/Applications/alert.noti


one more file at /home/a/Applications/alertnoti.sh

Code: Select all
#!/bin/bash

geany /home/a/Applications/alert.noti &
geany /home/a/.config/systemd/user/alertnoti.timer


Last one /home/a/sync/reminderset.sh

Code: Select all
#!/bin/sh

systemctl --user daemon-reload
systemctl --user stop alertnoti.timer
systemctl --user start alertnoti.timer
systemctl --user list-timers alertnoti*



Once done the above create 2 .desktop files on your desktop like below

https://ibb.co/x7HyDcp

the reminder will link to /home/a/Applications/alertnoti.sh
and set reminder will link to /home/a/Applications/reminderset.sh

when u click on reminder you get to edit time in timer when you want the popup to show up and the reminder file to edit the text you want to show up

https://ibb.co/1nVMHWV

https://ibb.co/bF15tv8

Then last step click on set reminder to get a confirmation of your set reminder as below
https://ibb.co/VwBn380

The above setup capitalizes on systemd and does not require any specific memory hogging "task reminder" application

If you sync files with your phone then you can edit the timer and the noti file on your phone and have the reminders popup on your computer once the phone syncs with your box

happy getting things done!
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34

Re: zero resource - task reminders

Postby pylkko » 2019-04-16 12:02

Ok, so basically you are using systemd to open a text file on some specific time in which you can add content. And it is "zero resource" because systemd is already installed. But I believe D-bus is a requirement for systemd, and will always be installed and therefore it is relatively easy also to send notifications using the already existing Desktop notification protocol with minimal resource usage. All you need is a server, and all DE have a notification server built-in. So on a fairly normal Debian install, you can just type this in the terminal:
Code: Select all
notify-send 'This is a notification' --icon-dialog-information

and a notification box will appear on the desktop. You can also send notifications like this from the .service file/timer or from a Bash script (or nearly any other scripting/programming language)

A more complex notification with a separate title and text:
Code: Select all
notify-send 'The title' 'text of actual notification' --icon-dialog-information

You can use many other options (See the man page) like your own icon, urgency levels, how long the message displays on the desktop and much more


If you are using a minimal WM setup, then you would need to install libnotify at minimum

Not saying that your idea is not good, but just in case you didn't know, you can also just send a notification from your service file
User avatar
pylkko
 
Posts: 1584
Joined: 2014-11-06 19:02

Re: zero resource - task reminders

Postby sickpig » 2019-04-16 19:32

Code: Select all
~$ notify-send 'This is a notification' --icon-dialog-information
bash: notify-send: command not found


why would i want to install anything (libnotify) extra when i am achieving what i need with my existing setup?

also whatever you have suggested is not persistent across reboots. a task reminder system ("zero-resource") is pretty useless if it fails to remind you, dont u think?
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34

Re: zero resource - task reminders

Postby pylkko » 2019-04-17 17:52

Yes, but to be fair, your set-up already requires geany and leafpad, which probably use more resources than libnotify...

additionally, it is possible to resend notifications to yourself until you react, so booting should not be an issue
User avatar
pylkko
 
Posts: 1584
Joined: 2014-11-06 19:02

Re: zero resource - task reminders

Postby sickpig » 2019-04-17 19:06

u are wrong. geany is not a dependency for systemd, you can use leafpad in place of geany.
u have not understood how it works.

it is presumptuous to believe that readers' task reminding needs would be satisfied in the same session. What will you do for getting reminded in the next week? You are wrong there as well.

libnotify will add a startup daemon and a service which consumes multiples of resources as compared to simple text editor like leafpad. not to mention the ton of dependencies it will pull.

my solution doesnt need any stinking DE or notify daemons/startup services. it will work with or without it.

just plain systemd and a text editor

no matter how you slice it, your suggestion adds more resource usage, doesn't reduce it
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34

Re: zero resource - task reminders

Postby pylkko » 2019-04-17 19:33

sickpig wrote:u are wrong. geany is not a dependency for systemd, you can use leafpad in place of geany.
u have not understood how it works.


I never said that geany is a dependecy of systemd. I also never said that I understand how it works.

it is presumptuous to believe that readers' task reminding needs would be satisfied in the same session. What will you do for getting reminded in the next week? You are wrong there as well.


Because the format in which you display the message has nothing to do with how the notification scheme can work, there is nothing to change. You can display the text from either a text file with a text editor or you can send the text to the notification area.

libnotify will add a startup daemon and a service which consumes multiples of resources as compared to simple text editor like leafpad. not to mention the ton of dependencies it will pull.


Actually, the dependencies are things like libc, libglibm, libgdk-pixbuf and so on. Most of this stuff will be installed anyway.


my solution doesnt need any stinking DE or notify daemons/startup services. it will work with or without it.


good for you

just plain systemd and a text editor

no matter how you slice it, your suggestion adds more resource usage, doesn't reduce it


Yes, but there is no person ever that has claimed that it would reduce anything. Only I was saying that if you are already using the most massive collection of daemons (systemd) and leafpad and even also geany in your scripts above, then who cares anymore about using proper notifications?

So do you get it? I was saying that you can use the same scheme but display the messages in a non-disruptive way in a notification area without any relevant increase in usage of resources. I am not claiming that I have an better way to do what you want or that I am competing with "your idea" with "my idea" or something like that. But hey, this is boring to talk about.
User avatar
pylkko
 
Posts: 1584
Joined: 2014-11-06 19:02

Re: zero resource - task reminders

Postby sickpig » 2019-04-17 20:37

Because the format in which you display the message has nothing to do with how the notification scheme can work, there is nothing to change. You can display the text from either a text file with a text editor or you can send the text to the notification area.


thanks for the above, I couldn't have explained it better. However, the moment you add a notify daemon in the mix, it starts to deviate from the title of the post "zero resource - task reminders"

Yes, but there is no person ever that has claimed that it would reduce anything. Only I was saying that if you are already using the most massive collection of daemons (systemd) and leafpad and even also geany in your scripts above, then who cares anymore about using proper notifications?


correction - systemd is an init system, not a "massive collection of daemons". It will only start daemons of installed applications(libnotify in this case) as per the instructions received from the applications. What it will NOT do is cure world hunger, change the president or reverse climate degradation.

It doesn't instruct the applications to start the daemons it is the other way round. It controls the sequence in which the daemons are started. Thats the job of the init system, to control the sequence. It does not create daemons out of thin air.

The only daemon it has is its own, systemd daemon. So, it will not start notify daemon on its own. There has to be an application (libnotify) to make it start its(application's) daemon.

about leafpad or geany, you can use vim. A text editor is just used to edit files. It is not running in the background or actively consuming your system resources. The pop up can be shownn in terminal as well. cat filename.

I was saying that you can use the same scheme but display the messages in a non-disruptive way in a notification area without any relevant increase in usage of resources.


Yes of couse, this is just a 'how to'
you can certainly customize it per your requirements to open notification, audio, video or call in an airstrike

however, beware adding notify daemon will add to the resource usage, but you already know that.

I apologize for my tone in my earlier post and for any offence it might have caused. Appreciate your comment and suggestion. Cheers!
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable