nixos-configs/devices/wim/config/ags/js/bar/items/heart.js
matt1432 3b4a541d2e
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: (ags bar): make hover revs more consistent
2023-12-28 00:19:57 -05:00

28 lines
647 B
JavaScript

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';
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(),
}),
});