diff options
author | Kevin <[email protected]> | 2024-10-16 00:49:16 -0300 |
---|---|---|
committer | Kevin <[email protected]> | 2024-10-16 00:49:16 -0300 |
commit | 2b1e8501b46056b79d97e90c6ec94e3ad36d0ab2 (patch) | |
tree | 6486e98bd1ba523b1aeb4bd2566d1ff6e5c41798 /core/lua/astal/file.lua | |
parent | 03f2c4706faba7dac5aee71b10255eac218cbeec (diff) | |
parent | 236487001ab2a6c9c8e87e5db0ced9e5ab3ed791 (diff) |
Merge branch 'adapt-upstream-changes'
Diffstat (limited to 'core/lua/astal/file.lua')
-rw-r--r-- | core/lua/astal/file.lua | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/core/lua/astal/file.lua b/core/lua/astal/file.lua deleted file mode 100644 index ca5a592..0000000 --- a/core/lua/astal/file.lua +++ /dev/null @@ -1,45 +0,0 @@ -local lgi = require("lgi") -local Astal = lgi.require("Astal", "0.1") -local GObject = lgi.require("GObject", "2.0") - -local M = {} - ----@param path string ----@return string -function M.read_file(path) - return Astal.read_file(path) -end - ----@param path string ----@param callback fun(content: string, err: string): nil -function M.read_file_async(path, callback) - Astal.read_file_async(path, function(_, res) - local content, err = Astal.read_file_finish(res) - callback(content, err) - end) -end - ----@param path string ----@param content string -function M.write_file(path, content) - Astal.write_file(path, content) -end - ----@param path string ----@param content string ----@param callback? fun(err: string): nil -function M.write_file_async(path, content, callback) - Astal.write_file_async(path, content, function(_, res) - if type(callback) == "function" then - callback(Astal.write_file_finish(res)) - end - end) -end - ----@param path string ----@param callback fun(file: string, event: integer): nil -function M.monitor_file(path, callback) - return Astal.monitor_file(path, GObject.Closure(callback)) -end - -return M |