2023-10-31 08:32:40 -04:00
|
|
|
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
|
|
|
import { subprocess } from 'resource:///com/github/Aylur/ags/utils.js';
|
2023-09-05 13:25:32 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
import EventBox from '../misc/cursorbox.js';
|
2023-09-04 22:34:33 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => EventBox({
|
2023-10-20 23:11:21 -04:00
|
|
|
className: 'toggle-off',
|
|
|
|
onPrimaryClickRelease: self => {
|
|
|
|
subprocess(
|
|
|
|
['bash', '-c', '$AGS_PATH/tablet-toggle.sh toggle'],
|
|
|
|
output => self.toggleClassName('toggle-on', output == 'Tablet'),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
child: Box({
|
|
|
|
className: 'tablet-toggle',
|
|
|
|
vertical: false,
|
|
|
|
child: Label({
|
|
|
|
label: ' ',
|
|
|
|
}),
|
2023-09-04 22:34:33 -04:00
|
|
|
}),
|
|
|
|
});
|