ags: Add keyboard layout widget
This commit is contained in:
1 parent
7fa285f0cc
commit
a198789a17
3 files changed
+17
-1
No files matched your search
@@ -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>
|
||||
}
|
||||
Reference in new issue
Block a user