2023-09-21 20:01:14 -04:00
|
|
|
const { Window, CenterBox, Label } = ags.Widget;
|
|
|
|
|
|
|
|
import { PopUp } from './misc/popup.js';
|
|
|
|
import { Button } from './misc/cursorbox.js'
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
const PowermenuWidget = CenterBox({
|
|
|
|
className: 'powermenu',
|
|
|
|
vertical: false,
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
startWidget: Button({
|
|
|
|
className: 'shutdown',
|
|
|
|
onPrimaryClickRelease: 'systemctl poweroff',
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
child: Label({
|
|
|
|
label: '襤',
|
2023-08-27 10:31:41 -04:00
|
|
|
}),
|
2023-09-21 20:01:14 -04:00
|
|
|
}),
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
centerWidget: Button({
|
|
|
|
className: 'reboot',
|
|
|
|
onPrimaryClickRelease: 'systemctl reboot',
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
child: Label({
|
|
|
|
label: '勒',
|
2023-08-27 10:31:41 -04:00
|
|
|
}),
|
2023-09-21 20:01:14 -04:00
|
|
|
}),
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
endWidget: Button({
|
|
|
|
className: 'logout',
|
|
|
|
onPrimaryClickRelease: 'hyprctl dispatch exit',
|
2023-08-27 10:31:41 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
child: Label({
|
|
|
|
label: '',
|
2023-08-27 10:31:41 -04:00
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|
2023-09-21 20:01:14 -04:00
|
|
|
|
|
|
|
export const Powermenu = Window({
|
|
|
|
name: 'powermenu',
|
2023-09-25 12:30:32 -04:00
|
|
|
popup: true,
|
2023-09-21 20:01:14 -04:00
|
|
|
layer: 'overlay',
|
|
|
|
child: PopUp({
|
|
|
|
name: 'powermenu',
|
|
|
|
transition: 'crossfade',
|
|
|
|
child: PowermenuWidget,
|
|
|
|
}),
|
|
|
|
});
|