AGS init
This commit is contained in:
parent
d2839a8d6b
commit
7d61089ad9
8 changed files with 130 additions and 0 deletions
2
home/toph/common/optional/hyprland/ags/.gitignore
vendored
Normal file
2
home/toph/common/optional/hyprland/ags/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
node_modules/
|
||||
@girs/
|
10
home/toph/common/optional/hyprland/ags/app.ts
Normal file
10
home/toph/common/optional/hyprland/ags/app.ts
Normal file
|
@ -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)
|
||||
},
|
||||
})
|
32
home/toph/common/optional/hyprland/ags/default.nix
Normal file
32
home/toph/common/optional/hyprland/ags/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
let
|
||||
extraPkgs = with pkgs; [
|
||||
fzf
|
||||
];
|
||||
|
||||
agsPkgs = with inputs.ags.packages.${pkgs.system}; [
|
||||
apps
|
||||
bluetooth
|
||||
greet
|
||||
hyprland
|
||||
mpris
|
||||
network
|
||||
notifd
|
||||
tray
|
||||
wireplumber
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [ inputs.ags.homeManagerModules.default ];
|
||||
|
||||
home.packages = [ inputs.astal.packages.${pkgs.system}.default ] ++ extraPkgs;
|
||||
|
||||
programs.ags = {
|
||||
enable = true;
|
||||
|
||||
configDir = ../ags;
|
||||
|
||||
# additional packages to add to gjs's runtime
|
||||
extraPackages = extraPkgs ++ agsPkgs;
|
||||
};
|
||||
}
|
21
home/toph/common/optional/hyprland/ags/env.d.ts
vendored
Normal file
21
home/toph/common/optional/hyprland/ags/env.d.ts
vendored
Normal file
|
@ -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
|
||||
}
|
6
home/toph/common/optional/hyprland/ags/package.json
Normal file
6
home/toph/common/optional/hyprland/ags/package.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "astal-shell",
|
||||
"dependencies": {
|
||||
"astal": "/home/toph/.local/share/ags"
|
||||
}
|
||||
}
|
20
home/toph/common/optional/hyprland/ags/style.scss
Normal file
20
home/toph/common/optional/hyprland/ags/style.scss
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
14
home/toph/common/optional/hyprland/ags/tsconfig.json
Normal file
14
home/toph/common/optional/hyprland/ags/tsconfig.json
Normal file
|
@ -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",
|
||||
}
|
||||
}
|
25
home/toph/common/optional/hyprland/ags/widget/Bar.tsx
Normal file
25
home/toph/common/optional/hyprland/ags/widget/Bar.tsx
Normal file
|
@ -0,0 +1,25 @@
|
|||
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>
|
||||
);
|
||||
}
|
Loading…
Add table
Reference in a new issue