nixos-configs/nixosModules/ags-v2/v1/config/ts/bar/heart.ts

27 lines
537 B
TypeScript
Raw Normal View History

const { Label } = Widget;
import CursorBox from '../../misc/cursorbox.ts';
import Persist from '../../misc/persist.ts';
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: () => {
2024-02-11 02:18:59 -05:00
HeartState.setValue(HeartState.value === '' ? '󰣐' : '');
2023-12-08 02:22:38 -05:00
},
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
}),
});