Shatter your dull Overlay Glasses experience by turning it into a redirectable terminal target!
Shatter adds several features to the overlay glasses experience beyond a terminal. It is meant to be used in a neural interface (obviously) with an unbound wireless keyboard.
handler
: handler for cursor blink, and glasses to mouse event conversion. Meant to be put in parallel, or any other multithreading option.
- Parameters
- none
- Returns
- none
getTerm
: gives the terminal object once the handler has been activated.
- Parameters
- none
- Returns
- table: terminal object
getAlpha
: get the alpha value for a specific color
- Parameters
- number: valid terminal color
- Returns
- number: alpha value, in range 0-1
setAlpha
: set the alpha value for a specific color
- Parameters
- number: valid terminal color
- number: alpha value within range 0-1
- Returns
- none
setTextScale
: set the text and background pixel scale
- Parameters
- number: scale value within range 0.5-10
- Returns
- none
shatter_handler
: fired when the shatter handler is loaded
shatter_redirect
: fired when the shatter terminal object is requested in getTerm
shatter_resize
: fired when the shatter terminal object is resized
Let's set up all elements of shatter! Obviously you're here for this part so I'll make it as brief as possible.
- run
wget https://raw.githubusercontent.com/hugeblank/Shatter/master/shatter.lua
on your neural interface that has overlay glasses. - Find an unbound wireless keyboard, this functions as both a keyboard & mouse, keep that in mind.
Here's an example of how you could put a startup file together, runs shell on the redirected overlay glasses:
os.loadAPI("shatter.lua") -- Load the shatter API
parallel.waitForAll(shatter.handler,
function()
os.pullEvent("shatter_handler") -- wait for the handler to load
_G.glasses = shatter.getTerm() -- get the terminal object, and put it in the global scope (for alpha setting in the shell)
term.redirect(glasses) -- redirect to overlay
glass.setAlpha(colors.black, .4) -- set the alpha value of the black color to .4, for visibility.
term.clear() -- apply the alpha value change
shell.run("shell") -- run the shell
end,
function()
os.pullEvent("shatter_resize") -- check for when the glasses get resized
os.queueEvent("term_resize") -- apply it to the shell terminal
end)