ags: Add keyboard layout widget

This commit is contained in:
2026-08-19 21:41:32 +03:00
committed by Sweetbread
parent b85a81882d
commit f9ae2cb408
3 changed files with 17 additions and 1 deletions
@@ -0,0 +1,12 @@
import { Variable, bind } from "astal"
import Hyprland from "gi://AstalHyprland"
export default function Layout() {
const hl = Hyprland.get_default();
let layout = Variable("en");
hl.connect("keyboard-layout", (_, __, l) => { layout.set(`${l}`.slice(0, 2).toLowerCase()) })
return <box className={bind(layout).as((l) => `Layout ${l}`)}>
<label label={bind(layout)}/>
</box>
}