dunlin/dunlin.fnl

36 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-12-19 18:19:13 +00:00
(local lgi (require :lgi))
2022-12-20 12:26:28 +00:00
(local lfs (require :lfs))
2022-12-19 18:19:13 +00:00
(local { : Gtk : Gdk : WebKit2 : cairo } lgi)
2022-12-23 15:21:06 +00:00
(local Command (require :command))
(local Frame (require :frame))
(local Buffer (require :buffer))
2022-12-19 18:19:13 +00:00
2022-12-23 15:21:06 +00:00
;;; 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")]
2022-12-20 10:34:37 +00:00
(f:show-buffer b)
2022-12-20 12:26:28 +00:00
(b:visit (.. "file://" (lfs.currentdir) "/doc/index.html")))
2022-12-19 18:19:13 +00:00
2022-12-21 21:51:06 +00:00
(let [socketdir (or (os.getenv "XDG_RUNTIME_DIR") (os.getenv "HOME"))]
((. (require :socket-repl) :start)
(.. socketdir "/dunlin.sock")))
2022-12-19 18:19:13 +00:00
(Gtk.main)