36 lines
1.1 KiB
Fennel
36 lines
1.1 KiB
Fennel
(local lgi (require :lgi))
|
|
(local lfs (require :lfs))
|
|
(local { : Gtk : Gdk : WebKit2 : cairo } lgi)
|
|
|
|
(local Command (require :command))
|
|
(local Frame (require :frame))
|
|
(local Buffer (require :buffer))
|
|
|
|
;;; when we decide how to do an init file/rc file, this will go in it
|
|
|
|
(local my-keymap {
|
|
"g" #(Command.invoke-interactively
|
|
"visit-location"
|
|
{:buffer "main"})
|
|
"M-q" #(Command.invoke-interactively
|
|
"quit-browser"
|
|
{})
|
|
"C-x" {
|
|
"C-c"
|
|
#(Command.invoke-interactively
|
|
"quit-browser"
|
|
{})
|
|
}
|
|
})
|
|
|
|
(let [f (Frame.new my-keymap)
|
|
b (Buffer.new "main")]
|
|
(f:show-buffer b)
|
|
(b:visit (.. "file://" (lfs.currentdir) "/doc/index.html")))
|
|
|
|
(let [socketdir (or (os.getenv "XDG_RUNTIME_DIR") (os.getenv "HOME"))]
|
|
((. (require :socket-repl) :start)
|
|
(.. socketdir "/dunlin.sock")))
|
|
|
|
(Gtk.main)
|