dunlin

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

dunlin.fnl (1120B)


      1 (local lgi (require :lgi))
      2 (local lfs (require :lfs))
      3 (local { : Gtk : Gdk : WebKit2 : cairo } lgi)
      4 
      5 (local Command (require :command))
      6 (local Frame (require :frame))
      7 (local Buffer (require :buffer))
      8 
      9 (local search (require :search))
     10 
     11 ;;; when we decide how to do an init file/rc file, this will go in it
     12 
     13 (local my-keymap {
     14                   "g" ["visit-location" {:buffer #$1.buffer }]
     15                   "BackSpace" ["back" {:buffer #$1.buffer }]
     16                   "M-q" ["quit-browser" {}]
     17                   "C-x" {
     18                          "C-c" ["quit-browser" {}]
     19                          "b" ["switch-to-buffer" {}]
     20                          }
     21                   })
     22 
     23 (local history (require :history))
     24 (tset _G :history (history.open
     25                    (.. (os.getenv "HOME") "/.dunlin-history.db")))
     26 
     27 (let [f (Frame.new my-keymap)
     28       b (Buffer.new "main")]
     29   (f:show-buffer b)
     30   (b:visit (.. "file://" (lfs.currentdir) "/doc/index.html")))
     31 
     32 (let [socketdir (or (os.getenv "XDG_RUNTIME_DIR") (os.getenv "HOME"))]
     33   ((. (require :socket-repl) :start)
     34    (.. socketdir "/dunlin.sock")))
     35 
     36 (Gtk.main)
     37 
     38 ;; NO-TESTING