summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mora Unie Youer <[email protected]>2025-03-02 12:14:41 +0300
committerLibravatar Mora Unie Youer <[email protected]>2025-03-02 12:14:41 +0300
commit47602a7cb4a5f3f63e5c812b95ac66004469dadc (patch)
tree15a39dc6bdb6cd6f1d86b1c2821fcce41a07f55b
downloadags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.tar.gz
ags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.tar.bz2
ags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.tar.lz
ags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.tar.xz
ags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.tar.zst
ags-config-47602a7cb4a5f3f63e5c812b95ac66004469dadc.zip
feat: initial commit
-rw-r--r--.gitignore2
-rw-r--r--app.ts10
-rw-r--r--env.d.ts21
-rw-r--r--package.json6
-rw-r--r--style.scss20
-rw-r--r--tsconfig.json14
-rw-r--r--widget/Bar.tsx36
7 files changed, 109 insertions, 0 deletions
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..7e8cc7c
--- /dev/null
+++ b/app.ts
@@ -0,0 +1,10 @@
+import { App } from "astal/gtk4"
+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..467c0a4
--- /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..2c0be3c
--- /dev/null
+++ b/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "astal-shell",
+ "dependencies": {
+ "astal": "/nix/store/nfa9g7rmnkn31fb2fgj3yd6kx2dskbr1-astal-gjs/share/astal/gjs"
+ }
+}
diff --git a/style.scss b/style.scss
new file mode 100644
index 0000000..1d0d3a9
--- /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..a92bc43
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "$schema": "https://json.schemastore.org/tsconfig",
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ "strict": true,
+ "target": "ES2022",
+ "module": "ES2022",
+ "moduleResolution": "Bundler",
+ // "checkJs": true,
+ // "allowJs": true,
+ "jsx": "react-jsx",
+ "jsxImportSource": "astal/gtk4",
+ }
+}
diff --git a/widget/Bar.tsx b/widget/Bar.tsx
new file mode 100644
index 0000000..c2db8c5
--- /dev/null
+++ b/widget/Bar.tsx
@@ -0,0 +1,36 @@
+import { App, Astal, Gtk, Gdk } from "astal/gtk4"
+import { Variable } from "astal"
+
+const time = Variable("").poll(1000, "date")
+
+export default function Bar(gdkmonitor: Gdk.Monitor) {
+ const { TOP, LEFT, RIGHT } = Astal.WindowAnchor
+
+ return <window
+ visible
+ cssClasses={["Bar"]}
+ gdkmonitor={gdkmonitor}
+ exclusivity={Astal.Exclusivity.EXCLUSIVE}
+ anchor={TOP | LEFT | RIGHT}
+ application={App}>
+ <centerbox cssName="centerbox">
+ <button
+ onClicked="echo hello"
+ hexpand
+ halign={Gtk.Align.CENTER}
+ >
+ Welcome to AGS!
+ </button>
+ <box />
+ <menubutton
+ hexpand
+ halign={Gtk.Align.CENTER}
+ >
+ <label label={time()} />
+ <popover>
+ <Gtk.Calendar />
+ </popover>
+ </menubutton>
+ </centerbox>
+ </window>
+}