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

Unable to get gdbus call to an extension in a GNOME pod #10

Open
kortschak opened this issue Apr 6, 2024 · 2 comments
Open

Unable to get gdbus call to an extension in a GNOME pod #10

kortschak opened this issue Apr 6, 2024 · 2 comments

Comments

@kortschak
Copy link

I am working on getting CI testing built for an application that interacts with a GNOME extension. I'm trying to use gnome-shell-pod to help with this.

To start with I want to demonstrate that I can get a gdbus call to the extension to work after it's been installed and enabled, but I am unable to do this.

With this script

# Run the container in detached mode.
POD=$(podman run --rm --cap-add=SYS_NICE --cap-add=IPC_LOCK -td ghcr.io/schneegans/gnome-shell-pod-38)

do_in_pod() {
  podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
}

pushd dex/cmd/watcher/extensions/[email protected]
gnome-extensions pack --force
podman cp [email protected] ${POD}:/home/gnomeshell
do_in_pod gnome-extensions install --force [email protected]
rm [email protected]
popd

# This is necessary otherwise wait-user-bus.sh gives
# "Failed to get credentials: No data available"
sleep 5

# Wait until the user bus is available.
do_in_pod wait-user-bus.sh

# Start GNOME Shell.
do_in_pod systemctl --user start "gnome-xsession@:99"

# Wait some time until GNOME Shell has been started.
sleep 5

do_in_pod gnome-extensions list
do_in_pod gnome-extensions enable [email protected]
do_in_pod gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/UserActivity --method org.gnome.Shell.Extensions.UserActivity.Details

# Now we can stop the container again.
podman stop ${POD}

I get this output.

~/dex/cmd/watcher/extensions/[email protected] ~
~
[email protected]
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path ?/org/gnome/Shell/Extensions/UserActivity?

I see the extension is present in the list, but it is not found by the gdbus call.

On the non-pod host (a 23.10 VM) I see the following:

$ gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/UserActivity --method org.gnome.Shell.Extensions.UserActivity.Details
('{"wid":1917105287,"name":"gnome-terminal-server","class":"gnome-terminal-server","window":"user@mantic: ~","last_input":"2024-04-06T08:11:39.741Z","pid":3404,"layer":2}',)

So I am clearly missing something out. What is it that I am missing?

@kortschak kortschak changed the title Unable to get gsbus call to an extension in a GNOME pod Unable to get gdbus call to an extension in a GNOME pod Apr 6, 2024
@Schneegans
Copy link
Owner

Hi there! My first guess would be that a little sleep could help after do_in_pod gnome-extensions enable [email protected]. This is most likely an asynchronous operation and it may take some time until the interface is available....

Does this help?

@kortschak
Copy link
Author

Unfortunately not; even with a 60 second wait. This reflects the behaviour I saw when I was doing the same thing interactively where I never was able to get the interface to come up.

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

No branches or pull requests

2 participants