Fix NerdFont icon alignments. (#143)

* WIP

* Fix nerdfont icon alignments

* Ship needed fonts

* Remove italicised fonts

* Update readme and separate OSD settings into their own category.

* Dashboard styling updates

---------

Co-authored-by: matavach <erik@matijevich.org>
This commit is contained in:
Jas Singh
2024-08-18 00:32:22 -07:00
committed by GitHub
parent a1beac4c05
commit b200b6fadb
40 changed files with 263 additions and 150 deletions

View File

@@ -4,93 +4,98 @@ const notifications = await Service.import("notifications");
const audio = await Service.import("audio");
const Controls = () => {
return Widget.Box({
class_name: "dashboard-card controls-container",
hpack: "fill",
vpack: "fill",
expand: true,
children: [
Widget.Button({
tooltip_text: "Toggle Wifi",
return Widget.Box({
class_name: "dashboard-card controls-container",
hpack: "fill",
vpack: "fill",
expand: true,
setup: (self) => {
self.hook(network, () => {
return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? "disabled" : ""}`);
});
},
on_primary_click: () => network.toggleWifi(),
child: Widget.Label({
setup: (self) => {
self.hook(network, () => {
return (self.label = network.wifi.enabled ? "󰤨" : "󰤭");
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Bluetooth",
expand: true,
class_name: bluetooth
.bind("enabled")
.as(
(btOn) => `dashboard-button bluetooth ${!btOn ? "disabled" : ""}`,
),
on_primary_click: () => bluetooth.toggle(),
child: Widget.Label({
label: bluetooth.bind("enabled").as((btOn) => (btOn ? "󰂯" : "󰂲")),
}),
}),
Widget.Button({
tooltip_text: "Toggle Notifications",
expand: true,
class_name: notifications
.bind("dnd")
.as(
(dnd) => `dashboard-button notifications ${dnd ? "disabled" : ""}`,
),
on_primary_click: () => (notifications.dnd = !notifications.dnd),
child: Widget.Label({
label: notifications.bind("dnd").as((dnd) => (dnd ? "󰂛" : "󰂚")),
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Playback)",
expand: true,
on_primary_click: () =>
(audio.speaker.is_muted = !audio.speaker.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? "disabled" : ""}`);
});
},
child: Widget.Label({
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.speaker.is_muted ? "󰖁" : "󰕾");
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Microphone)",
expand: true,
on_primary_click: () =>
(audio.microphone.is_muted = !audio.microphone.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? "disabled" : ""}`);
});
},
child: Widget.Label({
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.microphone.is_muted ? "󰍭" : "󰍬");
});
},
}),
}),
],
});
children: [
Widget.Button({
tooltip_text: "Toggle Wifi",
expand: true,
setup: (self) => {
self.hook(network, () => {
return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? "disabled" : ""}`);
});
},
on_primary_click: () => network.toggleWifi(),
child: Widget.Label({
class_name: "txt-icon",
setup: (self) => {
self.hook(network, () => {
return (self.label = network.wifi.enabled ? "󰤨" : "󰤭");
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Bluetooth",
expand: true,
class_name: bluetooth
.bind("enabled")
.as(
(btOn) => `dashboard-button bluetooth ${!btOn ? "disabled" : ""}`,
),
on_primary_click: () => bluetooth.toggle(),
child: Widget.Label({
class_name: "txt-icon",
label: bluetooth.bind("enabled").as((btOn) => (btOn ? "󰂯" : "󰂲")),
}),
}),
Widget.Button({
tooltip_text: "Toggle Notifications",
expand: true,
class_name: notifications
.bind("dnd")
.as(
(dnd) => `dashboard-button notifications ${dnd ? "disabled" : ""}`,
),
on_primary_click: () => (notifications.dnd = !notifications.dnd),
child: Widget.Label({
class_name: "txt-icon",
label: notifications.bind("dnd").as((dnd) => (dnd ? "󰂛" : "󰂚")),
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Playback)",
expand: true,
on_primary_click: () =>
(audio.speaker.is_muted = !audio.speaker.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? "disabled" : ""}`);
});
},
child: Widget.Label({
class_name: "txt-icon",
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.speaker.is_muted ? "󰖁" : "󰕾");
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Microphone)",
expand: true,
on_primary_click: () =>
(audio.microphone.is_muted = !audio.microphone.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? "disabled" : ""}`);
});
},
child: Widget.Label({
class_name: "txt-icon",
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.microphone.is_muted ? "󰍭" : "󰍬");
});
},
}),
}),
],
});
};
export { Controls };

View File

@@ -88,7 +88,7 @@ const Shortcuts = () => {
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: left.shortcut1.icon.bind("value"),
}),
}),
@@ -99,7 +99,7 @@ const Shortcuts = () => {
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: left.shortcut2.icon.bind("value"),
}),
}),
@@ -117,7 +117,7 @@ const Shortcuts = () => {
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
hpack: "center",
class_name: "button-label",
class_name: "button-label txt-icon",
label: left.shortcut3.icon.bind("value"),
}),
}),
@@ -128,7 +128,7 @@ const Shortcuts = () => {
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: left.shortcut4.icon.bind("value"),
}),
}),
@@ -152,7 +152,7 @@ const Shortcuts = () => {
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: right.shortcut1.icon.bind("value"),
}),
}),
@@ -164,7 +164,7 @@ const Shortcuts = () => {
App.toggleWindow("settings-dialog");
},
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: "󰒓",
}),
}),
@@ -181,7 +181,7 @@ const Shortcuts = () => {
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: right.shortcut3.icon.bind("value"),
}),
}),
@@ -206,7 +206,7 @@ const Shortcuts = () => {
});
},
child: Widget.Label({
class_name: "button-label",
class_name: "button-label txt-icon",
label: "󰑊",
}),
}),

View File

@@ -128,7 +128,10 @@ const Stats = () => {
);
}
}),
label: "󰢮",
child: Widget.Label({
class_name: "txt-icon",
label: "󰢮",
})
}),
Widget.Button({
on_primary_click: terminal.bind("value").as(term => {
@@ -227,7 +230,10 @@ const Stats = () => {
);
}
}),
label: "",
child: Widget.Label({
class_name: "txt-icon",
label: "",
})
}),
Widget.Button({
on_primary_click: terminal.bind("value").as(term => {
@@ -273,7 +279,10 @@ const Stats = () => {
);
}
}),
label: "",
child: Widget.Label({
class_name: "txt-icon",
label: "",
})
}),
Widget.Button({
on_primary_click: terminal.bind("value").as(term => {
@@ -318,7 +327,10 @@ const Stats = () => {
);
}
}),
label: "󰋊",
child: Widget.Label({
class_name: "txt-icon",
label: "󰋊",
})
}),
Widget.Button({
on_primary_click: terminal.bind("value").as(term => {