New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README.md extend info about env #137
Conversation
in environment-variables section add info about `+` in file name to `$ARGOS_MENU_OPEN` work property
@@ -255,7 +255,7 @@ Plugin executables are run with the following special environment variables set: | |||
| Name | Value | | |||
| --- | --- | | |||
| `ARGOS_VERSION` | Version number of the Argos extension. The presence of this environment variable can also be used to determine that the plugin is actually running in Argos, rather than BitBar or [kargos](https://github.com/lipido/kargos). | | |||
| `ARGOS_MENU_OPEN` | `true` if the dropdown menu was open at the time the plugin was run, and `false` otherwise. | | |||
| `ARGOS_MENU_OPEN` | `true` if the dropdown menu was open at the time the plugin was run, and `false` otherwise. Requires `+` in file name to work. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's incorrect. ARGOS_MENU_OPEN
is set regardless of whether the filename contains +
or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it work only if + is in file name.
(If + is missing always return false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you are confusing two separate things. Adding +
to the filename re-runs the plugin whenever the user opens the menu, even if the plugin is not scheduled for a re-run based on its update interval. So the effect of ARGOS_MENU_OPEN
is visible immediately regardless of the update interval.
But whether or not the +
is present, ARGOS_MENU_OPEN
is always set when the plugin is run. Of course, if the interval is large and you open the menu at some random point, you may have to wait a long time for the scheduled re-run to happen and the effect of the environment variable to be reflected in the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it in test.1s.sh and test.1s+.sh
In test.1s.sh it work about one in 5-6 case. Maybe word "required" is incorrect but small note about it maybe by helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you're describing sounds like a GNOME Shell bug. If you look in the _update
function responsible for running the plugin script you will find this:
argos/argos@pew.worldwidemann.com/button.js
Lines 80 to 88 in 1180568
_update() { | |
if (this._updateRunning) | |
return; | |
this._updateRunning = true; | |
let envp = GLib.get_environ(); | |
envp.push("ARGOS_VERSION=2"); | |
envp.push("ARGOS_MENU_OPEN=" + (this.menu.isOpen ? "true" : "false")); |
As you can see, the ARGOS_MENU_OPEN
variable is set unconditionally. There is absolutely no connection to the +
in the filename. And I know for a fact that this used to work just fine, as I have tested it extensively when I added that feature.
There is nothing to add to the documentation here. Instead, I recommend you file an issue describing exactly what is happening in your case, along with the full contents of your script and your Argos and GNOME Shell versions.
in environment-variables section add info about
+
in file name to$ARGOS_MENU_OPEN
work property