--   This file is part of Reno desktop.
--
--  Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
--
--  Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>. 
-- Global settings
local conf = require("parsers").conf
local envsub = require("utils").substitute_env
local conf_file = io.open(root_path.."/desktop.conf","r")
if not conf_file then
    error("desktop.conf is missing or not readable")
end
local config = conf(conf_file:read("*a"))
conf_file:close()
global = config.global
global.terminal = envsub(global.terminal)
global.browser = envsub(global.browser)
local function invert(t)
    local new_t = {}
    for k,v in pairs(t) do
        new_t[v] = k
    end
    return new_t
end
keybindings = invert(config.keys)
