add crier, bodge relative pathnames

This commit is contained in:
Daniel Barlow 2022-04-27 10:07:33 +01:00
parent bb23c31b0b
commit f30729b727
3 changed files with 8 additions and 7 deletions

View File

@ -7,7 +7,8 @@
(local variant dbus.variant) (local variant dbus.variant)
(local Gtk lgi.Gtk) (local Gtk lgi.Gtk)
(local inspect (require :inspect)) (fn relpath [filename]
(.. "crier/" filename))
(local dbus-service-attrs (local dbus-service-attrs
{ {
@ -48,7 +49,7 @@
DBUS_REQUEST_NAME_REPLY_EXISTS DBUS_REQUEST_NAME_REPLY_EXISTS
(error "already running"))) (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 (Gtk.CssProvider)]
(style_provider:load_from_data css) (style_provider:load_from_data css)
(Gtk.StyleContext.add_provider_for_screen (Gtk.StyleContext.add_provider_for_screen
@ -212,8 +213,9 @@
:timeout timeout :timeout timeout
}) })
(local interface-info (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 (Gio.DBusNodeInfo.new_for_xml xml)]
(. node-info.interfaces 1))) (. node-info.interfaces 1)))
@ -245,8 +247,6 @@
_ _
(invocation:return_value nil))))) (invocation:return_value nil)))))
(fn handle-dbus-get [conn sender path interface name] (fn handle-dbus-get [conn sender path interface name]
(when (and (= path dbus-service-attrs.path) (when (and (= path dbus-service-attrs.path)
(= interface dbus-service-attrs.interface) (= interface dbus-service-attrs.interface)

View File

@ -1,4 +1,4 @@
local fennel = require("fennel") local fennel = require("fennel")
table.insert(package.loaders or package.searchers, fennel.searcher) table.insert(package.loaders or package.searchers, fennel.searcher)
-- print(fennel.view(arg)) -- print(fennel.view(arg))
fennel.dofile(arg[0]) fennel.dofile(arg[0], { correlate = true })

3
rc.fnl
View File

@ -13,4 +13,5 @@
;(kiwmi:spawn "swaybg -c '#ff00ff'") ;(kiwmi:spawn "swaybg -c '#ff00ff'")
(kiwmi:spawn "lua -l fennelrun modeline.fnl") (kiwmi:spawn "lua -l fennelrun modeline.fnl")
(kiwmi:spawn "lua -l fennelrun saturn/main.fnl") (kiwmi:spawn "lua -l fennelrun saturn/main.fnl")
(kiwmi:spawn "foot") (kiwmi:spawn "lua -l fennelrun crier/crier.fnl")
;(kiwmi:spawn "foot")