Skip to content

radio items and asusctl/asusd support#26

Open
kyokenn wants to merge 2 commits intoubuntu-mate:masterfrom
kyokenn:master
Open

radio items and asusctl/asusd support#26
kyokenn wants to merge 2 commits intoubuntu-mate:masterfrom
kyokenn:master

Conversation

@kyokenn
Copy link
Copy Markdown

@kyokenn kyokenn commented Aug 24, 2021

PR changes:

  • Gtk.MenuItem replaced with Gtk.RadioMenuItem for GPU choice menu
  • Made "setproctitle" optional
  • Made "glxinfo" fallback for missing "visualinfo"
  • Added "Integrated GPU" option, because some laptops have an AMD iGPU instead of Intel
  • Added support for asusctl/asusd for ASUS laptops - https://asus-linux.org/ https://gitlab.com/asus-linux/asusctl
  • Added "VFIO" option for asusctl/asusd

@flukejones
Copy link
Copy Markdown

Is it possible for you to use the dbus interface instead of the cli tool directly? (I'm the asusctl owner)

@kyokenn
Copy link
Copy Markdown
Author

kyokenn commented Aug 24, 2021

@flukejones Sure, I can switch to dbus. It would be great. Does the asusctl's dbus methods documented somewhere?

@flukejones
Copy link
Copy Markdown

@kyokenn no, but it's very easy to get the info:

[luke@fedora]$ dbus-send --system --type=method_call --print-reply --dest=org.asuslinux.Daemon /org/asuslinux/Gfx org.freedesktop.DBus.Introspectable.Introspect
method return time=1629840916.728590 sender=:1.28 -> destination=:1.175 serial=170 reply_serial=2
   string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping">
    </method>
    <method name="GetMachineId">
      <arg type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.asuslinux.Daemon">
    <method name="Vendor">
      <arg type="u" direction="out"/>
    </method>
    <method name="Power">
      <arg type="u" direction="out"/>
    </method>
    <method name="SetVendor">
      <arg name="vendor" type="u" direction="in"/>
      <arg type="u" direction="out"/>
    </method>
    <signal name="NotifyGfx">
      <arg name="vendor" type="u"/>
    </signal>
    <signal name="NotifyAction">
      <arg name="action" type="u"/>
    </signal>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg type="v" direction="out"/>
    </method>
    <method name="Set">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="in"/>
    </method>
    <method name="GetAll">
      <arg name="interface_name" type="s" direction="in"/>
      <arg type="a{sv}" direction="out"/>
    </method>
    <signal name="PropertiesChanged">
      <arg name="interface_name" type="s"/>
      <arg name="changed_properties" type="a{sv}"/>
      <arg name="invalidated_properties" type="as"/>
    </signal>
  </interface>
</node>
"

@kyokenn
Copy link
Copy Markdown
Author

kyokenn commented Aug 25, 2021

Thanks for the info. I have added optional dbus support with fallback to asusctl CLI, because the original mate-optimus tool doesn't requires dbus for generic laptops.

@flukejones
Copy link
Copy Markdown

I'm very sorry to say, but I am breaking userspace while I try to figure out the best way to pull the graphics control stuff fully out of asusctl. New xml is:

[luke@fedora]$ dbus-send --system --type=method_call --print-reply --dest=org.asuslinux.Daemon /org/supergfxctl/Gfx org.freedesktop.DBus.Introspectable.Introspect
method return time=1629891672.215171 sender=:1.294 -> destination=:1.304 serial=20 reply_serial=2
   string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping">
    </method>
    <method name="GetMachineId">
      <arg type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.supergfxctl.Daemon">
    <method name="Vendor">
      <arg type="u" direction="out"/>
    </method>
    <method name="Power">
      <arg type="u" direction="out"/>
    </method>
    <method name="SetVendor">
      <arg name="vendor" type="u" direction="in"/>
      <arg type="u" direction="out"/>
    </method>
    <signal name="NotifyGfx">
      <arg name="vendor" type="u"/>
    </signal>
    <signal name="NotifyAction">
      <arg name="action" type="u"/>
    </signal>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg type="v" direction="out"/>
    </method>
    <method name="Set">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="in"/>
    </method>
    <method name="GetAll">
      <arg name="interface_name" type="s" direction="in"/>
      <arg type="a{sv}" direction="out"/>
    </method>
    <signal name="PropertiesChanged">
      <arg name="interface_name" type="s"/>
      <arg name="changed_properties" type="a{sv}"/>
      <arg name="invalidated_properties" type="as"/>
    </signal>
  </interface>
</node>
"

destination is likely to end up being org.supergfxctl.Daemon

@kyokenn
Copy link
Copy Markdown
Author

kyokenn commented Aug 25, 2021

I'm very sorry to say, but I am breaking userspace while I try to figure out the best way to pull the graphics control stuff fully out of asusct

Which version of asusctl will have those changes?

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

Successfully merging this pull request may close these issues.

2 participants