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

active window sensor for arch x86_64 with gnome. #423

Closed
domwolfy opened this issue Feb 6, 2025 · 4 comments
Closed

active window sensor for arch x86_64 with gnome. #423

domwolfy opened this issue Feb 6, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@domwolfy
Copy link

domwolfy commented Feb 6, 2025

I'm having trouble getting the active window for arch x86_64 with gnome.

There are only a couple of errors in the agent.log but i don't think they are relevant

time=2025-02-06T11:43:27.621+11:00 level=WARN msg="Could not init worker." linux.controller=sensor error="could not init ABRT worker\nunable to fetch ABRT problems from D-Bus: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
time=2025-02-06T11:43:27.621+11:00 level=WARN msg="Could not init worker." linux.controller=sensor error="could not init chrony worker\nchronyc is not available: exec: "chronyc": executable file not found in $PATH"

I've also done a check that I have xdg-desktop-portal-gnome

sudo pacman -S xdg-desktop-portal-gnome
warning: xdg-desktop-portal-gnome-47.2-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) xdg-desktop-portal-gnome-47.2-1

Total Installed Size: 0.78 MiB
Net Upgrade Size: 0.00 MiB`

I've also checked that the dbus service is active. I see a couple of fail messages under this, but I'm not sure if they are important.

systemctl status dbus
● dbus-broker.service - D-Bus System Message Bus
Loaded: loaded (/usr/lib/systemd/system/dbus-broker.service; enabled; preset: disabled)
Active: active (running) since Thu 2025-02-06 08:41:21 AEDT; 3h 19min ago
Invocation: d0b44129e0654716800ca19e66dc6753
TriggeredBy: ● dbus.socket
Docs: man:dbus-broker-launch(1)
Main PID: 843 (dbus-broker-lau)
Tasks: 2 (limit: 37027)
Memory: 5.5M (peak: 6.2M)
CPU: 601ms
CGroup: /system.slice/dbus-broker.service
├─843 /usr/bin/dbus-broker-launch --scope system --audit
└─844 dbus-broker --log 4 --controller 9 --machine-id 5b445a9b52fa4089a70191dcea3e3936 --max-bytes 536870912 --max-fds 4096 --max-matches 131072 --audit

Feb 06 08:41:21 archlinux systemd[1]: Starting D-Bus System Message Bus...
Feb 06 08:41:21 archlinux systemd[1]: Started D-Bus System Message Bus.
Feb 06 08:41:21 archlinux dbus-broker-launch[843]: Ready
Feb 06 08:41:26 archlinux dbus-broker-launch[843]: Activation request for 'org.freedesktop.resolve1' failed: The systemd unit 'dbus-org.freedesktop.resolve1.
service' could not be found.
Feb 06 08:41:29 archlinux dbus-broker-launch[843]: Activation request for 'org.freedesktop.home1' failed: The systemd unit 'dbus-org.freedesktop.home1.servic
e' could not be found.
Feb 06 08:41:46 archlinux dbus-broker-launch[843]: Activation request for 'org.freedesktop.Avahi' failed: The systemd unit 'dbus-org.freedesktop.Avahi.servic
e' could not be found.

So I've done my best to help myself before raising an issue.

Per your docs:
(requires [XDG Desktop Portal Support](https://flatpak.github.io/xdg-desktop-portal/docs/) support)

I'm hoping you can expand a little bit on this, as to what checks I can do to ensure the support is there.

Also wondering if there is a failure somewhere that is not being captured in the agent.log

@domwolfy domwolfy added the bug Something isn't working label Feb 6, 2025
@joshuar
Copy link
Owner

joshuar commented Feb 8, 2025

Hey there thanks for trying out Go Hass Agent and reporting an issue! Hmm, so the agent logs don't seem to indicate it is having any trouble with getting the sensor data for the app state sensor.

Can you try and run the following command in a terminal, which should list your active applications:

dbus-send --session --print-reply --dest=org.freedesktop.impl.portal.desktop.gnome /org/freedesktop/portal/desktop org.freedesktop.impl.portal.Background.GetAppState

If it doesn't can you copy the output into this issue?

If it does produce a list of apps, can you try the following:

  1. Start Go Hass Agent from a terminal with debug logging enabled: go-hass-agent --log-level=debug.
  2. Try switching windows on your desktop to trigger the app sensor to gather data.
  3. Kill the agent (either from the tray icon or Ctrl+C in the terminal).
  4. Compress and attach the log (~/.config/go-hass-agent/go-hass-agent.log) to this issue. Please check and remove any information you might deem sensitive from the log first as appropriate.

Cheers!

@joshuar
Copy link
Owner

joshuar commented Mar 2, 2025

Hey there just checking in if you were able to get any output from the commands in my last message?

@joshuar
Copy link
Owner

joshuar commented Mar 29, 2025

Hey there, just circling back, I'm going to close this issue as I can't help troubleshoot any further without the results of the steps in #423 (comment). Please re-open if you get a chance to perform those and attach the results and we can continue looking into this.

Cheers!

@joshuar joshuar closed this as completed Mar 29, 2025
@domwolfy
Copy link
Author

Hi thanks for offering help, and apologies for the silence.

When i run dbus-send --session --print-reply --dest=org.freedesktop.impl.portal.desktop.gnome /org/freedesktop/portal/desktop org.freedesktop.impl.portal.Background.GetAppState

I only see two apps, neither of which are the active window.

[dom@archlinux ~]$ dbus-send --session --print-reply --dest=org.freedesktop.impl.portal.desktop.gnome /org/freedesktop/portal/desktop org.freedesktop.impl.portal.Background.GetAppState
method return time=1743296961.221724 sender=:1.71 -> destination=:1.1063 serial=2676 reply_serial=2
array [
dict entry(
string "org.kicad.KiCad"
variant uint32 1
)
dict entry(
string "md.obsidian.Obsidian"
variant uint32 1
)
]

agent.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants