Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

+github.com/essembeh/gnome-extensions-cli #5991

Closed
felipecrs opened this issue Apr 26, 2024 · 18 comments · Fixed by #6003
Closed

+github.com/essembeh/gnome-extensions-cli #5991

felipecrs opened this issue Apr 26, 2024 · 18 comments · Fixed by #6003

Comments

@felipecrs
Copy link
Contributor

A very useful tool to manage GNOME extensions.

https://github.com/essembeh/gnome-extensions-cli

jhheider added a commit that referenced this issue Apr 26, 2024
closes #5991
@jhheider jhheider mentioned this issue Apr 26, 2024
jhheider added a commit that referenced this issue Apr 26, 2024
closes #5991
@felipecrs
Copy link
Contributor Author

felipecrs commented Apr 27, 2024

For some reason I don't know yet, gext from pkgx doesn't work (gext --version works but pretty much anything else like gext list does not).

Because of gsettings:

gext list
No schemas installed
💥 Error: Command '['gsettings', 'get', 'org.gnome.shell', 'enabled-extensions']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/felipecrs/.pkgx/github.com/essembeh/gnome-extensions-cli/v0.10.1/venv/bin/gext", line 6, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/felipecrs/.pkgx/github.com/essembeh/gnome-extensions-cli/v0.10.1/venv/lib/python3.11/site-packages/gnome_extensions_cli/cli.py", line 116, in run
    raise error
  File "/home/felipecrs/.pkgx/github.com/essembeh/gnome-extensions-cli/v0.10.1/venv/lib/python3.11/site-packages/gnome_extensions_cli/cli.py", line 108, in run
    handler(args, manager, store)
  File "/home/felipecrs/.pkgx/github.com/essembeh/gnome-extensions-cli/v0.10.1/venv/lib/python3.11/site-packages/gnome_extensions_cli/commands/list_.py", line 47, in run
    enabled_uuids = manager.list_enabled_uuids()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/felipecrs/.pkgx/github.com/essembeh/gnome-extensions-cli/v0.10.1/venv/lib/python3.11/site-packages/gnome_extensions_cli/filesystem.py", line 110, in list_enabled_uuids
    stdout = subprocess.check_output(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/felipecrs/.pkgx/python.org/v3.11.9/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/felipecrs/.pkgx/python.org/v3.11.9/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['gsettings', 'get', 'org.gnome.shell', 'enabled-extensions']' returned non-zero exit status 1.gsettings get org.gnome.shell enabled-extensions
@as []pkgx +gext env gsettings get org.gnome.shell enabled-extensions
No schemas installed

Refs felipecrs/dotfiles#111

@jhheider
Copy link
Contributor

jhheider commented Apr 27, 2024

probably needs companions: gnome.org/glib: '*'.

no, actually; looks like glib needs to know where to find the schemas.

@felipecrs
Copy link
Contributor Author

Just found out:

pkgx +gext env bash -c 'unset XDG_DATA_DIRS && gsettings get org.gnome.shell enabled-extensions'
@as []pkgx +gext env bash -c 'gsettings get org.gnome.shell enabled-extensions'
No schemas installed

@felipecrs
Copy link
Contributor Author

I compared my env with pkgx +gext env and found out that the latter has XDG_DATA_DIRS=/home/felipecrs/.pkgx/gnu.org/coreutils/v9.5.0/.

Then unsetting it works.

I'm not sure what's the way forward though.

@jhheider
Copy link
Contributor

i've got fixes to load in gsettings and schemas, but org.gnome.shell isn't available. it looks like https://gitlab.gnome.org/GNOME/gnome-shell provides it, so that'd need to be packaged.

jhheider added a commit that referenced this issue Apr 27, 2024
This was referenced Apr 27, 2024
@felipecrs
Copy link
Contributor Author

felipecrs commented Apr 27, 2024

Hm... but I expect gext to work against my system's GNOME, so I believe gsettings should also load schemes from system.

If you package schemes by yourself, there's a chance schemes are for a different GNOME version than the one my system is using.

@jhheider
Copy link
Contributor

that's a good point. does it work if you do SCHEMADIR=/usr/share/glib-2.0/schemas gext list?

@jhheider
Copy link
Contributor

jhheider commented Apr 27, 2024

there's always going to be weird issues integrating pieces of large systems via a system like pkgx's.

jhheider added a commit that referenced this issue Apr 27, 2024
@felipecrs
Copy link
Contributor Author

felipecrs commented Apr 27, 2024

that's a good point. does it work if you do SCHEMADIR=/usr/share/glib-2.0/schemas gext list?

Same issue.

But this works:

pkgx +gext env bash -c 'XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/local/share/:/usr/share/" gsettings get org.gnome.shell enabled-extensions'
@as []

So, I think pkgx could be improved to add some sensible defaults like /usr/local/share/:/usr/share/ to its generated XDG_DATA_DIRS when none is set prior to its execution.

But this would be a change in libpkgx I suppose.

@felipecrs
Copy link
Contributor Author

felipecrs commented Apr 27, 2024

That's because:

When XDG_DATA_DIRS is set (pkgx's case), gsettings will try loading schemes from it (or something like that). When it's not set (default in Ubuntu distro), gsettings will fallback to XDG_DATA_HOME then some system-known others.

So I just think pkgx should be extra careful when overriding XDG_DATA_DIRS to ensure applications won't stop looking at XDG_DATA_HOME when XDG_DATA_DIR is unset prior to execution.

@felipecrs
Copy link
Contributor Author

But yeah, this isn't simple at all.

@jhheider
Copy link
Contributor

overriding users' XDG_* env vars isn't likely to pass muster. those should be strictly managed by the user. we alter them in build scripts to facilitate building, but I don't see any runtime configuration in the pantry that alters them.

it's possible mxcl might accept a fallback value, but iirc those are described in the spec itself.

@felipecrs
Copy link
Contributor Author

felipecrs commented Apr 27, 2024

Oh. Maybe we have a bug in pkgx then?

env | grep XDG
XDG_RUNTIME_DIR=/run/user/1002/pkgx env | grep XDG
XDG_DATA_DIRS=/home/felipecrs/.pkgx/gnu.org/coreutils/v9.5.0/share
XDG_RUNTIME_DIR=/run/user/1002/

If pkgx was not supposed to alter XDG_ vars in runtime, then it was not supposed to inject XDG_DATA_DIRS either, I suppose.

@jhheider
Copy link
Contributor

Interesting. So, it adds to it, which means if it's unset that could cause problems. Very interesting. I wonder what problem that was added to solve.

@felipecrs
Copy link
Contributor Author

To make sure this doesn't go to limbo, would you reopen this issue?

@jhheider
Copy link
Contributor

i don't think this is the correct issue; i've opened one to add gnome-shell, which might fix your issue, assuming the schemae don't mismatch. i'll open a discussion on libpkgx about the XDG_ issue.

@felipecrs
Copy link
Contributor Author

Thanks a lot!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants