Build AGS scaffolding
This commit is contained in:
parent
2dd8b82621
commit
affd34475b
|
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules/
|
||||||
|
@girs/
|
||||||
|
|
@ -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)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
@use "palette" as *;
|
||||||
|
|
||||||
|
* {
|
||||||
|
all: unset;
|
||||||
|
font-family: $font-family;
|
||||||
|
font-size: $font-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Bar {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
background: $base01;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 8px;
|
||||||
|
padding: 4px 12px;
|
||||||
|
color: $base05;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
import { App, Astal, Gdk, Gtk } from "astal/gtk3"
|
||||||
|
|
||||||
|
export default function Bar(gdkmonitor: Gdk.Monitor) {
|
||||||
|
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor
|
||||||
|
|
||||||
|
return (
|
||||||
|
<window
|
||||||
|
className="Bar"
|
||||||
|
namespace="ags-bar"
|
||||||
|
gdkmonitor={gdkmonitor}
|
||||||
|
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
||||||
|
anchor={TOP | LEFT | RIGHT}
|
||||||
|
application={App}
|
||||||
|
>
|
||||||
|
<centerbox className="bar">
|
||||||
|
<box
|
||||||
|
className="bar-left"
|
||||||
|
halign={Gtk.Align.START}
|
||||||
|
valign={Gtk.Align.CENTER}
|
||||||
|
/>
|
||||||
|
<box
|
||||||
|
className="bar-center"
|
||||||
|
halign={Gtk.Align.CENTER}
|
||||||
|
valign={Gtk.Align.CENTER}
|
||||||
|
/>
|
||||||
|
<box
|
||||||
|
className="bar-right"
|
||||||
|
halign={Gtk.Align.END}
|
||||||
|
valign={Gtk.Align.CENTER}
|
||||||
|
/>
|
||||||
|
</centerbox>
|
||||||
|
</window>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.ags;
|
||||||
|
hyprlandCfg = config.modules.hyprland;
|
||||||
|
colors = config.lib.stylix.colors.withHashtag;
|
||||||
|
|
||||||
|
base16Names = [
|
||||||
|
"base00"
|
||||||
|
"base01"
|
||||||
|
"base02"
|
||||||
|
"base03"
|
||||||
|
"base04"
|
||||||
|
"base05"
|
||||||
|
"base06"
|
||||||
|
"base07"
|
||||||
|
"base08"
|
||||||
|
"base09"
|
||||||
|
"base0A"
|
||||||
|
"base0B"
|
||||||
|
"base0C"
|
||||||
|
"base0D"
|
||||||
|
"base0E"
|
||||||
|
"base0F"
|
||||||
|
];
|
||||||
|
|
||||||
|
palette = pkgs.writeText "palette.scss" (concatStringsSep "\n" (
|
||||||
|
map (name: "$" + name + ": " + colors.${name} + ";") base16Names
|
||||||
|
++ [
|
||||||
|
''$font-family: "${config.stylix.fonts.sansSerif.name}";''
|
||||||
|
"$font-size: ${toString config.stylix.fonts.sizes.desktop}px;"
|
||||||
|
]
|
||||||
|
));
|
||||||
|
|
||||||
|
astalDeps = with pkgs.astal; [
|
||||||
|
astal3
|
||||||
|
io
|
||||||
|
hyprland
|
||||||
|
network
|
||||||
|
battery
|
||||||
|
wireplumber
|
||||||
|
];
|
||||||
|
|
||||||
|
ags-bar = pkgs.ags.bundle {
|
||||||
|
pname = "ags-bar";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./app;
|
||||||
|
entry = "app.ts";
|
||||||
|
dependencies = astalDeps;
|
||||||
|
postUnpack = ''
|
||||||
|
cp ${palette} "$sourceRoot/palette.scss"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [
|
||||||
|
ags-bar
|
||||||
|
pkgs.ags
|
||||||
|
pkgs.dart-sass
|
||||||
|
];
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland = mkIf hyprlandCfg.enable {
|
||||||
|
settings.exec-once = [ "ags-bar" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./ags
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.nix
|
./dictation.nix
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.modules.ags = {
|
||||||
|
enable = mkEnableOption {
|
||||||
|
default = false;
|
||||||
|
description = "Enable the AGS status bar";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./ags.nix
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.nix
|
./dictation.nix
|
||||||
./display.nix
|
./display.nix
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
",preferred,auto,auto"
|
",preferred,auto,auto"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
modules.ags.enable = true;
|
||||||
modules.plasma.enable = false;
|
modules.plasma.enable = false;
|
||||||
modules.display.manager = "gdm";
|
modules.display.manager = "gdm";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue