commit d5a52891d06b8c7bef830940b7f53f30f11c4b27 Author: Dave Damage Date: Mon Nov 10 09:26:56 2025 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..298eb4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +@girs/ diff --git a/app.ts b/app.ts new file mode 100644 index 0000000..51d536f --- /dev/null +++ b/app.ts @@ -0,0 +1,10 @@ +import app from "ags/gtk4/app" +import style from "./style.scss" +import Bar from "./widget/Bar" + +app.start({ + css: style, + main() { + app.get_monitors().map(Bar) + }, +}) diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..792ebfd --- /dev/null +++ b/env.d.ts @@ -0,0 +1,21 @@ +declare const SRC: string + +declare module "inline:*" { + const content: string + export default content +} + +declare module "*.scss" { + const content: string + export default content +} + +declare module "*.blp" { + const content: string + export default content +} + +declare module "*.css" { + const content: string + export default content +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..cbf736c --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "dependencies": { + "ags": "*", + "gnim": "*" + }, + "prettier": { + "semi": false, + "tabWidth": 2 + } +} diff --git a/style.scss b/style.scss new file mode 100644 index 0000000..2cc2a19 --- /dev/null +++ b/style.scss @@ -0,0 +1,20 @@ +// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss +$fg-color: #{"@theme_fg_color"}; +$bg-color: #{"@theme_bg_color"}; + +window.Bar { + background: transparent; + color: $fg-color; + font-weight: bold; + + > centerbox { + background: $bg-color; + border-radius: 10px; + margin: 8px; + } + + button { + border-radius: 8px; + margin: 2px; + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..2bb1f01 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "strict": true, + "module": "ES2022", + "target": "ES2020", + "lib": ["ES2023"], + "moduleResolution": "Bundler", + // "checkJs": true, + // "allowJs": true, + "jsx": "react-jsx", + "jsxImportSource": "ags/gtk4" + } +} diff --git a/widget/Bar.tsx b/widget/Bar.tsx new file mode 100644 index 0000000..56aa86a --- /dev/null +++ b/widget/Bar.tsx @@ -0,0 +1,39 @@ +import app from "ags/gtk4/app" +import { Astal, Gtk, Gdk } from "ags/gtk4" +import { execAsync } from "ags/process" +import { createPoll } from "ags/time" + +export default function Bar(gdkmonitor: Gdk.Monitor) { + const time = createPoll("", 1000, "date") + const { TOP, LEFT, RIGHT } = Astal.WindowAnchor + + return ( + + + + + + + + + ) +}