2023-09-05 15:10:25 -04:00
|
|
|
const { Box, Label } = ags.Widget;
|
|
|
|
const { subprocess } = ags.Utils;
|
|
|
|
import { EventBox } from '../common.js';
|
|
|
|
const deflisten = subprocess;
|
|
|
|
|
|
|
|
deflisten(
|
2023-09-07 23:18:39 -04:00
|
|
|
['bash', '-c', '$AGS_PATH/qs-toggle.sh state'],
|
2023-09-05 15:10:25 -04:00
|
|
|
(output) => {
|
|
|
|
print(output)
|
|
|
|
if (output == 'On') {
|
|
|
|
QsToggle.toggleClassName('toggle-on', false);
|
|
|
|
} else {
|
|
|
|
QsToggle.toggleClassName('toggle-on', true);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
export const QsToggle = EventBox({
|
|
|
|
className: 'toggle-off',
|
|
|
|
onPrimaryClickRelease: function() {
|
|
|
|
subprocess(
|
2023-09-07 23:18:39 -04:00
|
|
|
['bash', '-c', '$AGS_PATH/qs-toggle.sh toggle'],
|
2023-09-05 15:10:25 -04:00
|
|
|
(output) => {
|
|
|
|
print(output)
|
|
|
|
if (output == 'On') {
|
|
|
|
QsToggle.toggleClassName('toggle-on', true);
|
|
|
|
} else {
|
|
|
|
QsToggle.toggleClassName('toggle-on', false);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
child: Box({
|
|
|
|
className: 'quick-settings-toggle',
|
|
|
|
vertical: false,
|
|
|
|
child: Label({
|
|
|
|
label: " ",
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|