From 97f24c894b79a388435b7f2befecdf4694eb9487 Mon Sep 17 00:00:00 2001 From: biscuit Date: Tue, 13 May 2025 19:53:24 -0500 Subject: [PATCH] added ags essentials --- packages/ags/custom/.gitignore | 2 ++ packages/ags/custom/app.ts | 10 ++++++++ packages/ags/custom/env.d.ts | 21 +++++++++++++++++ packages/ags/custom/package.json | 6 +++++ packages/ags/custom/style.scss | 20 ++++++++++++++++ packages/ags/custom/tsconfig.json | 14 +++++++++++ packages/ags/custom/widget/Bar.tsx | 31 +++++++++++++++++++++++++ packages/hyprland/custom/autostart.conf | 3 ++- 8 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 packages/ags/custom/.gitignore create mode 100644 packages/ags/custom/app.ts create mode 100644 packages/ags/custom/env.d.ts create mode 100644 packages/ags/custom/package.json create mode 100644 packages/ags/custom/style.scss create mode 100644 packages/ags/custom/tsconfig.json create mode 100644 packages/ags/custom/widget/Bar.tsx diff --git a/packages/ags/custom/.gitignore b/packages/ags/custom/.gitignore new file mode 100644 index 0000000..298eb4d --- /dev/null +++ b/packages/ags/custom/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +@girs/ diff --git a/packages/ags/custom/app.ts b/packages/ags/custom/app.ts new file mode 100644 index 0000000..83217ef --- /dev/null +++ b/packages/ags/custom/app.ts @@ -0,0 +1,10 @@ +import { App } from "astal/gtk3" +import style from "./style.scss" +import Bar from "./widget/Bar" + +App.start({ + css: style, + main() { + App.get_monitors().map(Bar) + }, +}) diff --git a/packages/ags/custom/env.d.ts b/packages/ags/custom/env.d.ts new file mode 100644 index 0000000..467c0a4 --- /dev/null +++ b/packages/ags/custom/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/packages/ags/custom/package.json b/packages/ags/custom/package.json new file mode 100644 index 0000000..23b6342 --- /dev/null +++ b/packages/ags/custom/package.json @@ -0,0 +1,6 @@ +{ + "name": "astal-shell", + "dependencies": { + "astal": "/home/biscuit/.local/share/ags" + } +} diff --git a/packages/ags/custom/style.scss b/packages/ags/custom/style.scss new file mode 100644 index 0000000..1d0d3a9 --- /dev/null +++ b/packages/ags/custom/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/packages/ags/custom/tsconfig.json b/packages/ags/custom/tsconfig.json new file mode 100644 index 0000000..9471e35 --- /dev/null +++ b/packages/ags/custom/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/gtk3", + } +} diff --git a/packages/ags/custom/widget/Bar.tsx b/packages/ags/custom/widget/Bar.tsx new file mode 100644 index 0000000..0384535 --- /dev/null +++ b/packages/ags/custom/widget/Bar.tsx @@ -0,0 +1,31 @@ +import { App, Astal, Gtk, Gdk } from "astal/gtk3" +import { Variable } from "astal" + +const time = Variable("").poll(1000, "date") + +export default function Bar(gdkmonitor: Gdk.Monitor) { + const { TOP, LEFT, RIGHT } = Astal.WindowAnchor + + return + + + + + + +} diff --git a/packages/hyprland/custom/autostart.conf b/packages/hyprland/custom/autostart.conf index 5a1ee9a..a6ba0b4 100644 --- a/packages/hyprland/custom/autostart.conf +++ b/packages/hyprland/custom/autostart.conf @@ -4,8 +4,9 @@ # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: +$terminal = kitty -# exec-once = $terminal +exec-once = $terminal # exec-once = nm-applet & # exec-once = waybar & hyprpaper & firefox