review comments

This commit is contained in:
Daniel Barlow 2022-01-18 20:54:35 +00:00
parent 11facddf8a
commit 0a2959af30

View File

@ -85,7 +85,6 @@
(fn all-apps [] (fn all-apps []
(var apps-table {}) (var apps-table {})
;; for i in ${XDG_DATA_DIRS//:/ /} ; do ls $i/applications/*.desktop ;done
(each [path (string.gmatch (os.getenv "XDG_DATA_DIRS") "[^:]*")] (each [path (string.gmatch (os.getenv "XDG_DATA_DIRS") "[^:]*")]
(let [apps (.. path "/applications/")] (let [apps (.. path "/applications/")]
(when (lfs.attributes apps) (when (lfs.attributes apps)
@ -97,8 +96,9 @@
apps-table) apps-table)
;; Exec entries in desktop files may contain %u %f and other characters ;; Exec entries in desktop files may contain %u %f and other characters
;; in which the launcheris supposed to interpolate filenames/urls etc. ;; in which the launcher is supposed to interpolate filenames/urls etc.
;; We don't ;; We don't afford the user any way to pick filenames, but we do need
;; to remove the placeholders.
(fn parse-percents [str] (fn parse-percents [str]
(str:gsub "%%(.)" (fn [c] (if (= c "%") "%" "")))) (str:gsub "%%(.)" (fn [c] (if (= c "%") "%" ""))))
@ -111,7 +111,7 @@
(posix.execp "/usr/bin/env" vec))))) (posix.execp "/usr/bin/env" vec)))))
(fn launch [app] (fn launch [app]
; (print (if app.DBusActivatable "dbus" "not dbus")) ;; FIXME check app.DBusActivatable and do DBus launch if true
(let [cmd (parse-percents app.Exec)] (let [cmd (parse-percents app.Exec)]
(if app.Terminal (if app.Terminal
(spawn-async ["kitty" cmd]) (spawn-async ["kitty" cmd])