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

[beta] howdy-gtk fails to run after elevate #878

Closed
principis opened this issue Jan 24, 2024 · 1 comment · Fixed by #879
Closed

[beta] howdy-gtk fails to run after elevate #878

principis opened this issue Jan 24, 2024 · 1 comment · Fixed by #879

Comments

@principis
Copy link
Contributor

howdy-gtk won't start if not run as root:

Traceback (most recent call last):
  File "/home/arthur/fedora-scm/Howdy/howdy/howdy-gtk/src/init.py", line 8, in <module>
    import window
  File "/home/arthur/fedora-scm/Howdy/howdy/howdy-gtk/src/window.py", line 126, in <module>
    onboarding.OnboardingWindow()
  File "/home/arthur/fedora-scm/Howdy/howdy/howdy-gtk/src/onboarding.py", line 21, in __init__
    gtk.Window.__init__(self)
  File "/usr/lib/python3.12/site-packages/gi/overrides/Gtk.py", line 508, in __init__
    raise RuntimeError(
RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.

This exception is thrown after elevate.elevate(). Starting howdy-gtk with sudo works fine.

It seems it has something to do with the environment. After setting DISPLAY and XAUTHORITY in init.py, everything works as expected.


I've searched for similar issues already, and my issue has not been reported yet.

Linux distribution (if applicable): Fedora

Howdy version (sudo howdy version): 3.0.0 BETA (344eb34)

@principis
Copy link
Contributor Author

Fixed it by modifying the polkit policy:

<action id="com.github.boltgolt.howdy-gtk">
    <message>Authentication is required to run howdy-gtk</message>
    <icon_name>howdy-gtk</icon_name>
    <defaults>
        <allow_any>no</allow_any>
        <allow_inactive>no</allow_inactive>
        <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/python3</annotate>
    <annotate key="org.freedesktop.policykit.exec.argv1">/usr/lib64/howdy-gtk/init.py</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>

# 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.

1 participant