summaryrefslogtreecommitdiff
path: root/config/mpv/scripts/subs2srsa/platform/nix.lua
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2025-04-05 03:00:29 +0200
committernavewindre <boneyaard@gmail.com>2025-04-05 03:00:29 +0200
commitd6c4365b8de32b621ac46074a9b69908b95686c0 (patch)
tree495cb5b1aa7e68ab6ec07fa5fb09904a8c7e47e7 /config/mpv/scripts/subs2srsa/platform/nix.lua
parentb24463f3d045783b8f4e72926054d53b908e150f (diff)
a
Diffstat (limited to 'config/mpv/scripts/subs2srsa/platform/nix.lua')
-rw-r--r--config/mpv/scripts/subs2srsa/platform/nix.lua49
1 files changed, 0 insertions, 49 deletions
diff --git a/config/mpv/scripts/subs2srsa/platform/nix.lua b/config/mpv/scripts/subs2srsa/platform/nix.lua
deleted file mode 100644
index cbf6c85..0000000
--- a/config/mpv/scripts/subs2srsa/platform/nix.lua
+++ /dev/null
@@ -1,49 +0,0 @@
---[[
-Copyright: Ren Tatsumoto and contributors
-License: GNU GPL, version 3 or later; http://www.gnu.org/licenses/gpl.html
-
-Platform-specific functions for *nix systems.
-]]
-
-local h = require('helpers')
-local self = { healthy = true, clip_util = "", clip_cmd = "", }
-
-if h.is_mac() then
- self.clip_util = "pbcopy"
- self.clip_cmd = "LANG=en_US.UTF-8 " .. self.clip_util
-elseif h.is_wayland() then
- local function is_wl_copy_installed()
- local handle = h.subprocess { 'wl-copy', '--version' }
- return handle.status == 0 and handle.stdout:match("wl%-clipboard") ~= nil
- end
-
- self.clip_util = "wl-copy"
- self.clip_cmd = self.clip_util
- self.healthy = is_wl_copy_installed()
-else
- local function is_xclip_installed()
- local handle = h.subprocess { 'xclip', '-version' }
- return handle.status == 0 and handle.stderr:match("xclip version") ~= nil
- end
-
- self.clip_util = "xclip"
- self.clip_cmd = self.clip_util .. " -i -selection clipboard"
- self.healthy = is_xclip_installed()
-end
-
-self.tmp_dir = function()
- return os.getenv("TMPDIR") or '/tmp'
-end
-
-self.copy_to_clipboard = function(text)
- local handle = io.popen(self.clip_cmd, 'w')
- handle:write(text)
- handle:close()
-end
-
-self.curl_request = function(url, request_json, completion_fn)
- local args = { 'curl', '-s', url, '-X', 'POST', '-d', request_json }
- return h.subprocess(args, completion_fn)
-end
-
-return self