From 25043cf37edc469ea97851011b058bdc480edb5e Mon Sep 17 00:00:00 2001 From: Squibid Date: Fri, 30 Jun 2023 11:08:37 -0400 Subject: move config out of script to make auto updating viable --- eatit-cfg.lua | 20 ++++++++++++++++++++ eatit.lua | 20 +------------------- 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 eatit-cfg.lua diff --git a/eatit-cfg.lua b/eatit-cfg.lua new file mode 100644 index 0000000..73b7a87 --- /dev/null +++ b/eatit-cfg.lua @@ -0,0 +1,20 @@ +-- NOTE: The variables in this file need to be global in order to be read +-- after being called with dofile() + +plugins = { -- the plugins you want to load + -- link to repo file dest dir + { 'https://git.squi.bid/eat-it', 'eatit.lua', 'scripts' }, +} + +-- options for eat it +opts = { + logging = { -- options for logging + log = true, + logdate = '[%H:%M:%S]:', + logfile = '~~/eatit.log', + }, + dl = { -- options for dealing with the git repos + dir = '/tmp/mpv-eatit', + powerwash = false, -- if true the tmp dir gets deleted after mpv closes + } +} diff --git a/eatit.lua b/eatit.lua index 29f84f8..499faed 100644 --- a/eatit.lua +++ b/eatit.lua @@ -1,24 +1,6 @@ local mp = require('mp') --- TODO: Move plugins (and opts) table to seperate file so that we can auto update without --- messing with the user's configs -local plugins = { -- the plugins you want to load - -- link to repo file dest dir - -- { 'https://git.squi.bid/eat-it', 'eatit.lua', 'scripts' }, -- this is an example uncommenting it (and updating) will overwrite your config -} - --- options for eat it -local opts = { - logging = { -- options for logging - log = true, - logdate = '[%H:%M:%S]:', - logfile = '~~/eatit.log', - }, - dl = { -- options for dealing with the git repos - dir = '/tmp/mpv-eatit', - powerwash = false, -- if true the tmp dir gets deleted after mpv closes - } -} +dofile(mp.command_native({'expand-path', '~~/eatit-cfg.lua'})) local function tablelength(T) local count = 0 -- cgit v1.2.1