this is going to be my last devlog before I ship tundra, i’m really proud of how far it’s come and the fact that i’ve actually managed to finish a project for once! I didn’t quite get to add everything I wanted but most of it is there
i added a real simple text editor that can save and load files from the “disk”. i don’t really have anything else to say about it 
in order for the text editor to work properly, I had to make save and open dialog boxes. these are basically an unholy frankenstein of the normal dialog box and the file browser app, and they work well enough
using JSON and the world’s jankiest serialization/deserialization system I was able to save the user’s filesystem state to localStorage so that even of you reload or close the page, your precious writing will be preserved 
real operating systems don’t open straight to the desktop - theres a whole boot sequence that leads to this (and if you’re cool and use linux it’s all on display for you). inspired by @cooki’s FPS-OS (go check it out it’s really cool) i added a boot screen that looks pretty alright I guess.
finally, I got around to adding icons for each app. they’re 16x16, made in aseprite over the course of about 10 minutes, and work just enough that I don’t need to redesign them constantly.
this is a bit of a shorter devlog since I basically only added one thing - a functioning shutdown sequence! first a little dialog pops up asking if you’re sure, and then the whole screen goes black and says “shutting down…”, finally followed by an elite reference (Progressbar95 players rise up!)
i haven’t really added much for 2 hours of work - mostly just camera stuff and sounds
the camera now follows the bullet meaning you can do really cool long distance trick shots like the one in the video! i also made it so that only one bullet can be shot at a time to avoid any weird bugs. the camera follow script uses a lot of lerping to make sure it’s buttery smooth
i generated some sound effects for when you shoot, when a bullet hits a wall, and when an enemy is destroyed, in jsfxr which you can’t hear in the recording (but trust me, they sound good!)
its been ages since i’ve tried to make a game and i’ve never actually finished one yet, so i guess lets try make one in a month!
my idea is a super simple minigolf game - except there’s just one difference: guns. that’s right, minigolf with bullets instead of golfballs! i’ve decided to name it “Rick O’Shea’s Bullet Golf” because 1) Rick O’Shea sounds like he could probably be a pro golfer, and 2) it rhymes with ricochet.
so far, i’ve added a player that looks at your cursor (who knew trigonometry would actually be useful?), which spawns bullets that fly into the direction of your cursor. the bullets can also bounce off of walls and hit enemies, and once all the enemies are dead you win.
i’m really looking forward to seeing this game through and i have a ton of ideas to implement over the next month or so
after like a month-long hiatus i thought that i ought to add a few more apps - this is meant to be somewhat useful after all!
this is a really basic calculator app, basically when you press a button it adds its value (like 2 or + or .) to an expression, and when you hit the = button it evaluates the expression with eval(). yes, i know its not the safest but it works.
this one is also really simple: every time you press a key on your keyboard, a new random colour is generated and the rgb and hex values are shown in the bottom. need i say more?
once again, this is really basic. all it does is gets the contents of the current directory (i had to make a new fs function to return each path’s type as well) and then makes a new element for each path with an icon corresponding to what it is. there’s also a back button if you need to… well.. go back
we’re now shifting from the realm of “experimental” to “experimental but usable”. i’ve added a ton of new features recently and i’m really happy with how nwwm is coming together.
i’ve added 2 new tiling layouts: monocle, and master/stack. monocle is the easiest to understand: all windows are the same size as the screen, and the currently focused window is brought to the front. master/stack is the traditional layout you see in wms like dwm, where there is a “master” window that takes up half of the screen and the rest split vertically (or “stack”) on the other half of the screen. i also added keybinds that switch between layouts
previously, the keybind system was just using raw x11 keycodes which were really annoying because they don’t match up with any other system (25 = w??) and are keymap-dependant. so, i switched to using xkbcommon and now keybinds are defined with more human-readable keysyms like KEY_w or KEY_Return.
i also implemented a small command runner system so now you can launch commands with keybinds. so far i’ve set Mod+Enter to launch kitty and ofc these will all be configurable through the config file
i spent ages trying to debug some weird behaviour where bound keys wouldn’t register as keypresses if no windows had been opened in nwwm yet. after a lot of trial and error, and a few ChatGPT therapy sessions, i discovered that my error was one letter: i had keyboard_mode in the global mouse grab (which i need for click to focus) set to GrabMode::Sync instead of GrabMode::Async (fml)
how many times can i call conn.send_request() in one program??
i made a struct called Config which the wm owns, and it has values like border width, color, and keybinds. eventually it will read from a config.toml file but for now it’s all hard coded in the source code.
windows now have borders with color and width deriving from the Config (meaning they’ll be configurable through a config file at some point!). also, the currently focused window has a different border color (also configurable!)
instead of hard-coding keybinds, i gave Config a child called Keybinds, which are hard coded in the source code… but eventually they’ll be part of the config file. when each keybind is called, it calls an Action which is linked to a function call in the wm. later there’ll be plenty of actions for anything you can think of, but for now theres only FocusNext which… focuses the next window!
x11 is an ancient beast, full of mismatched types (screen height is a u16, window height is a u32, window position is an i32, etc), difficult protocols, and more double colons than you can shake a stick at, but i’m working through it.
i started off by storing a list of open workspaces in the main wm struct, and each workspace has a list of open windows (and a tiling layout). then, i made the wm listen for DestroyNotify events and remove them from their respective workspaces. soon after marvelling at my creation i realised that i could only see one window at a time, so i worked on implementing a basic tiling algorithm. so far, all i have is columns (window_width = screen_width / num_of_windows) but i’m working on adding master-stack tiling (what dwm uses)
i also realised that it’s no use having multiple windows if you can only use type on one, so i made each window grab the left click, and then listen for ButtonPress events, focusing the clicked window.
what’s an operating system if you can’t have files? so, i decided to write a basic filesystem for tundra. paired with a simple terminal and now tundra is actually kind of cool!
tundra uses a really simple filesystem model: there’s a File and a Directory class that both inherit from FSNode, Files have names and contents and Directories have names and children. tundra uses a traditional unix file layout (/home, /bin, /etc and so on) because its cool.
i really wanted some way to navigate the filesystem but didn’t feel like implementing an entire file browser so I added a simple terminal. it has a few methods like writeln and readline which you can use. all the commands (including the shell!) are defined in their own classes, just like apps, which makes it really easy to add new ones. so far, i’ve added cd, ls, mkdir, touch, cat, and my own version of neofetch.
after working on tundra I decided that I wanted to make a window manager for an actual os instead, so I loaded arch onto an old macbook and got started.
I initially started by loosely following a tutorial that uses xlib for rust, but I soon realised that any direct mapping to C from rust is going to be an absolute horror to use (literally every function call had to be unsafe), so I switched to xcb. it has a slightly different API but it’s cleaner and i3 uses it so it must be good.
my devlogs from here on are going to be getting a lot longer now because i’m really settling into the grind, so i’m going to try out a more structured format.
i implemented a whole dialog box system into caribou (the window manager). so far it only has confirm (cancel/ok) style dialogs but it’s modular so i’ll be sure to add plenty more in the future. dialogs return promises that resolve with a value when an action happens (like when the dialog is closed), and this can then be used to execute code. this all came about because i wanted to add fullscreen mode but apparently browsers don’t like it when you request fullscreen without user interaction so here we are!
the changelog, as promised, pulls directly from github to ensure you always get the most up-to-date changes with minimal effort on my end ! it uses marked and DOMPurify to parse the CHANGELOG.md from the repo and to make sure you are personally secure from anyone who’s dumb enough to waste their time trying to attack tundra.
soon, i’ll work on adding themes to tundra so i decided i’d make it a bit easier for myself by making every single value that might want to be changed in css a variable. this was excruciatingly painful but we got through it in the end (it took like 10 minutes max). also, the background is now loaded dynamically through js which will lead to custom backgrounds at some point (much to the dismay of my browser’s performance)
tundra is starting to take off! i’ve changed the look of the taskbar very slightly (there’s now more padding), and i’ve also revamped the appdrawer so that it looks cleaner (and more like SerenityOS). also, submenus! now the appdrawer can be more organised as I continue to add apps instead of turning into a wastebin of buttons.
i deleted all of the original apps and have replaced them with (so far) an updated welcome/about (with wally, the derpy walrus who’s tundra’s new mascot), a proper changelog (eventually i’ll make it pull from github but for now it’s hardcoded), and a cube to test out threejs.
i decided that it’s probably a good idea to be able to see what apps you have open, so i implemented a little window list in the status bar. it’s pretty rudimentary - it just makes an element for each open window and updates any time a window is added or removed. eventually i’ll get around to adding window logos and context menus that let you close and minimise windows from the taskbar but that’s a bit advanced for the minute.
i decided i wanted to make tundra look a bit like serenityOS, so i modified the window header to include the distinctive red gradient. i also added a proper focusing system which required a decent rewrite of a portion of caribou (the wm).
also, i worked on centralising the wm. previously, windows handled their own focusing and closing but since i’ve discovered customevents windows now request this behaviour from the wm. finally, windows now auto-focus when you open them!
after much tedious work i added 2 other apps: a notes app that currently has a small TODO list and a changelog; and an image viewer that shows off a random image i’ve taken.
i’ve also prettied the whole thing up a little bit by changing the font from [default] to Cozette, a nice cozy bitmap-ish font.
finally, i added an app drawer so you can open all the (3) apps available in v0.1.0! i’m really looking forward to adding tons of new features and making it look super awesome!
windows and apps are now instanced and defined purely in their own classes in javascript instead of being predefined in HTML and shown / hidden. i know it’s not strictly part of the mission for WebOS 1 but it makes me feel a bit better about myself AND it’ll make things a whole lot easier for me down the line. since apps are instanced, i can have as many welcomes as i want !
i started working on the first iteration of caribou - tundra’s window manager (aka a window class and a list of open windows). so far, windows can be dragged around using some very janky freestyled code, and can also be closed (one of the can even be opened again !). it’s currently looking quite… webby, so next i’ll probably work on making it look a bit more personal (maybe a bit like my personal homepage??)
building my own OS has been a dream of mine for a long, long time but i’ve never actually been able to make one before (because i know next to nothing about low-level programming). so imagine my reaction when i saw that i could get 50 stardust for making one? well, one small catch. it had to be a web-based OS. wait, is that really a catch though? its like a thousand times easier, and has just enough instant gratification for my short-form content-fried dopamine-addicted brain. so here we are. so far, tundra has a window and a status bar, and thats about it (also, the wallpaper is a photo i took down at the beach today !). i’m really looking forward to adding a ton more features to tundra in the future.