diff --git a/astal/style.scss b/astal/style.scss index 08172ec..522b9db 100644 --- a/astal/style.scss +++ b/astal/style.scss @@ -23,7 +23,7 @@ window.Bar { .status-box { background-color: $bg-color-6; padding: 0 4px; - margin: 0 4px; + margin: 0 2px; font-size: 16px; } @@ -31,6 +31,10 @@ window.Bar { background-color: $inactive-bg-color; } + .client-title label { + font-weight: bold; + } + .nix-icon { font-size: 24px; padding: 0 2px; diff --git a/astal/tsconfig.json b/astal/tsconfig.json index 9471e35..58e16ed 100644 --- a/astal/tsconfig.json +++ b/astal/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "experimentalDecorators": true, - "strict": true, + "strict": false, "target": "ES2022", "module": "ES2022", "moduleResolution": "Bundler", diff --git a/astal/widget/Bar.tsx b/astal/widget/Bar.tsx index 7df0482..8b9990c 100644 --- a/astal/widget/Bar.tsx +++ b/astal/widget/Bar.tsx @@ -7,9 +7,10 @@ import Ram from "./ram"; import Disk from "./disk"; import Battery from "./battery"; import Time from "./time"; +import Title from "./title"; export default function Bar(gdkmonitor: Gdk.Monitor) { - const { BOTTOM, LEFT, RIGHT } = Astal.WindowAnchor; + const { TOP, LEFT, RIGHT } = Astal.WindowAnchor; //@ts-ignore return ( @@ -17,7 +18,7 @@ export default function Bar(gdkmonitor: Gdk.Monitor) { className="Bar" gdkmonitor={gdkmonitor} exclusivity={Astal.Exclusivity.EXCLUSIVE} - anchor={BOTTOM | LEFT | RIGHT} + anchor={TOP | LEFT | RIGHT} application={App} > @@ -27,7 +28,9 @@ export default function Bar(gdkmonitor: Gdk.Monitor) { - + + + </box> <box hexpand halign={Gtk.Align.END}> <Audio /> <NetworkModule /> diff --git a/astal/widget/title.tsx b/astal/widget/title.tsx new file mode 100644 index 0000000..8d18d12 --- /dev/null +++ b/astal/widget/title.tsx @@ -0,0 +1,16 @@ +import { bind, Variable } from "astal" +import AstalHyprland from "gi://AstalHyprland?version=0.1"; + +const hyprland = AstalHyprland.get_default() + +function get_title() { + return hyprland.focusedClient?.title ?? "" +} + +const title = Variable(get_title()).poll(200, () => get_title()) + +export default function Title() { + return ( + <label label={title(t => t)} /> + ) +} diff --git a/nix/flake.lock b/nix/flake.lock index 20111d0..fcd05b5 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -83,11 +83,11 @@ ] }, "locked": { - "lastModified": 1756679287, - "narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=", + "lastModified": 1757808926, + "narHash": "sha256-K6PEI5PYY94TVMH0mX3MbZNYFme7oNRKml/85BpRRAo=", "owner": "nix-community", "repo": "home-manager", - "rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8", + "rev": "f21d9167782c086a33ad53e2311854a8f13c281e", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1755261305, - "narHash": "sha256-EOqCupB5X5WoGVHVcfOZcqy0SbKWNuY3kq+lj1wHdu8=", + "lastModified": 1757937573, + "narHash": "sha256-B+MT526k5th4x22h213/CgzdkKWIaeaa0+Y0uuCkH/I=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "203a7b463f307c60026136dd1191d9001c43457f", + "rev": "134e117c969f42277f1c5e60c8fbcac103c2c454", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1754725699, - "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", + "lastModified": 1757745802, + "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", + "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1", "type": "github" }, "original": { @@ -135,11 +135,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1756754095, - "narHash": "sha256-9Rsn9XEWINExosFkKEqdp8EI6Mujr1gmQiyrEcts2ls=", + "lastModified": 1757810152, + "narHash": "sha256-Vp9K5ol6h0J90jG7Rm4RWZsCB3x7v5VPx588TQ1dkfs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7c815e513adbf03c9098b2bd230c1e0525c8a7f9", + "rev": "9a094440e02a699be5c57453a092a8baf569bdad", "type": "github" }, "original": { @@ -166,11 +166,11 @@ ] }, "locked": { - "lastModified": 1754988908, - "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=", + "lastModified": 1758007585, + "narHash": "sha256-HYnwlbY6RE5xVd5rh0bYw77pnD8lOgbT4mlrfjgNZ0c=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48", + "rev": "f77d4cfa075c3de66fc9976b80e0c4fc69e2c139", "type": "github" }, "original": {