! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Allow genmon "command" to dynamically change the timer period
Status:
RESOLVED: MOVED
Severity:
enhancement
Product:
Xfce4-genmon-plugin
Component:
General

Comments

Description Jerry D. Hedden 2015-06-15 21:51:57 CEST
Created attachment 6311 
Patch to allow genmon "command" to dynamically change the timer period.

The attached patch modifies the command output parsing to add the capability for the command to dynamically change the timer period.  If the command output contains tags "<period>SECS</period>", then the timer's period will be changed to the SECS value (* 1000 for millisecs).  This will then go into affect on the next period.

If the user is displaying the period in the tooltip, the new value will be displayed.

If the user pulls up the options/config popup, this value will be displayed.  If any values are changed, then this new value will be saved to the config file.

If the command changes the period, but the user does not pull up the options/config popup, then the changed period will not be saved.
Comment 1 ToZ editbugs 2018-09-06 04:39:57 CEST
Sorry for the delay in getting to your bug report and thanks for the patch. What is your use case for adding this functionality? Would the "--plugin-event" functionality to refresh/restart the timer be sufficient to meet this use case? See: https://goodies.xfce.org/projects/panel-plugins/xfce4-genmon-plugin ?
Comment 2 Jerry D. Hedden 2018-09-06 16:04:15 CEST
The idea is for the script to be able to change the timer period based on the state of what it's monitoring, or on some other condition.  One example might be a monitoring script for VPN that sets the timer period to 90 seconds if the VPN is turned off by the user; 30 seconds when the VPN is turned on, and 10 seconds when the VPN is in a failed state (to quickly report when it's back up).  Another is one that monitors a stock's price, updating every minute during trading hours, but only every 5 during after-hours.  A third is one that changes it's timer period based on whether or not the screen is locked/screensaver on.  The first example was my motivation for the patch.
Comment 3 ToZ editbugs 2018-10-26 14:48:48 CEST
I've been testing this patch and it doesn't actually change the timer live. You need to go to the configuration screen for it to take effect. 

Can you post one of the scripts that you use - maybe the screensaver one? Thanks.
Comment 4 Jerry D. Hedden 2018-10-26 15:47:07 CEST
I'm afraid I don't have an example script.  The need that I had at the time I wrote the patch no longer is there.  In fact, I'm not sure I ever compiled and used the patch.  I just thought it would be useful, and wrote it a best I could.
Comment 5 Git Bot editbugs 2020-05-23 00:01:10 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/panel-plugins/xfce4-genmon-plugin/-/issues/1.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #11984

Reported by:
Jerry D. Hedden
Reported on: 2015-06-15
Last modified on: 2020-05-23

People

Assignee:
Florian Rivoal
CC List:
1 user

Version

Attachments

Patch to allow genmon "command" to dynamically change the timer period. (939 bytes, application/octet-stream)
2015-06-15 21:51 CEST , Jerry D. Hedden
no flags

Additional information