dunlin/dunlin.fnl

37 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
(local search (require :search))
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" ["visit-location" {:buffer #$1.buffer }]
2023-01-01 22:22:40 +00:00
"BackSpace" ["back" {:buffer #$1.buffer }]
"M-q" ["quit-browser" {}]
2022-12-23 15:21:06 +00:00
"C-x" {
2022-12-31 15:48:32 +00:00
"C-c" ["quit-browser" {}]
"b" ["switch-to-buffer" {}]
}
2022-12-23 15:21:06 +00:00
})
2023-01-02 22:03:03 +00:00
(local history (require :history))
(tset _G :history (history.open
(.. (os.getenv "HOME") "/.dunlin-history.db")))
2022-12-23 15:21:06 +00:00
(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)