summaryrefslogtreecommitdiff
path: root/dots/sketchybar/.config/sketchybar/install/sbar.lua.j2
blob: 38a1e47ed54122535a03461d0c6812cd597e74f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local sbarpath = "{{ user.home }}" .. "/.local/share/sketchybar_lua/"

local function exists(file)
  local ok, err, code = os.rename(file, file)
  if not ok then
    if code == 13 then
      return true
    end
  end
  return ok, err
end

local function isdir(path)
  return exists(path .. "/")
end

if not isdir(sbarpath) then
  os.execute(
    "git clone https://github.com/FelixKratz/SbarLua.git /tmp/SbarLua && cd /tmp/SbarLua && make install && rm -rf /tmp/SbarLua/"
  )
end

package.cpath = package.cpath .. ";" .. sbarpath .. "?.so"

os.execute("(cd bridge && make)")