Added more configuration options

This commit is contained in:
Jas Singh
2024-07-20 16:21:52 -07:00
parent 29abe55008
commit a480400359
37 changed files with 368 additions and 417 deletions

View File

@@ -14,7 +14,6 @@ import { BarItemBox as WidgetContainer } from "../shared/barItemBox.js";
import options from "options"; import options from "options";
const { start, center, end } = options.bar.layout; const { start, center, end } = options.bar.layout;
const { transparent, position } = options.bar;
export type BarWidget = keyof typeof widget; export type BarWidget = keyof typeof widget;

View File

@@ -4,9 +4,10 @@ import { openMenu } from "../utils.js";
const BatteryLabel = () => { const BatteryLabel = () => {
const isVis = Variable(battery.available); const isVis = Variable(battery.available);
const icon = battery const icon = () =>
.bind("percent") battery
.as((p) => `battery-level-${Math.floor(p / 10) * 10}-symbolic`); .bind("percent")
.as((p) => `battery-level-${Math.floor(p / 10) * 10}-symbolic`);
battery.connect("changed", ({ available }) => { battery.connect("changed", ({ available }) => {
isVis.value = available; isVis.value = available;
@@ -36,19 +37,22 @@ const BatteryLabel = () => {
class_name: "battery", class_name: "battery",
visible: battery.bind("available"), visible: battery.bind("available"),
tooltip_text: battery.bind("time_remaining").as((t) => t.toString()), tooltip_text: battery.bind("time_remaining").as((t) => t.toString()),
children: [
Widget.Icon({ icon }),
Widget.Label({
label: battery.bind("percent").as((p) => ` ${p}%`),
}),
],
setup: (self) => { setup: (self) => {
self.hook(battery, () => { self.hook(battery, () => {
self.tooltip_text = generateTooltip( if (battery.available) {
battery.time_remaining, self.children = [
battery.charging, Widget.Icon({ icon: icon() }),
battery.charged, Widget.Label({
); label: battery.bind("percent").as((p) => ` ${p}%`),
}),
];
self.tooltip_text = generateTooltip(
battery.time_remaining,
battery.charging,
battery.charged,
);
}
}); });
}, },
}), }),

View File

@@ -1,4 +1,5 @@
const bluetooth = await Service.import('bluetooth') const bluetooth = await Service.import('bluetooth')
import options from "options";
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
const Bluetooth = () => { const Bluetooth = () => {
@@ -8,7 +9,13 @@ const Bluetooth = () => {
}); });
const btText = Widget.Label({ const btText = Widget.Label({
label: bluetooth.bind("enabled").as((v) => v ? " On" : " Off"), label: Utils.merge([bluetooth.bind("enabled"), options.bar.bluetooth.label.bind("value")], (btEnabled, showLabel) => {
if (showLabel) {
return btEnabled ? " On" : " Off"
}
return "";
}),
class_name: "bar-bt_label", class_name: "bar-bt_label",
}); });

View File

@@ -1,14 +1,18 @@
import GLib from "gi://GLib";
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
import options from "options";
const { format } = options.bar.clock;
const date = Variable("", { const date = Variable(GLib.DateTime.new_now_local(), {
poll: [1000, 'date "+󰃭 %a %b %d  %I:%M:%S %p"'], poll: [1000, () => GLib.DateTime.new_now_local()],
}); });
const time = Utils.derive([date, format], (c, f) => c.format(f) || "");
const Clock = () => { const Clock = () => {
return { return {
component: Widget.Label({ component: Widget.Label({
class_name: "clock", class_name: "clock",
label: date.bind(), label: time.bind(),
}), }),
isVisible: true, isVisible: true,
boxClass: "clock", boxClass: "clock",

View File

@@ -1,113 +0,0 @@
import { Menu } from "./menu/index.js";
import { Workspaces } from "./workspaces/index.js";
import { ClientTitle } from "./window_title/index.js";
import { Media } from "./media/index.js";
import { Notifications } from "./notifications/index.js";
import { Volume } from "./volume/index.js";
import { Network } from "./network/index.js";
import { Bluetooth } from "./bluetooth/index.js";
import { BatteryLabel } from "./battery/index.js";
import { Clock } from "./clock/index.js";
import { SysTray } from "./systray/index.js";
import { BarItemBox } from "../shared/barItemBox.js";
// layout of the bar
const Left = (monitor, wsMap) => {
return Widget.Box({
class_name: "box-left",
hpack: "start",
spacing: 5,
children: [BarItemBox(Menu()), BarItemBox(Workspaces(monitor, wsMap, 10)), BarItemBox(ClientTitle())],
});
};
const Center = () => {
return Widget.Box({
class_name: "box-center",
spacing: 5,
children: [
BarItemBox(Media()),
],
});
};
const Right = () => {
return Widget.Box({
class_name: "box-right",
hpack: "end",
spacing: 5,
children: [
BarItemBox(Volume()),
BarItemBox(Network()),
BarItemBox(Bluetooth()),
BarItemBox(BatteryLabel()),
BarItemBox(SysTray()),
BarItemBox(Clock()),
BarItemBox(Notifications()),
],
});
};
const LeftAlt = (monitor, wsMap) => {
return Widget.Box({
class_name: "box-left",
hpack: "start",
spacing: 5,
children: [BarItemBox(Menu()), BarItemBox(Workspaces(monitor, wsMap)), BarItemBox(ClientTitle())],
});
};
const CenterAlt = () => {
return Widget.Box({
class_name: "box-center",
spacing: 5,
children: [
BarItemBox(Media()),
],
});
};
const RightAlt = () => {
return Widget.Box({
class_name: "box-right",
hpack: "end",
spacing: 5,
children: [
BarItemBox(Volume()),
BarItemBox(Clock()),
],
});
};
const Bar = (monitor = 0, wsMap) => {
return Widget.Window({
name: `bar-${monitor}`,
class_name: "bar",
monitor,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
start_widget: Left(monitor, wsMap),
center_widget: Center(),
end_widget: Right(),
}),
});
};
const BarAlt = (monitor = 0, wsMap) => {
return Widget.Window({
name: `bar-${monitor}`,
class_name: "bar",
monitor,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
start_widget: LeftAlt(monitor, wsMap),
center_widget: CenterAlt(),
end_widget: RightAlt(),
}),
});
};
export { Bar, BarAlt };

View File

@@ -1,11 +1,12 @@
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
import options from "options";
const Menu = () => { const Menu = () => {
return { return {
component: Widget.Box({ component: Widget.Box({
child: Widget.Label({ child: Widget.Label({
class_name: "bar-menu_label", class_name: "bar-menu_label",
label: "󰣇", label: options.bar.launcher.icon.bind("value"),
}), }),
}), }),
isVisible: true, isVisible: true,

View File

@@ -1,4 +1,5 @@
const network = await Service.import("network"); const network = await Service.import("network");
import options from "options";
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
const Network = () => { const Network = () => {
@@ -22,7 +23,15 @@ const Network = () => {
}), }),
Widget.Label({ Widget.Label({
class_name: "bar-network-label", class_name: "bar-network-label",
label: network.bind("wired").as(() => " Wired"), label: Utils.merge(
[network.bind("wired"), options.bar.network.label.bind("value")],
(_, showLabel) => {
if (showLabel) {
return " Wired";
}
return "";
},
),
}), }),
]; ];

View File

@@ -1,4 +1,7 @@
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
import options from "options";
const { show_total } = options.bar.notifications;
const notifs = await Service.import("notifications"); const notifs = await Service.import("notifications");
@@ -9,21 +12,27 @@ export const Notifications = () => {
child: Widget.Box({ child: Widget.Box({
hpack: "start", hpack: "start",
class_name: "bar-notifications", class_name: "bar-notifications",
child: Widget.Label({ children: Utils.merge(
hpack: "center", [notifs.bind("notifications"), notifs.bind("dnd"), show_total.bind("value")],
class_name: "bar-notifications-label", (notif, dnd, showTotal) => {
setup: (self) => { const notifIcon = Widget.Label({
self.hook(notifs, () => { hpack: "center",
if (notifs.dnd) { class_name: "bar-notifications-label",
return (self.label = "󰂛"); label: dnd ? "󰂛" : notif.length > 0 ? "󱅫" : "󰂚",
} else if (notifs.notifications.length > 0) {
return (self.label = "󱅫");
} else {
return (self.label = "󰂚");
}
}); });
const notifLabel = Widget.Label({
hpack: "center",
class_name: "bar-notifications-total",
label: notif.length.toString(),
});
if (showTotal) {
return [notifIcon, notifLabel];
}
return [notifIcon];
}, },
}), ),
}), }),
}), }),
isVisible: true, isVisible: true,

View File

@@ -1,18 +0,0 @@
export const Power = () => {
return {
component: Widget.Box({
child: Widget.Button({
class_name: "bar-powermenu",
child: Widget.Icon({
class_name: "bar-power_label",
icon: "system-shutdown-symbolic",
}),
}),
}),
isVisible: true,
boxClass: "power",
props: {
on_clicked: () => App.toggleWindow("powermenu"),
},
};
};

View File

@@ -1,27 +1,37 @@
const systemtray = await Service.import("systemtray"); const systemtray = await Service.import("systemtray");
import { bash } from "lib/utils";
import options from "options";
const { ignore } = options.bar.systray;
const SysTray = () => { const SysTray = () => {
const isVis = Variable(false); const isVis = Variable(false);
const items = systemtray.bind("items").as((items) => { const items = Utils.merge(
isVis.value = items.length > 0; [systemtray.bind("items"), ignore.bind("value")],
return items.map((item) => { (items, ignored) => {
if (item.menu !== undefined) { const filteredTray = items.filter(({ id }) => !ignored.includes(id));
item.menu["class_name"] = "systray-menu";
}
return Widget.Button({ isVis.value = filteredTray.length > 0;
cursor: "pointer",
child: Widget.Icon({ return filteredTray.map((item) => {
class_name: "systray-icon", if (item.menu !== undefined) {
icon: item.bind("icon"), item.menu["class_name"] = "systray-menu";
}), }
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event), return Widget.Button({
tooltip_markup: item.bind("tooltip_markup"), cursor: "pointer",
child: Widget.Icon({
class_name: "systray-icon",
icon: item.bind("icon"),
}),
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event),
tooltip_markup: item.bind("tooltip_markup"),
});
}); });
}); },
}); );
return { return {
component: Widget.Box({ component: Widget.Box({

View File

@@ -1,7 +1,8 @@
const audio = await Service.import("audio"); const audio = await Service.import("audio");
import { openMenu } from "../utils.js"; import { openMenu } from "../utils.js";
import options from "options";
import { globalMousePos } from "../../../globals.js"; import { globalMousePos } from "globals.js";
const Volume = () => { const Volume = () => {
const icons = { const icons = {
@@ -41,7 +42,12 @@ const Volume = () => {
component: Widget.Box({ component: Widget.Box({
vpack: "center", vpack: "center",
class_name: "volume", class_name: "volume",
children: [volIcn, volPct], children: options.bar.volume.label.bind("value").as((showLabel) => {
if (showLabel) {
return [volIcn, volPct];
}
return [volIcn];
}),
}), }),
isVisible: true, isVisible: true,
boxClass: "volume", boxClass: "volume",

View File

@@ -58,8 +58,46 @@ const Workspaces = (monitor = -1, ws = 8) => {
return Widget.Label({ return Widget.Label({
attribute: i, attribute: i,
vpack: "center", vpack: "center",
label: `${i}`, class_name: Utils.merge(
setup: (self) => [
options.bar.workspaces.show_icons.bind("value"),
options.bar.workspaces.icons.available.bind("value"),
options.bar.workspaces.icons.active.bind("value"),
options.bar.workspaces.icons.occupied.bind("value"),
],
(show_icons) => {
if (show_icons) {
return `workspace-icon`;
}
return "";
},
),
label: Utils.merge(
[
options.bar.workspaces.show_icons.bind("value"),
options.bar.workspaces.icons.available.bind("value"),
options.bar.workspaces.icons.active.bind("value"),
options.bar.workspaces.icons.occupied.bind("value"),
],
(showIcons, available, active, occupied) => {
if (showIcons) {
if (hyprland.active.workspace.id === i) {
return active;
}
if ((hyprland.getWorkspace(i)?.windows || 0) > 0) {
return occupied;
}
if (
monitor !== -1 &&
hyprland.getWorkspace(i)?.monitorID !== monitor
) {
return available;
}
}
return `${i}`;
},
),
setup: (self) => {
self.hook(hyprland, () => { self.hook(hyprland, () => {
self.toggleClassName( self.toggleClassName(
"active", "active",
@@ -69,13 +107,8 @@ const Workspaces = (monitor = -1, ws = 8) => {
"occupied", "occupied",
(hyprland.getWorkspace(i)?.windows || 0) > 0, (hyprland.getWorkspace(i)?.windows || 0) > 0,
); );
});
const isCurrentMonitor = },
monitor !== -1 &&
hyprland.getWorkspace(i)?.monitorID !== monitor;
self.toggleClassName("hidden", isCurrentMonitor);
}),
}); });
}); });
}, },

View File

@@ -7,7 +7,7 @@ export default () => {
name: "audiomenu", name: "audiomenu",
transition: "crossfade", transition: "crossfade",
child: Widget.Box({ child: Widget.Box({
class_name: "menu-items", class_name: "menu-items audio",
hpack: "fill", hpack: "fill",
hexpand: true, hexpand: true,
child: Widget.Box({ child: Widget.Box({

View File

@@ -6,7 +6,7 @@ export default () => {
name: "bluetoothmenu", name: "bluetoothmenu",
transition: "crossfade", transition: "crossfade",
child: Widget.Box({ child: Widget.Box({
class_name: "menu-items", class_name: "menu-items bluetooth",
hpack: "fill", hpack: "fill",
hexpand: true, hexpand: true,
child: Widget.Box({ child: Widget.Box({

View File

@@ -1,11 +1,14 @@
import icons from "../../../icons/index.js"; import icons from "../../../icons/index.js";
import powermenu from "../../power/helpers/actions.js"; import powermenu from "../../power/helpers/actions.js";
import options from "options";
const { image, name } = options.menus.dashboard.powermenu.avatar;
const Profile = () => { const Profile = () => {
const handleClick = (action) => { const handleClick = (action) => {
App.closeWindow("dashboardmenu"); App.closeWindow("dashboardmenu");
return powermenu.action(action); return powermenu.action(action);
} };
return Widget.Box({ return Widget.Box({
class_name: "profiles-container", class_name: "profiles-container",
@@ -20,12 +23,17 @@ const Profile = () => {
Widget.Icon({ Widget.Icon({
hpack: "center", hpack: "center",
class_name: "profile-picture", class_name: "profile-picture",
icon: `${App.configDir}/assets/21210205.png`, icon: image.bind("value"),
}), }),
Widget.Label({ Widget.Label({
hpack: "center", hpack: "center",
class_name: "profile-name", class_name: "profile-name",
label: "Jaskir Linux", label: name.bind("value").as((v) => {
if (v === "system") {
return Utils.exec("bash -c whoami");
}
return v;
}),
}), }),
], ],
}), }),

View File

@@ -1,4 +1,7 @@
const hyprland = await Service.import("hyprland"); const hyprland = await Service.import("hyprland");
import options from "options";
const { left, right } = options.menus.dashboard.shortcuts;
const Shortcuts = () => { const Shortcuts = () => {
const isRecording = Variable(false, { const isRecording = Variable(false, {
@@ -83,21 +86,25 @@ const Shortcuts = () => {
hexpand: true, hexpand: true,
children: [ children: [
Widget.Button({ Widget.Button({
tooltip_text: "Microsoft Edge", tooltip_text: left.shortcut1.tooltip.bind("value"),
class_name: "dashboard-button edge top-button", class_name: "dashboard-button top-button",
on_primary_click: () => handleClick("microsoft-edge-stable"), on_primary_click: left.shortcut1.command
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "󰇩", label: left.shortcut1.icon.bind("value"),
}), }),
}), }),
Widget.Button({ Widget.Button({
tooltip_text: "Spotify", tooltip_text: left.shortcut2.tooltip.bind("value"),
class_name: "dashboard-button spotify", class_name: "dashboard-button",
on_primary_click: () => handleClick("spotify-launcher"), on_primary_click: left.shortcut2.command
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "", label: left.shortcut2.icon.bind("value"),
}), }),
}), }),
], ],
@@ -107,22 +114,26 @@ const Shortcuts = () => {
hexpand: true, hexpand: true,
children: [ children: [
Widget.Button({ Widget.Button({
tooltip_text: "Discord", tooltip_text: left.shortcut3.tooltip.bind("value"),
class_name: "dashboard-button discord top-button", class_name: "dashboard-button top-button",
on_primary_click: () => handleClick("discord"), on_primary_click: left.shortcut3.command
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
hpack: "center", hpack: "center",
class_name: "button-label", class_name: "button-label",
label: "", label: left.shortcut3.icon.bind("value"),
}), }),
}), }),
Widget.Button({ Widget.Button({
tooltip_text: "Search Apps", tooltip_text: left.shortcut4.tooltip.bind("value"),
class_name: "dashboard-button search", class_name: "dashboard-button",
on_primary_click: () => handleClick("rofi -show drun"), on_primary_click: left.shortcut4.command
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "", label: left.shortcut4.icon.bind("value"),
}), }),
}), }),
], ],
@@ -139,24 +150,25 @@ const Shortcuts = () => {
hexpand: true, hexpand: true,
children: [ children: [
Widget.Button({ Widget.Button({
tooltip_text: "Color Picker", tooltip_text: right.shortcut1.tooltip.bind("value"),
class_name: "dashboard-button colorpicker top-button", class_name: "dashboard-button top-button",
on_primary_click: () => handleClick("hyprpicker -a", {}, 500), on_primary_click: right.shortcut1.command
.bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "", label: right.shortcut1.icon.bind("value"),
}), }),
}), }),
Widget.Button({ Widget.Button({
tooltip_text: "Hyprland Settings", tooltip_text: right.shortcut2.tooltip.bind("value"),
class_name: "dashboard-button settings", class_name: "dashboard-button",
on_primary_click: () => on_primary_click: right.shortcut2.command
handleClick( .bind("value")
'bash -c "kitty -e nvim $HOME/.config/hypr/hyprland.conf"', .as((cmd) => () => handleClick(cmd)),
),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "󰒓", label: right.shortcut2.icon.bind("value"),
}), }),
}), }),
], ],
@@ -166,13 +178,14 @@ const Shortcuts = () => {
hexpand: true, hexpand: true,
children: [ children: [
Widget.Button({ Widget.Button({
tooltip_text: "Screenshot", tooltip_text: right.shortcut3.tooltip.bind("value"),
class_name: "dashboard-button snapshot top-button", class_name: "dashboard-button top-button",
on_primary_click: () => on_primary_click: right.shortcut3.command
handleClick(`${App.configDir}/services/snapshot.sh`), .bind("value")
.as((cmd) => () => handleClick(cmd)),
child: Widget.Label({ child: Widget.Label({
class_name: "button-label", class_name: "button-label",
label: "󰄀", label: right.shortcut3.icon.bind("value"),
}), }),
}), }),
Widget.Button({ Widget.Button({

View File

@@ -7,7 +7,7 @@ export default () => {
name: "energymenu", name: "energymenu",
transition: "crossfade", transition: "crossfade",
child: Widget.Box({ child: Widget.Box({
class_name: "menu-items", class_name: "menu-items energy",
hpack: "fill", hpack: "fill",
hexpand: true, hexpand: true,
child: Widget.Box({ child: Widget.Box({

View File

@@ -6,7 +6,7 @@ export default () => {
name: "mediamenu", name: "mediamenu",
transition: "crossfade", transition: "crossfade",
child: Widget.Box({ child: Widget.Box({
class_name: "menu-items", class_name: "menu-items media",
hpack: "fill", hpack: "fill",
hexpand: true, hexpand: true,
child: Widget.Box({ child: Widget.Box({

View File

@@ -21,41 +21,43 @@ const Ethernet = () => {
child: Widget.Box({ child: Widget.Box({
class_name: "menu-content", class_name: "menu-content",
vertical: true, vertical: true,
child: network.bind("wired").as((wired) => { setup: (self) => {
return Widget.Box({ self.hook(network, () => {
class_name: "network-element-item", return (self.child = Widget.Box({
child: Widget.Box({ class_name: "network-element-item",
hpack: "start", child: Widget.Box({
children: [ hpack: "start",
Widget.Icon({ children: [
class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`, Widget.Icon({
tooltip_text: wired.internet, class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`,
icon: `${wired["icon_name"]}`, tooltip_text: network.wired.internet,
}), icon: `${network.wired["icon_name"]}`,
Widget.Box({ }),
class_name: "connection-container", Widget.Box({
vertical: true, class_name: "connection-container",
children: [ vertical: true,
Widget.Label({ children: [
class_name: "active-connection", Widget.Label({
hpack: "start", class_name: "active-connection",
truncate: "end", hpack: "start",
wrap: true, truncate: "end",
label: `Ethernet Connection ${wired.state !== "unknown" && typeof wired?.speed === "number" ? `(${wired?.speed / 1000} Gbps)` : ""}`, wrap: true,
}), label: `Ethernet Connection ${network.wired.state !== "unknown" && typeof network.wired?.speed === "number" ? `(${network.wired?.speed / 1000} Gbps)` : ""}`,
Widget.Label({ }),
hpack: "start", Widget.Label({
class_name: "connection-status dim", hpack: "start",
label: class_name: "connection-status dim",
wired.internet.charAt(0).toUpperCase() + label:
wired.internet.slice(1), network.wired.internet.charAt(0).toUpperCase() +
}), network.wired.internet.slice(1),
], }),
}), ],
], }),
}), ],
}),
}));
}); });
}), },
}), }),
}), }),
], ],

View File

@@ -7,7 +7,7 @@ export default () => {
name: "networkmenu", name: "networkmenu",
transition: "crossfade", transition: "crossfade",
child: Widget.Box({ child: Widget.Box({
class_name: "menu-items", class_name: "menu-items network",
child: Widget.Box({ child: Widget.Box({
vertical: true, vertical: true,
hexpand: true, hexpand: true,

View File

@@ -1,9 +1,5 @@
const powerOptions = { import options from "options";
sleep: "systemctl suspend", const { sleep, reboot, logout, shutdown } = options.menus.dashboard.powermenu;
reboot: "systemctl reboot",
logout: "pkill Hyprland",
shutdown: "shutdown now",
};
class PowerMenu extends Service { class PowerMenu extends Service {
static { static {
@@ -26,10 +22,10 @@ class PowerMenu extends Service {
action(action) { action(action) {
[this.#cmd, this.#title] = { [this.#cmd, this.#title] = {
sleep: [powerOptions.sleep, "Sleep"], sleep: [sleep.value, "Sleep"],
reboot: [powerOptions.reboot, "Reboot"], reboot: [reboot.value, "Reboot"],
logout: [powerOptions.logout, "Log Out"], logout: [logout.value, "Log Out"],
shutdown: [powerOptions.shutdown, "Shutdown"], shutdown: [shutdown.value, "Shutdown"],
}[action]; }[action];
this.notify("cmd"); this.notify("cmd");

View File

@@ -1,7 +1,4 @@
import { opt, mkOptions } from "lib/option" import { opt, mkOptions } from "lib/option"
import { distro } from "lib/variables"
import { icon } from "lib/utils"
import icons from "lib/icons"
const colors = { const colors = {
"rosewater": "#f5e0dc", "rosewater": "#f5e0dc",
@@ -36,6 +33,11 @@ const colors = {
const options = mkOptions(OPTIONS, { const options = mkOptions(OPTIONS, {
autotheme: opt(false), autotheme: opt(false),
theme: { theme: {
font: {
size: opt("1.2rem"),
name: opt("Ubuntu Nerd Font"),
weight: opt(600),
},
notification: { notification: {
background: opt(colors.mantle), background: opt(colors.mantle),
actions: { actions: {
@@ -129,13 +131,19 @@ const options = mkOptions(OPTIONS, {
background: opt(colors.base2), background: opt(colors.base2),
hover: opt(colors.surface1), hover: opt(colors.surface1),
icon: opt(colors.lavender), icon: opt(colors.lavender),
total: opt(colors.lavender)
}, },
}, },
menus: { menus: {
monochrome: opt(true), monochrome: opt(true),
background: opt(colors.crust), background: opt(colors.crust),
cards: opt(colors.base), cards: opt(colors.base),
border: opt(colors.surface0), border: {
size: opt("0.13 em"),
radius: opt("0.7em"),
card_radius: opt("0.4em"),
color: opt(colors.surface0)
},
text: opt(colors.text), text: opt(colors.text),
dimtext: opt(colors.surface2), dimtext: opt(colors.surface2),
feinttext: opt(colors.surface0), feinttext: opt(colors.surface0),
@@ -197,6 +205,12 @@ const options = mkOptions(OPTIONS, {
song: opt(colors.lavender), song: opt(colors.lavender),
artist: opt(colors.teal), artist: opt(colors.teal),
album: opt(colors.pink), album: opt(colors.pink),
background: {
color: opt(colors.crust),
},
border: {
color: opt(colors.surface0),
},
buttons: { buttons: {
inactive: opt(colors.surface2), inactive: opt(colors.surface2),
enabled: opt(colors.teal), enabled: opt(colors.teal),
@@ -305,7 +319,7 @@ const options = mkOptions(OPTIONS, {
active: opt(colors.sky) active: opt(colors.sky)
}, },
icons: { icons: {
passive: opt(colors.text), passive: opt(colors.overlay2),
active: opt(colors.sky), active: opt(colors.sky),
}, },
iconbutton: { iconbutton: {
@@ -502,7 +516,7 @@ const options = mkOptions(OPTIONS, {
notifications: { notifications: {
label: opt(colors.lavender), label: opt(colors.lavender),
no_notifications_label: opt(colors.surface0), no_notifications_label: opt(colors.surface0),
background: opt(colors.mantle), background: opt(colors.crust),
card: opt(colors.base), card: opt(colors.base),
border: opt(colors.surface0), border: opt(colors.surface0),
switch_divider: opt(colors.surface1), switch_divider: opt(colors.surface1),
@@ -518,13 +532,7 @@ const options = mkOptions(OPTIONS, {
} }
}, },
font: {
size: opt(13),
name: opt("Ubuntu Nerd Font"),
},
bar: { bar: {
position: opt<"top" | "bottom">("top"),
layout: { layout: {
start: opt<Array<import("modules/bar/Bar").BarWidget>>([ start: opt<Array<import("modules/bar/Bar").BarWidget>>([
"dashboard", "dashboard",
@@ -545,7 +553,7 @@ const options = mkOptions(OPTIONS, {
]), ]),
}, },
launcher: { launcher: {
icon: opt(icon(distro.logo, icons.ui.search)), icon: opt("󰣇"),
}, },
workspaces: { workspaces: {
show_icons: opt(false), show_icons: opt(false),
@@ -557,21 +565,14 @@ const options = mkOptions(OPTIONS, {
workspaces: opt(7), workspaces: opt(7),
monitorSpecific: opt(true), monitorSpecific: opt(true),
}, },
media: {
icon: opt(true),
label: opt(true),
},
volume: { volume: {
label: opt(true), label: opt(true),
}, },
network: { network: {
status: { label: opt(true),
show: opt(true),
type: opt<"status" | "connection">("connection"),
},
}, },
bluetooth: { bluetooth: {
status: opt(true), label: opt(true),
}, },
battery: { battery: {
show_label: opt(true), show_label: opt(true),
@@ -583,11 +584,7 @@ const options = mkOptions(OPTIONS, {
]), ]),
}, },
clock: { clock: {
icons: { format: opt("󰃭 %a %b %d  %I:%M:%S %p"),
clock: opt(true),
calendar: opt(true),
},
format: opt("%H:%M - %A %e."),
}, },
notifications: { notifications: {
show_total: opt(false) show_total: opt(false)
@@ -595,86 +592,55 @@ const options = mkOptions(OPTIONS, {
}, },
menus: { menus: {
border: {
enabled: opt(true),
size: opt(""),
outer_gap: opt(""),
inner_gap: opt(""),
radius: opt(""),
card_radius: opt(""),
},
dashboard: { dashboard: {
modules: opt([
"powermenu",
"shortcuts",
"controls",
"directories",
"monitor",
]),
order: {
primary: opt([
"powermenu",
"shortcuts",
"controls",
"directories",
"monitor",
]),
powermenu: opt([
"avatar",
"powermenu",
]),
monitor: opt([
"cpu",
"ram",
"gpu",
"disk",
])
},
powermenu: { powermenu: {
sleep: opt("systemctl suspend"), sleep: opt("systemctl suspend"),
reboot: opt("systemctl reboot"), reboot: opt("systemctl reboot"),
logout: opt("pkill Hyprland"), logout: opt("pkill Hyprland"),
shutdown: opt("shutdown now"), shutdown: opt("shutdown now"),
avatar: { avatar: {
image: opt<string>, image: opt("/home/jaskir/Pictures/Icons/900-900-max_catppuccin-mocha_hald8_GaussianRBF_lum1_shape96_near16.png"),
name: opt<"system" | string>("system"), name: opt<"system" | string>("system"),
}, },
}, },
shortcuts: { shortcuts: {
left: { left: {
shortcut1: { shortcut1: {
icon: opt(""), icon: opt("󰇩"),
command: opt("") tooltip: opt("Microsoft Edge"),
command: opt("microsoft-edge-stable")
}, },
shortcut2: { shortcut2: {
icon: opt(""), icon: opt(""),
command: opt("") tooltip: opt("Spotify"),
command: opt("spotify-launcher")
}, },
shortcut3: { shortcut3: {
icon: opt(""), icon: opt(""),
command: opt("") tooltip: opt("Discord"),
command: opt("discord")
}, },
shortcut4: { shortcut4: {
icon: opt(""), icon: opt(""),
command: opt("") tooltip: opt("Search Apps"),
command: opt("rofi -show drun")
}, },
}, },
right: { right: {
shortcut1: { shortcut1: {
icon: opt(""), icon: opt(""),
command: opt("") tooltip: opt("Color Picker"),
command: opt("hyprpicker -a")
}, },
shortcut2: { shortcut2: {
icon: opt(""), icon: opt("󰒓"),
command: opt("") tooltip: opt("Hyprland Config"),
command: opt("bash -c \"kitty -e nvim $HOME/.config/hypr/hyprland.conf\"")
}, },
shortcut3: { shortcut3: {
icon: opt(""), icon: opt("󰄀"),
command: opt("") tooltip: opt("Screenshot"),
}, command: opt("./services/snapshot.sh")
shortcut4: {
icon: opt(""),
command: opt("")
}, },
} }
}, },
@@ -709,43 +675,16 @@ const options = mkOptions(OPTIONS, {
} }
}, },
}, },
volume: {
order: opt([
"volume",
"devices",
])
},
network: { network: {
order: opt([
"ethernet",
"wifi",
]),
status: opt(true), status: opt(true),
}, },
bluetooth: { bluetooth: {
status: opt(true), status: opt(true),
}, },
battery: { battery: {
modules: opt([ percentage: opt(true)
"brightness",
"powerprofile"
]),
order: opt([
"brightness",
"powerprofile"
])
}, },
clock: { clock: {
modules: opt([
"clock",
"calendar",
"weather"
]),
order: opt([
"clock",
"calendar",
"weather"
]),
time: { time: {
military: opt(false), military: opt(false),
seconds: opt(true) seconds: opt(true)
@@ -767,15 +706,6 @@ const options = mkOptions(OPTIONS, {
monochromeIcon: opt(true), monochromeIcon: opt(true),
}, },
powermenu: {
sleep: opt("systemctl suspend"),
reboot: opt("systemctl reboot"),
logout: opt("pkill Hyprland"),
shutdown: opt("shutdown now"),
layout: opt<"line" | "box">("line"),
labels: opt(true),
},
osd: { osd: {
progress: { progress: {
vertical: opt(true), vertical: opt(true),

View File

@@ -1,9 +1,9 @@
@import '/home/jaskir/.config/ags/scss/variables.scss'; @import '/home/jaskir/.config/ags/scss/variables.scss';
* { * {
all: unset; all: unset;
font-family: "Ubuntu Nerd Font"; font-family: $font-name;
font-size: 1.2rem; font-size: $font-size;
font-weight: 600; font-weight: $font-weight;
} }
//general //general

View File

@@ -1,8 +1,8 @@
* { * {
all: unset; all: unset;
font-family: "Ubuntu Nerd Font"; font-family: $font-name;
font-size: 1.2rem; font-size: $font-size;
font-weight: 600; font-weight: $font-weight;
} }
//general //general

View File

@@ -37,7 +37,7 @@ function extractVariables(theme: any, prefix: string = ""): string[] {
} }
const variables = () => [ const variables = () => [
...extractVariables(options.theme) ...extractVariables(options.theme),
]; ];
async function resetCss() { async function resetCss() {

View File

@@ -5,3 +5,8 @@
font-size: 1.3em; font-size: 1.3em;
min-width: 1em; min-width: 1em;
} }
.bar-notifications-total {
color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-notifications-total);
margin-left: 0.4em;
}

View File

@@ -12,6 +12,10 @@
background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available); background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available);
color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available); color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available);
&:not(:first-child) {
margin-left: 4.5em;
}
&.occupied { &.occupied {
background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied); background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied);
color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied); color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied);
@@ -25,10 +29,16 @@
min-width: 12em; min-width: 12em;
min-height: 4em; min-height: 4em;
} }
&.workspace-icon {
background-color: transparent;
min-width: 0em;
min-height: 0em;
border-radius: 0em;
margin: 0rem 1rem * .5;
transition: 300ms * .5;
font-size: 1.1em;
}
} }
}
.workspaces label:not(:first-child) {
margin-left: 4.5em;
} }

View File

@@ -1,6 +1,10 @@
@import "../colors"; @import "../colors";
@import '../../variables'; @import '../../variables';
.menu-items.audio {
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-volume-background-color);
border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-volume-border-color);
}
.menu-dropdown-label.audio { .menu-dropdown-label.audio {
color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color); color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color);
} }
@@ -8,6 +12,9 @@
.menu-label.audio { .menu-label.audio {
color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color); color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color);
} }
.menu-active.playback, .menu-active.input {
color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-volume-text);
}
.menu-button-isactive.audio { .menu-button-isactive.audio {
color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-volume-icons-active); color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-volume-icons-active);

View File

@@ -1,6 +1,10 @@
@import "../colors"; @import "../colors";
@import '../../variables'; @import '../../variables';
.menu-items.bluetooth {
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-bluetooth-background-color);
border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-bluetooth-border-color);
}
.menu-items-container.bluetooth { .menu-items-container.bluetooth {
font-size: 1.3em; font-size: 1.3em;

View File

@@ -6,7 +6,7 @@
min-width: 27em; min-width: 27em;
min-height: 6em; min-height: 6em;
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-clock-background-color); background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-clock-background-color);
border: 0.13em solid if($bar-menus-monochrome, $bar-menus-border, $bar-menus-menu-clock-border-color); border: 0.13em solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-clock-border-color);
border-radius: 0.7em; border-radius: 0.7em;
margin-right: 0.5em; margin-right: 0.5em;
} }

View File

@@ -1,10 +1,11 @@
@import "../colors"; @import "../colors";
@import '../../variables';
.dashboard-content-items { .dashboard-content-items {
margin-left: 0.50em; margin-left: 0.50em;
min-width: 28.5em; min-width: 28.5em;
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-dashboard-background); background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-dashboard-background-color);
border: 0.13em solid if($bar-menus-monochrome, $bar-menus-border, $bar-menus-menu-dashboard-border-color); border: 0.13em solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-dashboard-border-color);
border-radius: 0.7em; border-radius: 0.7em;
button { button {

View File

@@ -1,6 +1,10 @@
@import "../colors"; @import "../colors";
@import '../../variables'; @import '../../variables';
.menu-items.energy {
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-battery-background-color);
border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-battery-border-color);
}
.menu-items-container.energy { .menu-items-container.energy {
.menu-label { .menu-label {
color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-battery-label-color); color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-battery-label-color);

View File

@@ -1,5 +1,10 @@
@import "../colors"; @import "../colors";
@import '../../variables';
.menu-items.media {
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-media-background-color);
border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-media-border-color);
}
.menu-items-container.media { .menu-items-container.media {
min-width: 23em; min-width: 23em;
min-height: 10em; min-height: 10em;

View File

@@ -1,3 +1,5 @@
@import '../../variables';
.menu-slider { .menu-slider {
trough { trough {
border-radius: 0.3rem; border-radius: 0.3rem;

View File

@@ -1,6 +1,11 @@
@import "../colors"; @import "../colors";
@import '../../variables'; @import '../../variables';
.menu-items.network {
background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-network-background-color);
border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-network-border-color);
}
.menu-items-container.network { .menu-items-container.network {
font-size: 1.3em; font-size: 1.3em;
.menu-items-section { .menu-items-section {
@@ -90,9 +95,8 @@
} }
.menu-icon-button.network.search { .menu-icon-button.network.search {
label { color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-network-iconbuttons-passive);
color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-network-iconbuttons-passive);
}
&:hover { &:hover {
color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-network-iconbuttons-active); color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-network-iconbuttons-active);
} }

View File

@@ -5,8 +5,8 @@
margin: 0em; margin: 0em;
min-width: 30.5em; min-width: 30.5em;
min-height: 48em; min-height: 48em;
background: $crust; background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-notifications-background);
border: 0.13em solid $notification-border; border: 0.13em solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-notifications-border);
border-radius: 0.7em; border-radius: 0.7em;
margin-right: 0.45em; margin-right: 0.45em;

View File

@@ -1,3 +1,6 @@
$font-size: 1.2rem;
$font-name: Ubuntu Nerd Font;
$font-weight: 600;
$notification-background: #181825; $notification-background: #181825;
$notification-actions-background: #313244; $notification-actions-background: #313244;
$notification-actions-hover: #45475a; $notification-actions-hover: #45475a;
@@ -60,10 +63,14 @@ $bar-buttons-clock-icon: #f5c2e7;
$bar-buttons-notifications-background: #242438; $bar-buttons-notifications-background: #242438;
$bar-buttons-notifications-hover: #45475a; $bar-buttons-notifications-hover: #45475a;
$bar-buttons-notifications-icon: #b4befe; $bar-buttons-notifications-icon: #b4befe;
$bar-menus-monochrome: false; $bar-buttons-notifications-total: #b4befe;
$bar-menus-monochrome: true;
$bar-menus-background: #11111b; $bar-menus-background: #11111b;
$bar-menus-cards: #1e1e2e; $bar-menus-cards: #1e1e2e;
$bar-menus-border: #313244; $bar-menus-border-size: 0.13 em;
$bar-menus-border-radius: 0.7em;
$bar-menus-border-card_radius: 0.4em;
$bar-menus-border-color: #313244;
$bar-menus-text: #cdd6f4; $bar-menus-text: #cdd6f4;
$bar-menus-dimtext: #585b70; $bar-menus-dimtext: #585b70;
$bar-menus-feinttext: #313244; $bar-menus-feinttext: #313244;
@@ -101,6 +108,8 @@ $bar-menus-tooltip-text: #cdd6f4;
$bar-menus-menu-media-song: #b4befe; $bar-menus-menu-media-song: #b4befe;
$bar-menus-menu-media-artist: #94e2d5; $bar-menus-menu-media-artist: #94e2d5;
$bar-menus-menu-media-album: #f5c2e7; $bar-menus-menu-media-album: #f5c2e7;
$bar-menus-menu-media-background-color: #11111b;
$bar-menus-menu-media-border-color: #313244;
$bar-menus-menu-media-buttons-inactive: #585b70; $bar-menus-menu-media-buttons-inactive: #585b70;
$bar-menus-menu-media-buttons-enabled: #94e2d5; $bar-menus-menu-media-buttons-enabled: #94e2d5;
$bar-menus-menu-media-buttons-background: #b4befe; $bar-menus-menu-media-buttons-background: #b4befe;
@@ -152,7 +161,7 @@ $bar-menus-menu-bluetooth-switch-disabled: #313244;
$bar-menus-menu-bluetooth-switch-puck: #6c7086; $bar-menus-menu-bluetooth-switch-puck: #6c7086;
$bar-menus-menu-bluetooth-listitems-passive: #cdd6f4; $bar-menus-menu-bluetooth-listitems-passive: #cdd6f4;
$bar-menus-menu-bluetooth-listitems-active: #89dceb; $bar-menus-menu-bluetooth-listitems-active: #89dceb;
$bar-menus-menu-bluetooth-icons-passive: #cdd6f4; $bar-menus-menu-bluetooth-icons-passive: #9399b2;
$bar-menus-menu-bluetooth-icons-active: #89dceb; $bar-menus-menu-bluetooth-icons-active: #89dceb;
$bar-menus-menu-bluetooth-iconbutton-passive: #cdd6f4; $bar-menus-menu-bluetooth-iconbutton-passive: #cdd6f4;
$bar-menus-menu-bluetooth-iconbutton-active: #89dceb; $bar-menus-menu-bluetooth-iconbutton-active: #89dceb;
@@ -248,7 +257,7 @@ $bar-menus-menu-dashboard-monitors-disk-bar: #f5c2e7;
$bar-menus-menu-dashboard-monitors-disk-label: #f5c2e7; $bar-menus-menu-dashboard-monitors-disk-label: #f5c2e7;
$bar-menus-menu-notifications-label: #b4befe; $bar-menus-menu-notifications-label: #b4befe;
$bar-menus-menu-notifications-no_notifications_label: #313244; $bar-menus-menu-notifications-no_notifications_label: #313244;
$bar-menus-menu-notifications-background: #181825; $bar-menus-menu-notifications-background: #11111b;
$bar-menus-menu-notifications-card: #1e1e2e; $bar-menus-menu-notifications-card: #1e1e2e;
$bar-menus-menu-notifications-border: #313244; $bar-menus-menu-notifications-border: #313244;
$bar-menus-menu-notifications-switch_divider: #45475a; $bar-menus-menu-notifications-switch_divider: #45475a;