mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 12:51:54 +05:30
feat: split scss and rename widget folder to widgets
This commit is contained in:
55
widgets/bar/index.tsx
Normal file
55
widgets/bar/index.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import { App, Astal, Gdk } from "astal/gtk4";
|
||||
import { FocusedClient, WorkspaceButton } from "./workspace";
|
||||
import { Battery } from "./battery";
|
||||
import { Launcher } from "./launcher";
|
||||
import { Tailscale } from "./tailscale";
|
||||
import { Tray } from "./tray";
|
||||
import { Time } from "./time";
|
||||
|
||||
export const WINDOW_NAME = "bar";
|
||||
|
||||
export const Bar = (gdkmonitor: Gdk.Monitor) => {
|
||||
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor;
|
||||
|
||||
return (
|
||||
<window
|
||||
name={WINDOW_NAME}
|
||||
visible
|
||||
cssClasses={["Bar"]}
|
||||
gdkmonitor={gdkmonitor}
|
||||
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
||||
anchor={TOP | LEFT | RIGHT}
|
||||
application={App}
|
||||
>
|
||||
<centerbox>
|
||||
<Start />
|
||||
<Center />
|
||||
<End />
|
||||
</centerbox>
|
||||
</window>
|
||||
);
|
||||
};
|
||||
|
||||
const Start = () => {
|
||||
return (
|
||||
<box spacing={15}>
|
||||
<Launcher />
|
||||
<WorkspaceButton />
|
||||
</box>
|
||||
);
|
||||
};
|
||||
|
||||
const Center = () => {
|
||||
return <FocusedClient />;
|
||||
};
|
||||
|
||||
const End = () => {
|
||||
return (
|
||||
<box spacing={15}>
|
||||
<Tailscale />
|
||||
<Battery />
|
||||
<Tray />
|
||||
<Time />
|
||||
</box>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user