Implement styling options for all the bar components (not menus) through options variables.

This commit is contained in:
Jas Singh
2024-07-17 01:44:50 -07:00
parent f4ff5bba27
commit 50eeb4275d
64 changed files with 783 additions and 2074 deletions

View File

@@ -1,4 +1,3 @@
const network = await Service.import("network");
import { Menu } from "./menu/index.js";
import { Workspaces } from "./workspaces/index.js";
import { ClientTitle } from "./window_title/index.js";

View File

@@ -53,6 +53,7 @@ const BatteryLabel = () => {
},
}),
isVis,
boxClass: "battery",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "energymenu");

View File

@@ -18,6 +18,7 @@ const Bluetooth = () => {
children: [btIcon, btText],
}),
isVisible: true,
boxClass: "bluetooth",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "bluetoothmenu");

View File

@@ -11,6 +11,7 @@ const Clock = () => {
label: date.bind(),
}),
isVisible: true,
boxClass: "clock",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "calendarmenu");

View File

@@ -86,6 +86,7 @@ const Media = () => {
}),
}),
isVisible: false,
boxClass: "media",
name: "media",
props: {
on_scroll_up: () => mpris.getPlayer("")?.next(),

View File

@@ -9,6 +9,7 @@ const Menu = () => {
}),
}),
isVisible: true,
boxClass: "dashboard",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "dashboardmenu");

View File

@@ -1,14 +1,14 @@
const network = await Service.import("network");
import { openMenu } from "../utils.js";
import { globalMousePos } from "../../../globals.js";
const Network = () => {
const wifiIndicator = [
Widget.Icon({
class_name: "bar-network-icon",
icon: network.wifi.bind("icon_name"),
}),
Widget.Label({
class_name: "bar-network-label",
label: network.wifi
.bind("ssid")
.as((ssid) => (ssid ? ` ${ssid}` : " --").substring(0, 7)),
@@ -16,8 +16,13 @@ const Network = () => {
];
const wiredIndicator = [
Widget.Icon({
class_name: "bar-network-icon",
icon: network.wired.bind("icon_name"),
}),
Widget.Label({
label: network.bind("wired").as(() => "󰈀 Wired"),
class_name: "bar-network-label",
label: network.bind("wired").as(() => " Wired"),
}),
];
@@ -30,6 +35,7 @@ const Network = () => {
.as((w) => (w === "wired" ? wiredIndicator : wifiIndicator)),
}),
isVisible: true,
boxClass: "network",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "networkmenu");

View File

@@ -27,6 +27,7 @@ export const Notifications = () => {
}),
}),
isVisible: true,
boxClass: "notifications",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "notificationsmenu");

View File

@@ -10,6 +10,7 @@ export const Power = () => {
}),
}),
isVisible: true,
boxClass: "power",
props: {
on_clicked: () => App.toggleWindow("powermenu"),
},

View File

@@ -29,6 +29,7 @@ const SysTray = () => {
children: items,
}),
isVisible: true,
boxClass: "systray",
isVis,
};
};

View File

@@ -44,6 +44,7 @@ const Volume = () => {
children: [volIcn, volPct],
}),
isVisible: true,
boxClass: "volume",
props: {
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "audiomenu");

View File

@@ -29,6 +29,7 @@ const ClientTitle = () => {
label: hyprland.active.bind("client").as((v) => filterTitle(v)),
}),
isVisible: true,
boxClass: "windowtitle",
};
};

View File

@@ -89,6 +89,7 @@ const Workspaces = (monitor = -1, ws = 8) => {
},
}),
isVisible: true,
boxClass: "workspaces",
};
};
export { Workspaces };