Files
Olympus/home/dotfiles/ags/power.js
2024-10-18 07:40:46 -05:00

44 lines
1.4 KiB
JavaScript
Executable File

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