js: use ES6 template strings for dbus interfaces
Use multiline template strings for dbus interfaces as they're easier to maintain
This commit is contained in:
@ -13,17 +13,18 @@ const PopupMenu = imports.ui.popupMenu;
|
||||
const BUS_NAME = 'org.freedesktop.UPower';
|
||||
const OBJECT_PATH = '/org/freedesktop/UPower/devices/DisplayDevice';
|
||||
|
||||
const DisplayDeviceInterface = '<node> \
|
||||
<interface name="org.freedesktop.UPower.Device"> \
|
||||
<property name="Type" type="u" access="read"/> \
|
||||
<property name="State" type="u" access="read"/> \
|
||||
<property name="Percentage" type="d" access="read"/> \
|
||||
<property name="TimeToEmpty" type="x" access="read"/> \
|
||||
<property name="TimeToFull" type="x" access="read"/> \
|
||||
<property name="IsPresent" type="b" access="read"/> \
|
||||
<property name="IconName" type="s" access="read"/> \
|
||||
</interface> \
|
||||
</node>';
|
||||
const DisplayDeviceInterface = `
|
||||
<node>
|
||||
<interface name="org.freedesktop.UPower.Device">
|
||||
<property name="Type" type="u" access="read"/>
|
||||
<property name="State" type="u" access="read"/>
|
||||
<property name="Percentage" type="d" access="read"/>
|
||||
<property name="TimeToEmpty" type="x" access="read"/>
|
||||
<property name="TimeToFull" type="x" access="read"/>
|
||||
<property name="IsPresent" type="b" access="read"/>
|
||||
<property name="IconName" type="s" access="read"/>
|
||||
</interface>
|
||||
</node>`;
|
||||
|
||||
const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(DisplayDeviceInterface);
|
||||
|
||||
|
Reference in New Issue
Block a user