Added more configuration options
This commit is contained in:
@@ -7,7 +7,7 @@ export default () => {
|
||||
name: "audiomenu",
|
||||
transition: "crossfade",
|
||||
child: Widget.Box({
|
||||
class_name: "menu-items",
|
||||
class_name: "menu-items audio",
|
||||
hpack: "fill",
|
||||
hexpand: true,
|
||||
child: Widget.Box({
|
||||
|
||||
@@ -6,7 +6,7 @@ export default () => {
|
||||
name: "bluetoothmenu",
|
||||
transition: "crossfade",
|
||||
child: Widget.Box({
|
||||
class_name: "menu-items",
|
||||
class_name: "menu-items bluetooth",
|
||||
hpack: "fill",
|
||||
hexpand: true,
|
||||
child: Widget.Box({
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import icons from "../../../icons/index.js";
|
||||
import powermenu from "../../power/helpers/actions.js";
|
||||
|
||||
import options from "options";
|
||||
const { image, name } = options.menus.dashboard.powermenu.avatar;
|
||||
|
||||
const Profile = () => {
|
||||
const handleClick = (action) => {
|
||||
App.closeWindow("dashboardmenu");
|
||||
return powermenu.action(action);
|
||||
}
|
||||
};
|
||||
|
||||
return Widget.Box({
|
||||
class_name: "profiles-container",
|
||||
@@ -20,12 +23,17 @@ const Profile = () => {
|
||||
Widget.Icon({
|
||||
hpack: "center",
|
||||
class_name: "profile-picture",
|
||||
icon: `${App.configDir}/assets/21210205.png`,
|
||||
icon: image.bind("value"),
|
||||
}),
|
||||
Widget.Label({
|
||||
hpack: "center",
|
||||
class_name: "profile-name",
|
||||
label: "Jaskir Linux",
|
||||
label: name.bind("value").as((v) => {
|
||||
if (v === "system") {
|
||||
return Utils.exec("bash -c whoami");
|
||||
}
|
||||
return v;
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
const hyprland = await Service.import("hyprland");
|
||||
import options from "options";
|
||||
|
||||
const { left, right } = options.menus.dashboard.shortcuts;
|
||||
|
||||
const Shortcuts = () => {
|
||||
const isRecording = Variable(false, {
|
||||
@@ -83,21 +86,25 @@ const Shortcuts = () => {
|
||||
hexpand: true,
|
||||
children: [
|
||||
Widget.Button({
|
||||
tooltip_text: "Microsoft Edge",
|
||||
class_name: "dashboard-button edge top-button",
|
||||
on_primary_click: () => handleClick("microsoft-edge-stable"),
|
||||
tooltip_text: left.shortcut1.tooltip.bind("value"),
|
||||
class_name: "dashboard-button top-button",
|
||||
on_primary_click: left.shortcut1.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: left.shortcut1.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
Widget.Button({
|
||||
tooltip_text: "Spotify",
|
||||
class_name: "dashboard-button spotify",
|
||||
on_primary_click: () => handleClick("spotify-launcher"),
|
||||
tooltip_text: left.shortcut2.tooltip.bind("value"),
|
||||
class_name: "dashboard-button",
|
||||
on_primary_click: left.shortcut2.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: left.shortcut2.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
@@ -107,22 +114,26 @@ const Shortcuts = () => {
|
||||
hexpand: true,
|
||||
children: [
|
||||
Widget.Button({
|
||||
tooltip_text: "Discord",
|
||||
class_name: "dashboard-button discord top-button",
|
||||
on_primary_click: () => handleClick("discord"),
|
||||
tooltip_text: left.shortcut3.tooltip.bind("value"),
|
||||
class_name: "dashboard-button top-button",
|
||||
on_primary_click: left.shortcut3.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
hpack: "center",
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: left.shortcut3.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
Widget.Button({
|
||||
tooltip_text: "Search Apps",
|
||||
class_name: "dashboard-button search",
|
||||
on_primary_click: () => handleClick("rofi -show drun"),
|
||||
tooltip_text: left.shortcut4.tooltip.bind("value"),
|
||||
class_name: "dashboard-button",
|
||||
on_primary_click: left.shortcut4.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: left.shortcut4.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
@@ -139,24 +150,25 @@ const Shortcuts = () => {
|
||||
hexpand: true,
|
||||
children: [
|
||||
Widget.Button({
|
||||
tooltip_text: "Color Picker",
|
||||
class_name: "dashboard-button colorpicker top-button",
|
||||
on_primary_click: () => handleClick("hyprpicker -a", {}, 500),
|
||||
tooltip_text: right.shortcut1.tooltip.bind("value"),
|
||||
class_name: "dashboard-button top-button",
|
||||
on_primary_click: right.shortcut1.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: right.shortcut1.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
Widget.Button({
|
||||
tooltip_text: "Hyprland Settings",
|
||||
class_name: "dashboard-button settings",
|
||||
on_primary_click: () =>
|
||||
handleClick(
|
||||
'bash -c "kitty -e nvim $HOME/.config/hypr/hyprland.conf"',
|
||||
),
|
||||
tooltip_text: right.shortcut2.tooltip.bind("value"),
|
||||
class_name: "dashboard-button",
|
||||
on_primary_click: right.shortcut2.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: right.shortcut2.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
@@ -166,13 +178,14 @@ const Shortcuts = () => {
|
||||
hexpand: true,
|
||||
children: [
|
||||
Widget.Button({
|
||||
tooltip_text: "Screenshot",
|
||||
class_name: "dashboard-button snapshot top-button",
|
||||
on_primary_click: () =>
|
||||
handleClick(`${App.configDir}/services/snapshot.sh`),
|
||||
tooltip_text: right.shortcut3.tooltip.bind("value"),
|
||||
class_name: "dashboard-button top-button",
|
||||
on_primary_click: right.shortcut3.command
|
||||
.bind("value")
|
||||
.as((cmd) => () => handleClick(cmd)),
|
||||
child: Widget.Label({
|
||||
class_name: "button-label",
|
||||
label: "",
|
||||
label: right.shortcut3.icon.bind("value"),
|
||||
}),
|
||||
}),
|
||||
Widget.Button({
|
||||
|
||||
@@ -7,7 +7,7 @@ export default () => {
|
||||
name: "energymenu",
|
||||
transition: "crossfade",
|
||||
child: Widget.Box({
|
||||
class_name: "menu-items",
|
||||
class_name: "menu-items energy",
|
||||
hpack: "fill",
|
||||
hexpand: true,
|
||||
child: Widget.Box({
|
||||
|
||||
@@ -6,7 +6,7 @@ export default () => {
|
||||
name: "mediamenu",
|
||||
transition: "crossfade",
|
||||
child: Widget.Box({
|
||||
class_name: "menu-items",
|
||||
class_name: "menu-items media",
|
||||
hpack: "fill",
|
||||
hexpand: true,
|
||||
child: Widget.Box({
|
||||
|
||||
@@ -21,41 +21,43 @@ const Ethernet = () => {
|
||||
child: Widget.Box({
|
||||
class_name: "menu-content",
|
||||
vertical: true,
|
||||
child: network.bind("wired").as((wired) => {
|
||||
return Widget.Box({
|
||||
class_name: "network-element-item",
|
||||
child: Widget.Box({
|
||||
hpack: "start",
|
||||
children: [
|
||||
Widget.Icon({
|
||||
class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`,
|
||||
tooltip_text: wired.internet,
|
||||
icon: `${wired["icon_name"]}`,
|
||||
}),
|
||||
Widget.Box({
|
||||
class_name: "connection-container",
|
||||
vertical: true,
|
||||
children: [
|
||||
Widget.Label({
|
||||
class_name: "active-connection",
|
||||
hpack: "start",
|
||||
truncate: "end",
|
||||
wrap: true,
|
||||
label: `Ethernet Connection ${wired.state !== "unknown" && typeof wired?.speed === "number" ? `(${wired?.speed / 1000} Gbps)` : ""}`,
|
||||
}),
|
||||
Widget.Label({
|
||||
hpack: "start",
|
||||
class_name: "connection-status dim",
|
||||
label:
|
||||
wired.internet.charAt(0).toUpperCase() +
|
||||
wired.internet.slice(1),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
setup: (self) => {
|
||||
self.hook(network, () => {
|
||||
return (self.child = Widget.Box({
|
||||
class_name: "network-element-item",
|
||||
child: Widget.Box({
|
||||
hpack: "start",
|
||||
children: [
|
||||
Widget.Icon({
|
||||
class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`,
|
||||
tooltip_text: network.wired.internet,
|
||||
icon: `${network.wired["icon_name"]}`,
|
||||
}),
|
||||
Widget.Box({
|
||||
class_name: "connection-container",
|
||||
vertical: true,
|
||||
children: [
|
||||
Widget.Label({
|
||||
class_name: "active-connection",
|
||||
hpack: "start",
|
||||
truncate: "end",
|
||||
wrap: true,
|
||||
label: `Ethernet Connection ${network.wired.state !== "unknown" && typeof network.wired?.speed === "number" ? `(${network.wired?.speed / 1000} Gbps)` : ""}`,
|
||||
}),
|
||||
Widget.Label({
|
||||
hpack: "start",
|
||||
class_name: "connection-status dim",
|
||||
label:
|
||||
network.wired.internet.charAt(0).toUpperCase() +
|
||||
network.wired.internet.slice(1),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
}));
|
||||
});
|
||||
}),
|
||||
},
|
||||
}),
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -7,7 +7,7 @@ export default () => {
|
||||
name: "networkmenu",
|
||||
transition: "crossfade",
|
||||
child: Widget.Box({
|
||||
class_name: "menu-items",
|
||||
class_name: "menu-items network",
|
||||
child: Widget.Box({
|
||||
vertical: true,
|
||||
hexpand: true,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
const powerOptions = {
|
||||
sleep: "systemctl suspend",
|
||||
reboot: "systemctl reboot",
|
||||
logout: "pkill Hyprland",
|
||||
shutdown: "shutdown now",
|
||||
};
|
||||
import options from "options";
|
||||
const { sleep, reboot, logout, shutdown } = options.menus.dashboard.powermenu;
|
||||
|
||||
class PowerMenu extends Service {
|
||||
static {
|
||||
@@ -26,10 +22,10 @@ class PowerMenu extends Service {
|
||||
|
||||
action(action) {
|
||||
[this.#cmd, this.#title] = {
|
||||
sleep: [powerOptions.sleep, "Sleep"],
|
||||
reboot: [powerOptions.reboot, "Reboot"],
|
||||
logout: [powerOptions.logout, "Log Out"],
|
||||
shutdown: [powerOptions.shutdown, "Shutdown"],
|
||||
sleep: [sleep.value, "Sleep"],
|
||||
reboot: [reboot.value, "Reboot"],
|
||||
logout: [logout.value, "Log Out"],
|
||||
shutdown: [shutdown.value, "Shutdown"],
|
||||
}[action];
|
||||
|
||||
this.notify("cmd");
|
||||
|
||||
Reference in New Issue
Block a user