updating how the configs config

This commit is contained in:
Chris Cochrun 2024-07-01 10:09:52 -05:00
parent 7311597752
commit f5f047a6f5
6 changed files with 41 additions and 24 deletions

View file

@ -6,16 +6,42 @@ const audio = await Service.import('audio')
import { NotificationPopups } from "./notifications.js"
function map_workspaces(id) {
switch (id) {
case 1:
return Widget.Label("");
break;
case 2:
return Widget.Label("");
break;
case 3:
return Widget.Label("󰈙");
break;
case 4:
return Widget.Label("󰍨");
break;
case 5:
return Widget.Label("");
break;
case 9:
return Widget.Label("");
break;
default:
return Widget.Label(`${id}`);
}
}
function workspaces() {
const active = hyprland.active.workspace.bind("id");
const workspaces = hyprland.bind("workspaces")
.as(ws => ws.map(({ id }) => id === -99 ? "" : Widget.Button({
onClicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
child: map_workspaces(id),
class_name: active.as(i => `${i === id ? "focused" : ""}`),
})))
return Widget.Box({
class_name: "workspaces",
spacing: 6,
children: workspaces,
})
}