This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lego Stax's profile picture

Lithium Os - 2.0

Started by Lego Stax, 24 July 2013 - 06:47 PM
Lego Stax #1
Posted 24 July 2013 - 08:47 PM
Lithium OS

NOTICE: I AM WORKING ON A COMPLETE REBUILD. IT MAY BE A WHILE BEFORE A RELEASE, BUT A RELEASE WILL HAPPEN.


Features Planned for the Complete Rebuild (v 3.0):
- Multi-user, tiered login system
- Passwords hashed with SHA-256
- Tiered System Access (Administrator and Limited account types)
- Multitasking (not windowed)
- OS Clock
- Custom Mouse File Browser with tiered File System access
- Administrator has developer access to event log
- Animations
- Icons on Desktop
- Rednet File Sending
- OS is API driven (to keep code organized)
- Error Handling with crash report uploading to Github
- Themes

- If you have any other ideas, please let me know in the comments!

Features:
- Clickable Interface
- Customizable Desktop Image
- Automatic Update System
- Clean Menus (or at least, I think that they're clean :P/>)
- Login with Single-User Support and SHA-256 Password encoding
- Right Click Support
- Slide out Taskbar
- Settings GUI
- Lithium OS Compatibility API (for adding Icons: will be added in 2.1)
- Constant Clock
- Mouse File Browser by BigSHinyToys

Known Bugs:
- LithOS shutting down the computer after exiting nPaintPro
- None otherwise.

ScreenshotsDesktop:



More Desktop:



Updater:


Download 2.02:
Here: XYLELffE
or Here:


pastebin run XYLELffE

Credits:
- LBPHacker for helping me with fs.open() and configuration
- GravityScore and BigSHinyToys for letting me use their programs in this OS.

Please leave feedback below! If you have ideas, errors, or things that you want to see in update 3.0, please feel free to comment about it!
Edited on 21 October 2014 - 10:37 PM
bwhodle #2
Posted 25 July 2013 - 03:10 PM
But these aren't OSs they're programs that run on CraftOS. :D/> Well I guess that's the definition of a CC "OS" anyways. :mellow:/> huh…
LBPHacker #3
Posted 25 July 2013 - 03:19 PM
Why don't you test your OSes before publishing them…
paintutils:14: expected string
More accurate review soon (gotta fix the bugs).

EDIT: After declaring the undeclared variable desktop_img (which caused the paintutils error, since it was nil), I somehow got into the OS itself.

Before reading the source code:
  • [@] menu (dahell?)
    • Explorer: At least it works. Everybody uses that file browser. I can only say again, "yes, BigSHinyToys, you are awesome!", but hell, some creativity, please.
    • Settings: Took me half a minute (half a minute more than it should have taken) to realize that what I see is not a control panel, but a config file opened in LuaIDE. A bit hardcore for an everyday user.
    • Shutdown: Works.
    • Reboot: Works. Not properly though. Reboots the computer, but CraftOS comes up again at startup. Not gonna say anything to that because it might be supposed to work like that.
    • CraftOS: Works.
  • [Apps] menu: The menu works. Not gonna review the apps in it, they are well known and awesome apps, they work. Period.
  • Clock: The only thing is I somehow managed to kill the timer that keeps it alive, so it just froze and only updated when I clicked or pressed a key (so made LuaJ fire an event).
After reading the source code:
  • You cannot update manually. Although there is a variable called "autoupdate", but it's nil anyways. (By the way, line 55: that pastebin link won't work. There should be a paste ID after "i=")
  • You get the width and the height of the screen, but never use them. I see it was in your mind, but the OS is not your mind, and, when working on an OS, the published code is what matters, not the things in your mind.
  • Looking over the code, it isn't portable nor flexible nor easily extendable.
  • The licence at the beginning: If you're a licence maniac, you should name the authors of the programs you included.
  • Was going to say that you should store the version number in a string, but then I realised that "ver" is nil as well. So many non-implmented features…
  • You should put more effort into keeping the timer of the clock alive. I've been working on my OS lately, and I know, keeping it alive is not as easy as it seems, but it's possible.
  • A lot of other things which I don't think are worth the keystrokes… (mostly the non-existing locals)
And the peek of the mountain: Yet again, this is a Graphical shell. There are things which I think implementing would make an OS an OS, though nothing can really make something an OS in CC Lua, but your OS implements very few of those things.

And - as I stated in other comments on OSes - I may sound harsh, but I'm willing to help (helping somebody is not the same as writing programs for somebody). If I hurt your feels, I'm sorry. All I do is providing the same answers as some of the community members would provide on worse days. Yes, I know no mercy when it comes to reviewing OSes, but that's me. Feel free to ignore my comment. Although, based on experience, that won't happen.
PinYin #4
Posted 26 July 2013 - 06:41 AM
good!
svdragster #5
Posted 27 July 2013 - 08:19 AM
Nice desktop background idea ;)/>
Lego Stax #6
Posted 27 July 2013 - 11:50 AM
-snip-

Sorry about your issues with my OS, which you're right, I have no idea why all of us call it an "OS", even though it's just a GUI that runs CraftOS commands via built-in APIs. I posted the OS onto Pastebin, tried it in CCDesk, but then found out that my 'startup' file was missing the download for the config, because I'm having issues with files writing into other files with the 'fs.open' and/or 'io.open' commands. So, then I updated the version issue and the config issue. I'm sorry that you downloaded my "failed" version. I'm also sorry that the config opens in LuaIDE, but, as I stated above, I am having issues with file opening commands. Therefore, I cannot implement my planned 'settings' program that I already have 99% finished. "[@] menu": I would have used a battery icon, but I just can't have a gigantic battery picture in the top-left corner. I plan to add an API that will allow you to install other programs that you choose to install. However, the program you install must have an installer so that it can tell Lithium OS what icon to put on the desktop. As for the clock/timer, I already tried multiple ways to get it to update every second, but every way I tried didn't work. So, I resolved to set it up to update on every click of the user. Thanks for pointing out that paste ID issue in my update function.

EDIT: Fixed the update paste ID. Thanks again!

Thank you for reviewing my first WIP program/package of programs. If you have any ideas on how to help me fix my problems with my settings GUI or my clock timer, please pm me. Thanks again!
Settings GUI config write function:

function saveConfig()
if fs.exists(".programs/config") then shell.run("delete", ".programs/config") end
sleep(0.5)
local f = fs.open(".programs/config", "w")
f.writeLine("desktop_img = '"..desktop_img.."'")
f.close()
sleep(0.5)
local fn = fs.open(".programs/config", "a")
fn.writeLine("autoupdate = "..autoupdate)
fn.close()
end
1vannn #7
Posted 28 July 2013 - 06:11 PM
I think mySQL support would be a neat feature.
Dave-ee Jones #8
Posted 29 July 2013 - 03:53 AM
How do people do the updater? Do they publish it with Dropbox or something? I really want to do one on mine but I don't know how…
Lego Stax #9
Posted 29 July 2013 - 09:40 AM
I think mySQL support would be a neat feature.
Thanks! Unfortunately, I'm not an advanced enough programmer to add Cloud storage yet. If I were you, I'd be expecting that after Terminal Glasses support is added. Once I add that, I'll check out mySQL and figure out what I need to do to make Lithium OS work.
Lego Stax #10
Posted 29 July 2013 - 09:43 AM
How do people do the updater? Do they publish it with Dropbox or something? I really want to do one on mine but I don't know how…
First of all, yes, you need something like Dropbox, Pastebin, or Mediafire. I did Pastebin because most people trust it over places like Mediafire. Anyway, you have to use the HTTP API to do such things. To figure out how, just take a look at the Pastebin program on a CC computer. Or have a look at my installer when you download my OS.
LBPHacker #11
Posted 29 July 2013 - 10:56 AM
mySQL support
Cloud storage
Two entirely different things. SQL means the database only. I think he meant that, database support.
CoderLummeih #12
Posted 29 July 2013 - 11:58 AM
I think it could be nice to make a way to directly edit the background :)/>
Lego Stax #13
Posted 29 July 2013 - 02:20 PM
mySQL support
Cloud storage
Two entirely different things. SQL means the database only. I think he meant that, database support.

Oh. Well, I'm stupid. What would I use a database for?

I think it could be nice to make a way to directly edit the background :)/>

Alright. Well, you can use nPaintPro and just change the directory for the background in the settings. By the way, I'm working on version 2.0. After some feedback, I'm revamping the entire OS.
Coming features in the next update:
- Login Screen with Multi-User Support and Password encoding
- Right-click menu
- Icons
- LithOS Compatiblity API
Edit: Possibly drag-able/resize-able windows with Terminal Glasses support in 3.0!
Hope you guys will like the new update when it comes out! :)/>
Dave-ee Jones #14
Posted 31 July 2013 - 03:54 AM
Installer is easy. I mean how do you check for updates?
Lego Stax #15
Posted 31 July 2013 - 05:22 PM
Installer is easy. I mean how do you check for updates?

You check for updates by making a file that your update function downloads every time it is ran. Then it compares the version variable in the downloaded file with the version in the update function. This is achieved by using the 'http.get(url)' command.
TheOddByte #16
Posted 31 July 2013 - 06:42 PM
-snip-
-Snip-

function saveConfig()
if fs.exists(".programs/config") then shell.run("delete", ".programs/config") end
sleep(0.5)
local f = fs.open(".programs/config", "w")
f.writeLine("desktop_img = '"..desktop_img.."'")
f.close()
sleep(0.5)
local fn = fs.open(".programs/config", "a")
fn.writeLine("autoupdate = "..autoupdate)
fn.close()
end
Ever heard of 'fs.delete()' :P/>
Anyway.. Quite like the idea of this OS :)/>
DarkEspeon #17
Posted 31 July 2013 - 07:29 PM

function saveConfig()
if fs.exists(".programs/config") then shell.run("delete", ".programs/config") end
sleep(0.5)
local f = fs.open(".programs/config", "w")
f.writeLine("desktop_img = '"..desktop_img.."'")
f.close()
sleep(0.5)
local fn = fs.open(".programs/config", "a")
fn.writeLine("autoupdate = "..autoupdate)
fn.close()
end
There is a better way to do this rather then open the file twice:

function SaveConfig()
if fs.exists(".programs/config") then fs.delete(".programs/config") end
sleep(0.5)
local f = fs.open(".programs/config", "w")
f.writeLine("desktop_img = '" .. desktop_img)
f.writeLine("autoupdate = "..autoupdate)
f.close()
end

This works because writeLine auto adds the \n character, or end of line character, so you can leave it open and save a few lines of code.
Lego Stax #18
Posted 31 July 2013 - 07:36 PM
-snip-

I finished the settings program for this OS and I am actually writing a table into the file instead of using 'fs.writeLine'.

-snip-
-Snip-

function saveConfig()
if fs.exists(".programs/config") then shell.run("delete", ".programs/config") end
sleep(0.5)
local f = fs.open(".programs/config", "w")
f.writeLine("desktop_img = '"..desktop_img.."'")
f.close()
sleep(0.5)
local fn = fs.open(".programs/config", "a")
fn.writeLine("autoupdate = "..autoupdate)
fn.close()
end
Ever heard of 'fs.delete()' :P/>
Anyway.. Quite like the idea of this OS :)/>

I tried it, but for some reason it wasn't functioning properly. :P/> Thanks! :)/>
LBPHacker #19
Posted 01 August 2013 - 03:12 AM
I tried it, but for some reason it wasn't functioning properly. :P/> Thanks! :)/>
Serializing the whole configuration still is better.
TheGamerOfAction #20
Posted 01 August 2013 - 05:00 AM
Just a question: why do so many OSes derive from NDFJay's tutorial?
Lego Stax #21
Posted 01 August 2013 - 09:40 AM
I tried it, but for some reason it wasn't functioning properly. :P/> Thanks! :)/>
Serializing the whole configuration still is better.
I'm actually using exactly that. I'm serializing a table and then saving it to the file.
Just a question: why do so many OSes derive from NDFJay's tutorial?
This is just the start. I've decided to revamp the OS entirely and make the start button actually slide open the taskbar so you can click on icons instead of text. The GUI is smoother too. The taskbar is going to be customizable to fit to any side of the screen. There's also going to be a configurable background color behind your custom desktop image. And more… *hint, hint, read the planned features*.
svdragster #22
Posted 02 August 2013 - 02:24 PM
Installer is easy. I mean how do you check for updates?

Get the raw code of a paste, then open the file running right now (or another one), get all the content of it.
If the both files match, then it's up to date. If not, just place the raw code you got inside of the program currently running and restart the program.
Lego Stax #23
Posted 02 August 2013 - 07:47 PM
Installer is easy. I mean how do you check for updates?

Get the raw code of a paste, then open the file running right now (or another one), get all the content of it.
If the both files match, then it's up to date. If not, just place the raw code you got inside of the program currently running and restart the program.

Never thought of that. That's even better! Then you don't have to worry about changing version numbers like I sometimes forget to do.
svdragster #24
Posted 03 August 2013 - 04:56 AM
I used it in my Chat Program, worked pretty well ^^
But if you do it this way, don't auto update, ask the user to update.
If you edited your program and want to test it, it would auto update back to the pastebin one, and your need added features are gone.
Lego Stax #25
Posted 03 August 2013 - 09:50 PM
I used it in my Chat Program, worked pretty well ^^
But if you do it this way, don't auto update, ask the user to update.
If you edited your program and want to test it, it would auto update back to the pastebin one, and your need added features are gone.
Yeah… I thought that I tested it and it worked, it's just it might be broken now.
Lego Stax #26
Posted 14 August 2013 - 08:33 PM
Hi guys,
Just wanted to give you a heads up. I got myself in a little bit over my head coding-wise for Lithium 2.0. However, I am going to learn all the skills, commands, etc. to still bring all of the planned functions to you guys. So, 2.0 will be released sometime in September.
Happy Hacking!
cutyehair104

Edit: Lithium OS 2.0 will definitely be released in two weeks from now at most.
Edit 2: Probably won't finish this weekend because I'm SUPER busy. Sorry guys. I'm adding a Pastebin program with a GUI as a way to make up for my tardiness. Again, sorry guys.
Edit 3: It comes on 9-29-13!
Edit 4: I found some bugs when I tested it and I have lots of stuff going on this week, so I will release it later this week with all of the bugs fixed. I will release a Development Version today.
YuvonDovah #27
Posted 22 August 2013 - 08:45 AM
Can't Wait Until The Updates!
Lego Stax #28
Posted 01 October 2013 - 10:08 AM
Development Version released! Still a slightly buggy, but this will be fixed by 10-5-13. I will come back here in this post and tell you guys when I've fixed the bugs.
Bug Fixes:
- SHA encoder now encodes correctly
- Fixed problem with BigSHinyToys's Mouse File Browser running
- Autoupdate function will now only run on boot up
- Fixed other problem with autoupdate function being in the startup file.

If you notice any other bugs, please post them here on this topic or PM me. Thanks!
NOTE: AS OF VERSION 2.02, PLEASE REDOWNLOAD THE INSTALLER AND REINSTALL IT. THANK YOU!
Lego Stax #29
Posted 06 October 2013 - 04:18 PM
Again, as of version 2.02, please re-download the installer and re-install Lithium OS. All bugs fixed. I just figured out icons and how they work. So, 2.1 is around the corner!

Edit: I guess I didn't iron out the bugs. And, it looks as if nobody even likes this OS. I never thought that I'd say these words, but I am shutting down Lithium OS until a later time when I can actually have time to make this OS a good one without you guys having to wait for 5 updates. Currently, I am extremely frustrated with my wireless Netgear N-300 WNR2000v2 router. It has been deteriorating over the past month and I just can't seem to hold a stable connection with the router. And I need internet to complete the testing. Which of course, my internet drops every 2-8 minutes. It's unpredictable and I know that I will never use Netgear again. Rant/vent complete. Thank you for all of your support.
Edited on 20 September 2014 - 09:41 PM
tristandk #30
Posted 13 October 2013 - 09:44 AM
wow, very nice !!
Lego Stax #31
Posted 18 October 2013 - 09:48 PM
wow, very nice !!
Thanks, but I am working on a better version that will have a majority of the planned portion already implemented into it.
Lego Stax #32
Posted 23 March 2014 - 04:30 PM
I don't have the time to work on this project anymore. Plus, I lost the files a while ago. So, you'll be seeing new programs from me in the future, especially when 1.6 comes out, but I simply can't work on this anymore. I'm sorry everyone. Thank you for being with me while it lasted. Perhaps I'll design something new and light in the future with PDA. Scratch that. I'm going to be rebuilding this OS from scratch, it will be able to sync with my lOS for PCs when everything is done. First I have to finish lOS (PC OS), then I can rebuild Lithium OS. I have no idea when this will be finished.
Edited on 20 September 2014 - 09:39 PM
Konlab #33
Posted 03 April 2014 - 02:36 PM
Nice work!
My favourite chemical element is lithium.
If you need dialog boxes see APIs and Utilities and There's an API called diaAPI, you can use that.
Very nice work,
And something:
Is in this 'OS' edit or luaIDE?
Thanks 4 answer
Konlab
diediedie765 #34
Posted 12 April 2014 - 08:37 AM
I'm a little confused. I'm new to this mod, and I don't understand what I did wrong. When I installed this and rebooted the computer, and I just end up with this screen. I assumed it was the login screen, but I enter the name and password I entered before and it just does nothing.

http://imgur.com/g3ddoM9
Lego Stax #35
Posted 21 July 2014 - 09:04 PM
Nice work!
My favourite chemical element is lithium.
If you need dialog boxes see APIs and Utilities and There's an API called diaAPI, you can use that.
Very nice work,
And something:
Is in this 'OS' edit or luaIDE?
Thanks 4 answer
Konlab

Thanks for referring me! I'll check it out! Oh, and yes, LuaIDE. It's says so in the description.

I'm a little confused. I'm new to this mod, and I don't understand what I did wrong. When I installed this and rebooted the computer, and I just end up with this screen. I assumed it was the login screen, but I enter the name and password I entered before and it just does nothing.

http://imgur.com/g3ddoM9

Sorry for not replying sooner. It probably has something to do with either I messed up the Pastebin package, or I messed up the code somehow… Anyway, I'm currently recoding the entire OS. It should be fixed when I'm done.
Edited on 24 July 2014 - 02:11 AM