mate-desktop / mate-applets

Applets for use with the MATE panel
http://www.mate-desktop.org
GNU General Public License v2.0
79 stars 67 forks source link

[Feature Request] 'Command' applet to respond to file change events rather than time ticks #657

Open stephenboston opened 1 year ago

stephenboston commented 1 year ago

Expected behaviour

Panel applet will display the content of a file and update when the content of the file changes. This could be a modification of the 'command' applet to use a watch instead of a timed poll.

Actual behaviour

Current behavior is a timed loop on the command. To display a value that is subject to change I set the command field to 'cat' the file every n seconds where 'n' is an acceptable delay for the update. This can result in frequent unnecessary file io.

Steps to reproduce the behaviour

N/A

MATE general version

Where can I find this?

Package version

mate-desktop 1.26.1-1

Linux Distribution

6.3.1-arch1-1

Link to bugreport of your Distribution (requirement)

raveit65 commented 1 year ago

Displaying the time is only an easy example command to see an result when you load the applet. The intend of the applet is to display the results of other complex commands.

stephenboston commented 1 year ago

Understood -- and it works very well. It's an excellent piece.

However it operates through a poll of the command. This means that the applet fires every second at least.

I'm looking for an applet that displays output only when it changes. For example as a response to an inotifywait event.

raveit65 commented 1 year ago

The poll you can adjust with the time in preferences. Ie. for reading a temperature 20-30s are enough.

raveit65 commented 1 year ago

Btw. it should be possible to use the time poll without spamming the log. I will mark this report as feature request.

stephenboston commented 1 year ago

Thanks for following up on this.

For example I have a script that looks for changes in network status through the ip monitor service. When there is significant change I post the change to a file that the command applet parses using the cat command.

Even though significant events are rare I want this notice to be timely. Polling the file at acceptable intervals is too often so I want the applet to respond only where there is a change.