Jump to content




Lithium Os - 2.0

computer lua utility

  • You cannot reply to this topic
34 replies to this topic

Poll: How is it doing? (44 member(s) have cast votes)

How do you like Lithium OS in it's current state? Please rate below:

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 24 July 2013 - 07: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.

Screenshots

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 by Lego Stax, 21 October 2014 - 11:37 PM.


#2 bwhodle

  • Members
  • 14 posts
  • Locationstring expected, got nil

Posted 25 July 2013 - 02: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...

#3 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 25 July 2013 - 02: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.

#4 PinYin

  • Members
  • 47 posts

Posted 26 July 2013 - 05:41 AM

good!

#5 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 27 July 2013 - 07:19 AM

Nice desktop background idea ;)

#6 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 27 July 2013 - 10:50 AM

Quote

-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


#7 1vannn

  • Members
  • 111 posts
  • LocationOhio, USA

Posted 28 July 2013 - 05:11 PM

I think mySQL support would be a neat feature.

#8 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 29 July 2013 - 02: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...

#9 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 29 July 2013 - 08:40 AM

View Post1vannn, on 28 July 2013 - 05:11 PM, said:

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.

#10 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 29 July 2013 - 08:43 AM

View PostAutoLocK, on 29 July 2013 - 02:53 AM, said:

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.

#11 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 29 July 2013 - 09:56 AM

View Post1vannn, on 28 July 2013 - 05:11 PM, said:

mySQL support

View Postcutyehair104, on 29 July 2013 - 08:40 AM, said:

Cloud storage
Two entirely different things. SQL means the database only. I think he meant that, database support.

#12 CoderLummeih

  • Members
  • 4 posts

Posted 29 July 2013 - 10:58 AM

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

#13 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 29 July 2013 - 01:20 PM

View PostLBPHacker, on 29 July 2013 - 09:56 AM, said:

View Post1vannn, on 28 July 2013 - 05:11 PM, said:

mySQL support

View Postcutyehair104, on 29 July 2013 - 08:40 AM, said:

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?

View PostCoderLummeih, on 29 July 2013 - 10:58 AM, said:

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! :)

#14 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 31 July 2013 - 02:54 AM

Installer is easy. I mean how do you check for updates?

#15 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 31 July 2013 - 04:22 PM

View PostAutoLocK, on 31 July 2013 - 02:54 AM, said:

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.

#16 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 31 July 2013 - 05:42 PM

View Postcutyehair104, on 27 July 2013 - 10:50 AM, said:

Quote

-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 :)

#17 DarkEspeon

  • Members
  • 57 posts

Posted 31 July 2013 - 06: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.

#18 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 31 July 2013 - 06:36 PM

View Postnicse4, on 31 July 2013 - 06:29 PM, said:

-snip-

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

View PostHellkid98, on 31 July 2013 - 05:42 PM, said:

View Postcutyehair104, on 27 July 2013 - 10:50 AM, said:

Quote

-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! :)

#19 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 01 August 2013 - 02:12 AM

View Postcutyehair104, on 31 July 2013 - 06:36 PM, said:

I tried it, but for some reason it wasn't functioning properly. :P Thanks! :)
Serializing the whole configuration still is better.

#20 TheGamerOfAction

  • Members
  • 20 posts
  • LocationIn a mysterious world of 1s and 0s

Posted 01 August 2013 - 04:00 AM

Just a question: why do so many OSes derive from NDFJay's tutorial?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users