Skip to content

Commit 9476c67

Browse files
committed
Toggle icons for binding
1 parent 5abb96e commit 9476c67

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/bar/modules/warp/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { Astal } from "astal/gtk3";
88

99
const {
1010
label,
11-
icon,
11+
onIcon,
12+
offIcon,
1213
onLabel,
1314
offLabel,
1415
rightClick,
@@ -20,8 +21,8 @@ const {
2021
const thorttledToggleWarp = throttleInput(() => toggleWarp(isWarpConnect), 1000);
2122

2223
export const Warp = (): BarBoxChild => {
23-
const iconBinding = Variable.derive([bind(isWarpConnect), bind(icon)], (active, icn) => {
24-
return active ? icn : '󰇖';
24+
const iconBinding = Variable.derive([bind(isWarpConnect), bind(onIcon), bind(offIcon)], (active, onIcn, offIcn) => {
25+
return active ? onIcn : offIcn;
2526
})
2627

2728
const tooltipBinding = Variable.derive([isWarpConnect], (active) => {

src/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,9 @@ const options = mkOptions(CONFIG, {
11521152
scrollDown: opt(''),
11531153
},
11541154
warp: {
1155-
icon: opt(''),
11561155
label: opt(true),
1156+
onIcon: opt(''),
1157+
offIcon: opt('󰇖'),
11571158
onLabel: opt('On'),
11581159
offLabel: opt('Off'),
11591160
rightClick: opt(''),

0 commit comments

Comments
 (0)