From f30729b7277de312b9e41976b5e0e848520cfe76 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 27 Apr 2022 10:07:33 +0100 Subject: [PATCH] add crier, bodge relative pathnames --- crier/crier.fnl | 10 +++++----- fennelrun.lua | 2 +- rc.fnl | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crier/crier.fnl b/crier/crier.fnl index ab9e22f..42fe9a5 100644 --- a/crier/crier.fnl +++ b/crier/crier.fnl @@ -7,7 +7,8 @@ (local variant dbus.variant) (local Gtk lgi.Gtk) -(local inspect (require :inspect)) +(fn relpath [filename] + (.. "crier/" filename)) (local dbus-service-attrs { @@ -48,7 +49,7 @@ DBUS_REQUEST_NAME_REPLY_EXISTS (error "already running"))) -(let [css (: (io.open "styles.css") :read "*a") +(let [css (: (io.open (relpath "styles.css")) :read "*a") style_provider (Gtk.CssProvider)] (style_provider:load_from_data css) (Gtk.StyleContext.add_provider_for_screen @@ -212,8 +213,9 @@ :timeout timeout }) + (local interface-info - (let [xml (: (io.open "interface.xml" "r") :read "*a") + (let [xml (: (io.open (relpath "interface.xml") "r") :read "*a") node-info (Gio.DBusNodeInfo.new_for_xml xml)] (. node-info.interfaces 1))) @@ -245,8 +247,6 @@ _ (invocation:return_value nil))))) - - (fn handle-dbus-get [conn sender path interface name] (when (and (= path dbus-service-attrs.path) (= interface dbus-service-attrs.interface) diff --git a/fennelrun.lua b/fennelrun.lua index e373427..def0108 100644 --- a/fennelrun.lua +++ b/fennelrun.lua @@ -1,4 +1,4 @@ local fennel = require("fennel") table.insert(package.loaders or package.searchers, fennel.searcher) -- print(fennel.view(arg)) -fennel.dofile(arg[0]) +fennel.dofile(arg[0], { correlate = true }) diff --git a/rc.fnl b/rc.fnl index 267dd9f..78af3b9 100644 --- a/rc.fnl +++ b/rc.fnl @@ -13,4 +13,5 @@ ;(kiwmi:spawn "swaybg -c '#ff00ff'") (kiwmi:spawn "lua -l fennelrun modeline.fnl") (kiwmi:spawn "lua -l fennelrun saturn/main.fnl") -(kiwmi:spawn "foot") +(kiwmi:spawn "lua -l fennelrun crier/crier.fnl") +;(kiwmi:spawn "foot")