From 5e74241bb8b2a672a7adcc4a8b6e1dea03f2f5a2 Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 10 Feb 2023 12:32:43 -0600 Subject: remove unnecessary cruft --- xplr/plugins/dragon/src/init.lua | 62 ---------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 xplr/plugins/dragon/src/init.lua (limited to 'xplr/plugins/dragon/src/init.lua') diff --git a/xplr/plugins/dragon/src/init.lua b/xplr/plugins/dragon/src/init.lua deleted file mode 100644 index f0fdc9f..0000000 --- a/xplr/plugins/dragon/src/init.lua +++ /dev/null @@ -1,62 +0,0 @@ -local function setup(args) - local xplr = xplr - - if args == nil then - args = {} - end - - if args.mode == nil then - args.mode = "selection_ops" - end - - if args.key == nil then - args.key = "D" - end - - if args.keep_selection == nil then - args.keep_selection = false - end - - if args.drag_args == nil then - args.drag_args = "" - end - - if args.drop_args == nil then - args.drop_args = "" - end - - xplr.fn.custom.dragon_drag_n_drop = function(app) - local files = {} - local count = 0 - local cmd = nil - - for i, node in ipairs(app.selection) do - table.insert(files, node.absolute_path) - count = i - end - - if count == 0 then - cmd = "(dragon --target " .. args.drop_args .. " 2> /dev/null | xargs -rl curl -sLO) &\ntrue" - elseif count == 1 then - cmd = "dragon --and-exit " .. args.drag_args .. " '" .. files[1] .. "' > /dev/null 2>&1 &\ntrue" - else - cmd = "dragon " .. args.drag_args .. " '" .. table.concat(files, "' '") .. "' > /dev/null 2>&1 &\ntrue" - end - - os.execute(cmd) - - if not args.keep_selection then - return { "ClearSelection" } - end - end - - xplr.config.modes.builtin[args.mode].key_bindings.on_key[args.key] = { - help = "drag & drop", - messages = { - { CallLuaSilently = "custom.dragon_drag_n_drop" }, - "PopMode", - }, - } -end - -return { setup = setup } -- cgit v1.2.3