dotfiles/config/ags/launcher/ui/Launcher.tsx
2025-03-30 10:56:18 +02:00

33 lines
858 B
TypeScript

import { App, Astal, Gtk, Gdk } from "astal/gtk4"
import { Variable } from "astal"
function hide() {
App.get_window("launcher")!.hide()
}
export default function Launcher(monitor: Gdk.Monitor) {
const { CENTER } = Gtk.Align
const width = Variable(1000)
const text = Variable("")
return <window
name="launcher"
anchor={Astal.WindowAnchor.TOP | Astal.WindowAnchor.BOTTOM}
exclusivity={Astal.Exclusivity.IGNORE}
keymode={Astal.Keymode.ON_DEMAND}
application={App}
onShow={(self) => {
text.set("")
width.set(self.get_current_monitor().get_width_mm())
}}
onKeyPressed={(self, keyval, keycode) => {
print( 'key pressed: ' + keyval + ' which has code ' + keycode );
}}>
<box>
</box>
</window>
}