nixos-configs/devices/wim/config/ags/js/bar/items/heart.js

29 lines
647 B
JavaScript
Raw Normal View History

2023-12-08 02:22:38 -05:00
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import CursorBox from '../../misc/cursorbox.js';
import Persist from '../../misc/persist.js';
2023-09-04 22:27:34 -04:00
2023-12-18 18:00:30 -05:00
const HeartState = Variable('');
Persist({
name: 'heart',
gobject: HeartState,
prop: 'value',
condition: '',
whenFalse: '󰣐',
});
2023-09-04 22:27:34 -04:00
export default () => CursorBox({
on_primary_click_release: () => {
2023-12-08 02:22:38 -05:00
HeartState.value = HeartState.value === '' ? '󰣐' : '';
},
2023-12-08 02:22:38 -05:00
child: Label({
2023-12-18 18:00:30 -05:00
class_name: 'heart-toggle',
label: HeartState.bind(),
2023-12-08 02:22:38 -05:00
}),
});