function Power() { return Widget.Box({ vertical: false, spacing: 8, children: [ Widget.EventBox({ child: Widget.Icon({icon: 'system-reboot-symbolic'}), margin_right: 10, class_name: 'restart', tooltip_text: 'restart', on_primary_click: () => {App.Quit(); Utils.execAsync('reboot')}, }), Widget.EventBox({ child: Widget.Icon({icon: 'system-log-out-symbolic'}), margin_right: 10, class_name: 'logout', tooltip_text: 'log out', on_primary_click: () => {App.Quit(); Utils.execAsync('loginctl kill-session self')}, }), Widget.EventBox({ child: Widget.Icon({icon: 'system-lock-screen-symbolic'}), margin_right: 10, class_name: 'lockscreen', tooltip_text: 'lock screen', on_primary_click: () => {Utils.exec('swaylock')}, }), Widget.EventBox({ child: Widget.Icon({icon: 'system-shutdown-symbolic'}), margin_right: 10, class_name: 'poweroff', tooltip_text: 'shutdown', on_primary_click: () => {App.Quit(); Utils.execAsync('shutdown now')}, }) ], }) } export default Power