#!/usr/bin/env hilbish

local fs = require("fs")
local posix = require("posix")


local _, vivaldi_install = posix.find("/opt", { name = "vivaldi-bin" })
local _, dir = posix.dirname(vivaldi_install)
dir = dir:gsub("\n", "")

local matches = fs.glob(dir .. "/resources/vivaldi/window.html.bak")

if #matches ~= 0 then
    print("Restoring window.html backup in " .. dir)
    posix.mv(matches[1], dir .. "/resources/vivaldi/window.html", {sudo = true})
else
    print("No backup")
end
