Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Tray-icon researches #3774

Closed
rusty-snake opened this issue Nov 26, 2020 · 1 comment
Closed

Tray-icon researches #3774

rusty-snake opened this issue Nov 26, 2020 · 1 comment
Labels
converted-to-discussion This issue was converted to discussions information_old (Deprecated; use "doc-todo" or "needinfo" instead) Information was/is required

Comments

@rusty-snake
Copy link
Collaborator

There are many tray-icon standards:

  • XEmbed.
    • is legacy
    • uses X
    • has no wayland support therefore
    • independent on DBus
  • A Unity/Ubuntu special standard
    • not implemented in Xfce, KDE, ...
    • applications cann't relay on it
  • StatusNotifierItem (freedesktop) (org.freedesktop.StatusNotifierWatcher)
    • actually there is no implementation by Apps or DE (has xfce one?)
    • was submitted by kde based on the one below
  • KStatusNotifierItem (KDE) (org.kde.StatusNotifierWatcher)
    • is used by sway, GNOME via shell-extension, KDE, ...
    • KDE has maybe some additional additions
    • I tested under GNOME for now
    • this it the one I focus below
  • ...

Which dbus rules are requiered for KStatusNotifierItem?

  • dbus-user.talk org.kde.StatusNotifierWatcher
    • This is unsafe and allows sandbox escapes
    • This is always required
  • dbus-user.own <APP-ID> (or dbus-user.own <Apps Indicator Service> but I never saw it)
    • This is required by apps using libayatana (e.g. transmission-gtk)
  • dbus-user.own org.kde.StatusNotifierItem-<PID>-<ID>
    • This is required by apps strictly following the spec (e.g. Qt based)
    • YES YOU READ IT RIGHT, <PID>!! fuck yeah!
    • The pid is part of the name, meaning you need to add dbus-user.own org.kde.* (obviously unsafe)
    • The pid inside the sandbox is used, this means
      • These names are a bit stable if it is for example the second process in the sandbox which registers a tray-icon
      • Names can conflict and apps likely don't expect a other program with the same pid
@rusty-snake
Copy link
Collaborator Author

The pid is part of the name, meaning you need to add dbus-user.own org.kde.* (obviously unsafe)

The alternative is to add hundreds of dbus-user.own org.kde.StatusNotifierItem-<PID>-<ID> commands. However, this takes endless to start firejal.

with open("/proc/sys/kernel/pid_max", "r") as pid_max_fd:
    pid_max = int(pid_max_fd.read())

with open("snw.inc", "w") as snw_inc:
    snw_inc.write("dbus-user.call org.kde.StatusNotifierWatcher=org.freedesktop.DBus.Introspectable.*\n")
    snw_inc.write("dbus-user.call org.kde.StatusNotifierWatcher=org.freedesktop.DBus.Properties.*\n")
    snw_inc.write("dbus-user.call org.kde.StatusNotifierWatcher=org.kde.StatusNotifierWatcher.*@/StatusNotifierWatcher\n")
    for pid in range(pid_max):
        for i in range(9):
            snw_inc.write(f"dbus-user.own org.kde.StatusNotifierItem-{pid}-{i}\n")

Repository owner locked and limited conversation to collaborators Mar 6, 2021
@rusty-snake rusty-snake added the converted-to-discussion This issue was converted to discussions label Mar 11, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
converted-to-discussion This issue was converted to discussions information_old (Deprecated; use "doc-todo" or "needinfo" instead) Information was/is required
Projects
None yet
Development

No branches or pull requests

1 participant