1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-21 19:44:21 -05:00

Merge pull request 'clipboard: Make the clipboard service work under the new service sys' (#4) from Amanda/OC-PsychOS2:fix-clipboard-editor-cleanup into master

Looks good.
This commit is contained in:
Izaya 2020-05-27 02:21:05 +10:00
commit 7dda36fd1d
3 changed files with 21 additions and 9 deletions

5
.editorconfig Normal file
View File

@ -0,0 +1,5 @@
root = true
[*.lua]
indent_style = space
indent_size = 1

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
*.cpio
*.af
apidoc.md
/target
/doc

View File

@ -1,11 +1,17 @@
local lc = computer.uptime()
_G.clip = ""
while true do
local eT = {coroutine.yield()}
if eT[1] == "clipboard" then
if computer.uptime() > lc + 5 then
_G.clip = ""
end
_G.clip = _G.clip .. eT[3]
end
function start()
return os.spawn(function()
local lc
while true do
local eT = {coroutine.yield()}
if eT[1] == "clipboard" then
if computer.uptime() > lc + 5 then
_G.clip = ""
end
lc = computer.uptime()
_G.clip = _G.clip .. eT[3]
end
end
end)
end