Hi! First, BIG THANKS for such xfce plugin - I love it! But I need some additional functions, such as: 1. Update applet on click. If I want to run attached program/script and update applet xml on applet button click, bypassing timer or maybe with timer reset. 2. Update applet from external script. For example I want run long script on click from 1 and want to update applet only after script is complete. 3. Update applet with timeout after first click. As another method for 2. I'm not developer, and I can't write correct clean code for this enhancements. I think for the 1 it needs additional command for parsing in <click>-tag. For example: <click>reset-timer</click> will reset the timer and applet will update automatically.
Mass-reassign all bugs from florian@ to goodies-dev@, thanks for the maintenance work! (and sorry for the bugmail spam..)
Created attachment 5857 0001-Process-output-of-click-command.patch Here's a suggested patch for #1. Simply resetting the timer didn't work well for me due to race conditions so I allowed the output of the click command to be processed in the same way as the timer command. Some additional configuration is probably needed around this but I thought I'd run the idea by you first.
James, Thanks for the patch. Is there any chance that you add a checkbox labelled "Refresh on click", and set it to True by default? The reason is we might have people who run a heavy command on e.g. a daily basis, and who might not want to accidentally run it by clicking the panel. Also, the UI of the panel plugin could be improved in a few ways. If you're interested in contributing more patches to this plugin, feel free to come and talk to me (sidi) on IRC (#xfce-dev). Thanks!
Created attachment 5927 Script to toggle screen blanking and DPMS As discussed on IRC, Steve may not have fully understood the change so I'm uploading a couple of examples of how I'm using this. The timer command isn't simply executed as usual after executing the click command. The stdout of the click action is used to refresh the state. Currently the output of the click command is ignored and bad things would happen if we suddenly started using it by default so the new UI option would need to default to "off" and would probably be called something like "Use click command output". So the first example is a script to toggle screen blanking and DPMS. I configure genmon to execute this without any arguments. Clicking on it executes the same script again but with an argument. XML is output in either case.
Created attachment 5928 Script to toggle audio between my monitor and AV unit This script to toggle audio between my monitor and AV unit follows the same principle.
Just to clarify, you don't have to execute the same script for the click command, it was just easier to do it that way in these cases.
@ James Le Cuirot, I tried out your patch and have some questions/concerns. It would seem to me that your patch is changing the genmon plugin into a toggle-like plugin. I have 2 current use-cases for genmon that get broken by the patch: 1. An update checker. I use to genmon to check for available updates. If some exist, the icon changes to indicate that updates are available. Clicking on the plugin fires up a terminal window that runs the update command. On completion, I close the window. Here, I would like to see the plugin reset itself (re-run the command). Currently, I have to right-click and select properties then okay to have it reset. 2. A modified weather applet. There are some other conditions/layouts that I prefer in my weather monitor and have created my own script to display the icon and weather conditions. Clicking on the plugin opens the weather page in my web browser. It is working fine. After installing your patch, and clicking the icon, I find the following: 1. The text changes to XXX and the icon disappears. The tooltip remains intact. I have to right-click, properties to get it to reset. 2. The weather icon and information disappears and I get a "GLib-CRITICAL**.g_slice_set_config" error as the text output. Tooltip still works, but I cannot reset the plugin. So to confirm, does your code now change this plugin into a toggle-like plugin? And if not, how would you script out the two use cases above to work properly with the patch?
Hi ToZ. My proposed change should not break existing configuration but the reason you saw breakage is because I haven't added the checkbox to make this new feature optional yet. I believe the change would certainly benefit your first use case but you will have to rejig things a bit. If you paste your script somewhere then I will make the adjustment and also revise the patch with a checkbox.
Thanks. The toggle functionality would be a useful enhancement as long as the existing functionality is not affected. The update script I use for use case #1: https://www.dropbox.com/s/urgg0yjk447xhbu/pacinfo.tar.gz?dl=0 The weather script I use for #2: https://www.dropbox.com/s/0bn266nzaokw3kc/weather.tar.gz
@James Le Cuirot, I have implemented plugin-event for the genmon plugin a while back (https://git.xfce.org/panel-plugins/xfce4-genmon-plugin/commit/?id=76bd6d78220ca0c5af7beaa6700a271459d6806b). This will allow you to refresh the plugin and restart the timer. I believe this may meet all 3 of your use cases (the third being programatically managed in a shell script by adding a timeout there and then initiated the refresh event. More info about refreshing the plugin can be found here. Does this meet your use cases?
Closing this report. If the plugin-event doesn't resolve your issue, please feel free to re-open.