Skip to content
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

Override actions #3

Open
marcosnils opened this issue Jan 4, 2017 · 8 comments
Open

Override actions #3

marcosnils opened this issue Jan 4, 2017 · 8 comments

Comments

@marcosnils
Copy link

Some actions are very specific like linux gnome stuff .

I was thinking about to add variables to this plugin so it configured something like this:

        {
            "name": "tinytacoteam/zazu-system",
            "variables": {
                "commands": {
                    "screensaver": "<my sreensaver command>"
                }
            }
        }

The thing is that as the commands are defined in the UserScript plugin https://github.com/tinytacoteam/zazu-system/blob/master/process.js#L14 I think there's no way to forward the variables to that output plugin.

I was thinking to move the commands definitions into the actions.js file https://github.com/tinytacoteam/zazu-system/blob/master/actions.json which will allow to use the env parameters to override.

WDYT?

@bayleedev
Copy link
Member

Would it be easier to extend the definitions to include more versions of linux/gnome?

@marcosnils
Copy link
Author

@blainesch how are you suggesting to extend?. Some commands can't be generically applied to all linux distros / window managers / etc.

process.platform just returns 'linux'. There's no info about the distro or window manager.

@afaur
Copy link
Member

afaur commented Jan 5, 2017

Looks like maybe it could be located through env vars..
(http://askubuntu.com/questions/72549/how-to-determine-which-window-manager-is-running#answer-227669)

Might have to get clever though to actually get at these as I am not sure they would be set in the zazu node processes process.env (https://nodejs.org/api/process.html#process_process_env).

I wonder if it would be possible to run the printenv command if exists to get at the env vars.
(https://www.cyberciti.biz/faq/linux-list-all-environment-variables-env-command/)

@blainesch does this seem overly complicated? Maybe there is an easier way?

@afaur
Copy link
Member

afaur commented Jan 5, 2017

Just saw #2 I didn't know that command existed. Do you think that will work for most use cases @marcosnils

@marcosnils
Copy link
Author

Looks like maybe it could be located through env vars..
(http://askubuntu.com/questions/72549/how-to-determine-which-window-manager-is-running#answer-227669)

It's not only about the window manager. Some different combinations of greeters / screensavers could also be used within the same window manager which are not controlled by env vars.

Just saw #2 I didn't know that command existed. Do you think that will work for most use cases @marcosnils

Yes. That's far more generic than the gnome specific one.

I still believe the best option would be to allow users to configure their "actions" through the plugin configuration. Eventually the plugin could be extended to add new system commands which could be persisted in the DB

@bayleedev
Copy link
Member

I'd prefer this:

        {
            "name": "tinytacoteam/zazu-system",
            "variables": {
                "screensaver": "<my sreensaver command>"
            }
        }

So without the commands top level variable.

@marcosnils
Copy link
Author

@blainesch got it. I'll try to send a PR if I have some time.

@yisraeldov
Copy link

yeah, this is a must, not everyone uses gnome screensaver ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants