🐛 Moved system variables to the top

This commit is contained in:
TheColorman 2023-06-19 16:43:52 +02:00
parent a8745622e0
commit b2dad49a2c
No known key found for this signature in database
GPG key ID: A9C799E05AC900AF

View file

@ -23,6 +23,31 @@ local mpopt = require('mp.options')
local utils = require('mp.utils')
local OSD = require('osd_styler')
------------------------------------------------------------
-- System-dependent variables
local os_type
local uname = mp.command_native({
name = "subprocess",
playback_only = false,
capture_stdout = true,
capture_stderr = true,
args = "uname",
}).stdout
if string.find(uname, "MSYS_NT") then
os_type = 'windows'
elseif string.find(uname, "Darwin") then
os_type = 'macos'
else
os_type = 'linux'
end
local open_utility =
os_type == 'windows' and 'explorer.exe' or
os_type == 'macos' and 'open' or
os_type == 'linux' and 'xdg-open'
-- Options can be changed here or in a separate config file.
-- Config path: ~/.config/mpv/script-opts/videoclip.conf
local config = {
@ -204,24 +229,6 @@ local function notify(message, level, duration)
mp.osd_message(message, duration)
end
------------------------------------------------------------
-- System-dependent variables
local os_type
local uname = subprocess({"uname"}).stdout
if string.find(uname, "MSYS_NT") then
os_type = 'windows'
elseif string.find(uname, "Darwin") then
os_type = 'macos'
else
os_type = 'linux'
end
local open_utility =
os_type == 'windows' and 'explorer.exe' or
os_type == 'macos' and 'open' or
os_type == 'linux' and 'xdg-open'
------------------------------------------------------------
-- Provides interface for creating audio/video clips