init
This commit is contained in:
10
Launcher/build.lua
Normal file
10
Launcher/build.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
--Default build.lua Script
|
||||
|
||||
local appid = "org.ruffles.launcher"
|
||||
|
||||
local project_name = "Launcher"
|
||||
|
||||
|
||||
local package_data = build.optimize(build.package("src"))
|
||||
|
||||
build.writePackage(package_data,"build/"..appid)
|
||||
76
Launcher/src/startup.lua
Normal file
76
Launcher/src/startup.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
local basalt = require("globals.basalt")
|
||||
|
||||
-- Get the main frame (your window)
|
||||
local main = basalt.getMainFrame()
|
||||
main:setBackground(colors.white)
|
||||
local w,h = term.getSize()
|
||||
|
||||
-- Add a button
|
||||
local appFrame = main:addScrollFrame({
|
||||
x = 1,
|
||||
y = 1,
|
||||
width = w,
|
||||
height = h/2,
|
||||
background = colors.gray
|
||||
})
|
||||
-- Add a button
|
||||
local processFrame = main:addScrollFrame({
|
||||
x = 1,
|
||||
y = 1+h/2,
|
||||
width = w,
|
||||
height = h/2,
|
||||
background = colors.black
|
||||
})
|
||||
|
||||
|
||||
|
||||
local function mainloop()
|
||||
while true do
|
||||
appFrame:clear()
|
||||
appFrame:addLabel({
|
||||
backgroundEnabled=false,
|
||||
x=1,
|
||||
y=1,
|
||||
background=colors.white,
|
||||
foreground=colors.white
|
||||
}):fillWidth():setText("Apps:")
|
||||
local apps = app.getApps()
|
||||
for i,iapp in ipairs(apps) do
|
||||
appFrame:addLabel({
|
||||
backgroundEnabled=false,
|
||||
x=1,
|
||||
y=i+1,
|
||||
background=colors.white,
|
||||
foreground=colors.white
|
||||
}):fillWidth():setText(iapp.name):onClick(function () app.launch(iapp.appid,iapp.perms)end)
|
||||
end
|
||||
processFrame:clear()
|
||||
processFrame:addLabel({
|
||||
x=1,
|
||||
y=1,
|
||||
background=colors.green,
|
||||
foreground=colors.white
|
||||
}):setText("Open Processes:")
|
||||
local apps = app.getRunningApps()
|
||||
for i,pid in ipairs(apps) do
|
||||
local appData,msg = app.getDetail(pid)
|
||||
if appData then
|
||||
processFrame:addLabel({
|
||||
x=1,
|
||||
y=i,
|
||||
background=colors.green,
|
||||
foreground=colors.white
|
||||
}):setText(appData.name..string.rep(" ",w-appData.name:len()-2)):onClick(function (btn,x,y) app.focusapp(pid) end)
|
||||
processFrame:addLabel({
|
||||
x=w-1,
|
||||
y=i,
|
||||
background=colors.green,
|
||||
foreground=colors.white
|
||||
}):setText("X"):onClick(function (btn,x,y) app.closeApp(pid) mainloop() end)
|
||||
end
|
||||
end
|
||||
sleep(1)
|
||||
end
|
||||
end
|
||||
|
||||
parallel.waitForAny(basalt.run,mainloop)
|
||||
151
containerizer.lua
Normal file
151
containerizer.lua
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user