feat: show temperature on tooltip (#490)
Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -8,8 +8,19 @@ import { BarBoxChild } from 'lib/types/bar';
|
|||||||
import { pollVariable } from 'customModules/PollVar';
|
import { pollVariable } from 'customModules/PollVar';
|
||||||
import { checkSunsetStatus, isActive, toggleSunset } from './helpers';
|
import { checkSunsetStatus, isActive, toggleSunset } from './helpers';
|
||||||
|
|
||||||
const { label, pollingInterval, onIcon, offIcon, onLabel, offLabel, rightClick, middleClick, scrollUp, scrollDown } =
|
const {
|
||||||
options.bar.customModules.hyprsunset;
|
label,
|
||||||
|
pollingInterval,
|
||||||
|
onIcon,
|
||||||
|
offIcon,
|
||||||
|
onLabel,
|
||||||
|
offLabel,
|
||||||
|
rightClick,
|
||||||
|
middleClick,
|
||||||
|
scrollUp,
|
||||||
|
scrollDown,
|
||||||
|
temperature,
|
||||||
|
} = options.bar.customModules.hyprsunset;
|
||||||
|
|
||||||
const dummyVar = Variable(undefined);
|
const dummyVar = Variable(undefined);
|
||||||
|
|
||||||
@@ -27,7 +38,9 @@ export const Hyprsunset = (): BarBoxChild => {
|
|||||||
return active ? onIcn : offIcn;
|
return active ? onIcn : offIcn;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
tooltipText: isActive.bind('value').as((active) => `Hyprsunset ${active ? 'enabled' : 'disabled'}`),
|
tooltipText: Utils.merge([isActive.bind('value'), temperature.bind('value')], (active, temp) => {
|
||||||
|
return `Hyprsunset ${active ? 'enabled' : 'disabled'}\nTemperature: ${temp}`;
|
||||||
|
}),
|
||||||
boxClass: 'hyprsunset',
|
boxClass: 'hyprsunset',
|
||||||
label: Utils.merge(
|
label: Utils.merge(
|
||||||
[isActive.bind('value'), onLabel.bind('value'), offLabel.bind('value')],
|
[isActive.bind('value'), onLabel.bind('value'), offLabel.bind('value')],
|
||||||
|
|||||||
Reference in New Issue
Block a user