Jump to content




Craftbang - Multitasking Desktop Environment


53 replies to this topic

#1 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 11 August 2013 - 06:43 PM

Posted Image

CraftBang

CraftBang is a desktop environment with multitasking capabilities. It's clean, modern, customizable and allows you to not only access your favorite programs easily, but more than one at once with little hassle.


Screenshots
Spoiler


Download / More Info
Download the installer / updater: pastebin get reBqWcFr cb-update
GitHub Page (includes documentation): https://github.com/Kingdaro/CraftBang

Once you have the installer downloaded, you can run it at any time to get the newest version of CraftBang.
As always, comments and bug reports are appreciated. Enjoy!

Credits to GopherAtl for his Redirect API.

You are free to use this in any project you please.


**Note: This is NOT an operating system, and I will not be calling it an operating system. The only reason it resides in this forum is because it falls under the definition of what is known as an OS by this community. You are welcome to call it an OS, but I will never refer to it as such. It is a desktop environment, and it was created as a desktop environment.

Edited by Kingdaro, 27 February 2014 - 10:25 PM.


#2 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 11 August 2013 - 06:49 PM

Wow! This looks just simply amazing! :)
I really wish my computer was on now so I could test it..
Great that it has multitasking since that is always an nice feature :D

#3 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 11 August 2013 - 06:52 PM

View PostHellkid98, on 11 August 2013 - 06:49 PM, said:

Wow! This looks just simply amazing! :)/>
I really wish my computer was on now so I could test it..
Great that it has multitasking since that is always an nice feature :D/>
Yeah, it is, hence why it was my main goal in making this, heh. Glad you like it!

For the record, I would've done windowing, but I didn't feel it was necessary, as programs are usually better run in higher resolution. I wanted to take up the least amount of screen space I could, and give programs the space they really need.

#4 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 11 August 2013 - 06:59 PM

View PostKingdaro, on 11 August 2013 - 06:52 PM, said:

View PostHellkid98, on 11 August 2013 - 06:49 PM, said:

Wow! This looks just simply amazing! :)/>
I really wish my computer was on now so I could test it..
Great that it has multitasking since that is always an nice feature :D/>
Yeah, it is, hence why it was my main goal in making this, heh. Glad you like it!

For the record, I would've done windowing, but I didn't feel it was necessary, as programs are usually better run in higher resolution. I wanted to take up the least amount of screen space I could, and give programs the space they really need.
I never got the point of windows. Most programs aren't designed for such a small resolution. So I agree with your choice of not going with windows.

#5 Thib0704

  • Members
  • 93 posts
  • LocationgetServer().getPlayer("Thib0704").getLocation();

Posted 11 August 2013 - 07:10 PM

View PostSammich Lord, on 11 August 2013 - 06:59 PM, said:

View PostKingdaro, on 11 August 2013 - 06:52 PM, said:

View PostHellkid98, on 11 August 2013 - 06:49 PM, said:

Wow! This looks just simply amazing! :)/>/>
I really wish my computer was on now so I could test it..
Great that it has multitasking since that is always an nice feature :D/>/>
Yeah, it is, hence why it was my main goal in making this, heh. Glad you like it!

For the record, I would've done windowing, but I didn't feel it was necessary, as programs are usually better run in higher resolution. I wanted to take up the least amount of screen space I could, and give programs the space they really need.
I never got the point of windows. Most programs aren't designed for such a small resolution. So I agree with your choice of not going with windows.

Good point.
The only way I think off to make windowed based application,
Is making an API for developers to get the width and height of the window!
But this mean developers would have to remake their program's. :(

Otherwise : Great app !

#6 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 11 August 2013 - 07:18 PM

View PostThib0704, on 11 August 2013 - 07:10 PM, said:

Good point.
The only way I think off to make windowed based application,
Is making an API for developers to get the width and height of the window!
But this mean developers would have to remake their program's. :(/>/>

Otherwise : Great app !

Usually, the way a windowing system works, is that you simply overwrite the term functions (or redirect the term to a drawable "buffer", like I've done) so that, for example, when a program calls term.getSize(), instead of returning the actual size of the screen, you overwrite it to return the size of the window.

This is probably what it'd look like in a "window" object:
local window = {}

--#  a bunch of bs

function window.getSize()
  return window.width, window.height
end

Or something along the lines.

#7 Vilsol

  • Members
  • 194 posts
  • LocationStudy: United Kingdom Native: Latvia

Posted 11 August 2013 - 07:38 PM

Seems like you have taken the idea from my OS. I have already started working on window support. But its actually good that now we have a "competition" which will all come down to efficiency!

/me reads your code
Seems like you are a lot more experienced than me... so I guess I can just give up now...
Maybe you want to work on it together?

Edited by Vilsol, 11 August 2013 - 08:12 PM.


#8 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 11 August 2013 - 08:57 PM

View PostVilsol, on 11 August 2013 - 07:38 PM, said:

Maybe you want to work on it together?
I'm not open to making it a group thing, but anyone is welcome to fork the repo and contribute their own bits of code or CB-themed programs via pull requests.

#9 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 12 August 2013 - 03:03 AM

Wow, absolutely awesome Kingdaro! My favourite OS in terms of actual practicality and usability by far! :D (PearOS is very nice graphically, but you can't do anything in it)

Few suggestions:
- It would be really cool if you monitored the shell's program stack somehow (through shell.run maybe), and whenever a program was added to the stack you open it in a new multitasking tab (like when running a program through LuaIDE).
- One problem I found was that the OS seems to crash if you do while true do print("hello") end or something similar, probably due to lack of yielding, not sure how to fix this, if you wanted to fix it.
- The computer doesn't seem to remember me setting a name? I set a name at startup, then quit it, then it asks again. Is this a bug of sorts?
- A more GUI centric installer would be nice :)
- Would hiding the global CraftBang functions from programs when you run them to avoid them messing with the OS be worth it? Are you intending to allow a developer to use them or not?
- Finally, did you plan to include any default programs with this OS? It would be cool, maybe have an option for downloading them in the installer, or add some form of quick download store for common programs on the forums. This would be awesome :D

Personally, I would try to keep this OS from being too feature bloated, so I wouldn't include an API, and have default programs for the OS an option in the installer, and just have a quick download store, with a few programs (not user submitted, or maybe have user submitted ones in a completely different section from the common useage ones if you wanted to make it communal) for easy download, so you don't have to go looking up the pastebin IDs all the time, and maybe a weekly/monthly/whenever you feel like it highlight if you're bored :P

#10 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 12 August 2013 - 12:49 PM

View PostGravityScore, on 12 August 2013 - 03:03 AM, said:

Wow, absolutely awesome Kingdaro! My favourite OS in terms of actual practicality and usability by far! :D/ (PearOS is very nice graphically, but you can't do anything in it)

Few suggestions:
- It would be really cool if you monitored the shell's program stack somehow (through shell.run maybe), and whenever a program was added to the stack you open it in a new multitasking tab (like when running a program through LuaIDE).
- One problem I found was that the OS seems to crash if you do while true do print("hello") end or something similar, probably due to lack of yielding, not sure how to fix this, if you wanted to fix it.
- The computer doesn't seem to remember me setting a name? I set a name at startup, then quit it, then it asks again. Is this a bug of sorts?
- A more GUI centric installer would be nice :)
- Would hiding the global CraftBang functions from programs when you run them to avoid them messing with the OS be worth it? Are you intending to allow a developer to use them or not?
- Finally, did you plan to include any default programs with this OS? It would be cool, maybe have an option for downloading them in the installer, or add some form of quick download store for common programs on the forums. This would be awesome :D

Personally, I would try to keep this OS from being too feature bloated, so I wouldn't include an API, and have default programs for the OS an option in the installer, and just have a quick download store, with a few programs (not user submitted, or maybe have user submitted ones in a completely different section from the common useage ones if you wanted to make it communal) for easy download, so you don't have to go looking up the pastebin IDs all the time, and maybe a weekly/monthly/whenever you feel like it highlight if you're bored :P

Thanks for the feedback, GS. Glad you like it!

- I actually tried to do that, but environments weren't really playing nice with me at the time. I might try it again sometime in the future though. (Then again, I could just overwrite it on coroutine resume, like I'm doing with os.pullEvent. Bleh.)
- That's...very odd. Though I'm pretty sure that's because the coroutine is resumed in writing to the buffer, and the coroutine hasn't stopped resuming for the buffer to draw to the screen. Not exactly sure how to fix that...hm.
- Not sure? Every computer I've tested it on never asked again once I've set the name. It's not an issue with preference saving or whatever, because it uses the computer's label. That's curious.
- I thought about it, and it's more effort than its worth, and not really necessary. :P (I'd do it if I could use my arealib though!)
- I was sort of iffy about hiding global CB functions myself. I had the idea that a programmer (or even a user) could screw up the system and your preferences bad with access to them. On the other side of the spectrum, having access to the global craftbang functions would allow programs to add new tasks, open dialogues, access craftbang's version, and a number of other neat helpful stuff. I'll think about it, I suppose.
- Default programs are definitely a yes! The terminal is actually one of them; you can just run it on its own in CraftOS by running craftbang/terminal.

What to include, I'm not sure. Of course I won't be including too many programs to keep that lightweight feel, as you've said, but a couple of default shortcuts and nice apps to start people off definitely wouldn't hurt.

As for the store, that might work out pretty well, the more I think about it.

#11 Negi

  • Members
  • 8 posts

Posted 13 August 2013 - 05:35 AM

I like the whole thing, just that, for the logo, may you should replace the grass block by a crafting table. And give an option in the graphical interface for quick shutdown, like a status bar with "Shutdown", "Reboot" buttons and may a "Menu" were the user could register programs that he don't wants on his desktop and for which he wants to keep a shortcut.

Edit : I said that, 'cuz I have nothing else to say and that I don't like posting simple "Like it" messages.

Edited by Negi, 17 August 2013 - 03:02 AM.


#12 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 13 August 2013 - 10:14 PM

View PostNegi, on 13 August 2013 - 05:35 AM, said:

I like the whole thing, just that, for the logo, may you should replace the grass block by a crafting table.
I had that thought too, but the "Craft" part of the name stems from "Minecraft", which more often than not, when not symbolized by the iconic title text, is symbolized by a dirt block, so there's my logic there.

View PostNegi, on 13 August 2013 - 05:35 AM, said:

And give an option in Pulse for quick shutdown, like a status bar with "Shutdown", "Reboot" buttons and may a "Menu" were the user could register programs that he don't wants on his desktop and for which he wants to keep a shortcut.
The taskbar is to be reserved for tasks. Nothing more, nothing less.

Also, for the record, "pulse" is only a program that turns a lamp on and off. I use it to test the persistence of timer events in programs.

#13 DarkEspeon

  • Members
  • 57 posts

Posted 13 August 2013 - 11:10 PM

View PostKingdaro, on 13 August 2013 - 10:14 PM, said:

View PostNegi, on 13 August 2013 - 05:35 AM, said:

I like the whole thing, just that, for the logo, may you should replace the grass block by a crafting table.
I had that thought too, but the "Craft" part of the name stems from "Minecraft", which more often than not, when not symbolized by the iconic title text, is symbolized by a dirt block, so there's my logic there.

View PostNegi, on 13 August 2013 - 05:35 AM, said:

And give an option in Pulse for quick shutdown, like a status bar with "Shutdown", "Reboot" buttons and may a "Menu" were the user could register programs that he don't wants on his desktop and for which he wants to keep a shortcut.
The taskbar is to be reserved for tasks. Nothing more, nothing less.

Also, for the record, "pulse" is only a program that turns a lamp on and off. I use it to test the persistence of timer events in programs.

Actually in 1.6 minecraft is now represented by a crafting table, so maybe switch it up?

#14 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 14 August 2013 - 02:08 AM

Noice.
I like how you can choose the different 'shell tabs'. It's great!

Keep up the good work!

#15 Grim Reaper

  • Members
  • 502 posts
  • LocationSeattle, WA

Posted 14 August 2013 - 10:38 AM

I don't really see what the big deal is about the logo for this program. So what if it's a block of dirt? If you're using this program, then you should probably be paying more attention to the functionality, not the logo.

Great program, though :)

#16 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 14 August 2013 - 03:15 PM

Heh, yeah. The logo is only there to make my post look pretty.

Thanks DE, AutoLocK and Grim.

#17 DarkEspeon

  • Members
  • 57 posts

Posted 14 August 2013 - 04:27 PM

So King, how did you make the tab system, I have never found out how to do that its a cool feature. I would love it if you could pm me and tell me how you did it. Thanks

#18 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 14 August 2013 - 05:31 PM

View PostDarkEspeon, on 14 August 2013 - 04:27 PM, said:

So King, how did you make the tab system, I have never found out how to do that its a cool feature. I would love it if you could pm me and tell me how you did it. Thanks
A PM isn't necessary. Free information for everyone!

So basically, I have a table of tasks. Tasks are, to me, what you refer to as a tab. A task has the following properties: position x and y, width, height, a name, and a "run" coroutine, which is the task's program. One of these task is marked as active, simply through an "activeTask" variable.

When a task is created, the run function that is converted into a coroutine is basically just a shell.run() on whatever program you run. The coroutine is created, and stored in the task as task.run.

In my main event loop, the first thing I do every loop is draw everything. This is where I draw the panel's tasks in the panel's table of tasks, one by one.

The next thing I do in the event loop is the usual os.pullEvent. I pass the results from os.pullEvent into every task, and every task resumes its coroutine with these results. I only pass input events (key, char, mouse_click, etc.) into the active task, and every other event to every task.

Before resuming a coroutine, I redirect the terminal to the task's buffer, which is a fancy name for a screen that can be drawn on, but doesn't show until you actually draw that screen. The drawing operations of each task will show up in its buffer, and I draw the active task's buffer to the screen every loop.

As for the non-technical side of tasks, every time a task is added or removed, I change the task's x and width properties so they all stretch across the width of the panel.

I hope I explained everything well.

#19 DarkEspeon

  • Members
  • 57 posts

Posted 14 August 2013 - 08:42 PM

oh i never thought of using coroutines... thank you so much kingdaro. This gives me a few ideas of how i can do my own os eventually.

#20 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 17 August 2013 - 06:25 AM

Really nice job you did there! People really learn from your programs, also the documentation and replies help alot





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users