nixos-configs/modules/ags/config/ts/bar/items/heart.ts
matt1432 3a8cc994f2
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): switch back to global imports
2024-01-30 11:29:07 -05:00

26 lines
535 B
TypeScript

const { Label } = Widget;
import CursorBox from '../../misc/cursorbox.ts';
import Persist from '../../misc/persist.ts';
const HeartState = Variable('');
Persist({
name: 'heart',
gobject: HeartState,
prop: 'value',
condition: '',
whenFalse: '󰣐',
});
export default () => CursorBox({
on_primary_click_release: () => {
HeartState.value = HeartState.value === '' ? '󰣐' : '';
},
child: Label({
class_name: 'heart-toggle',
label: HeartState.bind(),
}),
});