2023-11-10 23:51:50 -05:00
|
|
|
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
|
|
|
|
2023-11-21 01:29:46 -05:00
|
|
|
import Brightness from '../../services/brightness.js';
|
|
|
|
|
2023-11-10 23:51:50 -05:00
|
|
|
|
|
|
|
export default () => Box({
|
|
|
|
className: 'osd',
|
|
|
|
children: [
|
|
|
|
Icon({
|
|
|
|
hpack: 'start',
|
|
|
|
icon: 'caps-lock-symbolic',
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-11-10 23:51:50 -05:00
|
|
|
connections: [[Brightness, (self, state) => {
|
2023-11-21 01:29:46 -05:00
|
|
|
self.icon = state ?
|
|
|
|
'caps-lock-symbolic' :
|
|
|
|
'capslock-disabled-symbolic';
|
2023-11-10 23:51:50 -05:00
|
|
|
|
|
|
|
const stack = self.get_parent().get_parent();
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-11-10 23:51:50 -05:00
|
|
|
stack.shown = 'caps';
|
|
|
|
stack.resetTimer();
|
|
|
|
}, 'caps']],
|
|
|
|
}),
|
|
|
|
|
|
|
|
Label({
|
|
|
|
vpack: 'center',
|
|
|
|
label: 'Caps Lock',
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
});
|