mate-optimus icon indicating copy to clipboard operation
mate-optimus copied to clipboard

radio items and asusctl/asusd support

Open kyokenn opened this issue 2 years ago • 6 comments

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

kyokenn avatar Aug 24 '21 14:08 kyokenn

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

flukejones avatar Aug 24 '21 20:08 flukejones

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

kyokenn avatar Aug 24 '21 20:08 kyokenn

@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>
"

flukejones avatar Aug 24 '21 21:08 flukejones

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.

kyokenn avatar Aug 25 '21 07:08 kyokenn

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

flukejones avatar Aug 25 '21 11:08 flukejones

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?

kyokenn avatar Aug 25 '21 13:08 kyokenn