joshiemoore / snakeware Goto Github PK
View Code? Open in Web Editor NEWA free Linux distro with a Python-based userspace
License: MIT License
A free Linux distro with a Python-based userspace
License: MIT License
It would be interesting if you could press a button in the menubar of an app, and it opens a text editor that you can use to edit that app.
As Python is an interpreted language this can be quite useful.
CPU app shows only graph with no label as to what fluctuations depict
Whenever I try to build an image, it fails during compilation of host-cdrkit
.
Entire output is here.
Currently snakeware boots as a "Live USB" and user data does not persist between boots. We need a good way to store user data persistently.
I really like the idea of having a "ROM partition" of a few hundred MB where the snakeware distro is installed (this would allow different snakeware versions to be swapped easily just by overwriting the partition), and a separate "user partition" which fills the rest of the medium and can be used to store scripts, data, etc. This partition would be mounted and changedir'd to on boot.
I'm going to be the one that works on this, but ideas are welcome if anyone has any
It would be nice to have a system api to expose to app devs.
Lets say someone makes an app to tune volume. Instead of he writing his method, he just uses the system way of changing sound. We don't need everything but at least some system things
Also for storage, was thinking of having sqlite to store system info, using sqlalchemy
Hey Everyone,
I have made a sample website for the OS.
I would appreciate if you guys can have a look at it,
I would be happy to receive suggestions.
Here is the link:-
https://adityaj7.github.io/snakeware.github.io/
I'd like to try myself at this (unless someone has already started).
For the start, I thought to keep it simple:
Things/Ideas for later (in no special order):
Not an issue per-se, but an idea about the release artifacts, specifically the raw disk image file:
dd
it to a physical drive;Refering #47
Refers to commodore64 logo and theme. The double slits of c64 coincidentally represents a snake's tongue. The lines are a reference to slackware meaning a Linux distro
Hello, I was going to try your new OS on VirtualBox, but it wasn't clear how to do so with a .img file. Any suggestions?
Hey, I was trying to build the image so I could test my changes in a qemu to see if it worked reliably with snakeware, but every time the build fails when trying to install GRUB.
Looks like it's failing to mount the EFI partition correctly. Could ths be because I already had some folders there for my NAS?
SnakeWM.run()
Traceback
TypeError: run() missing 1 required positional argument: 'self'
Awesome project. I'm running it right now π Just a couple things I noticed while rummaging around:
Definitely interested in taking a wack at it this weekend, but wanted to check if there's any work being done on this before I get started.
Hi,
To get the build working on Ubuntu 18-04, I had to add:
sudo apt-get install libelf-dev
Then it finished but with one error: create: command not found
, but I guess just a missing comment
0+0 records in
0+0 records out
0 bytes copied, 0.0003471 s, 0.0 kB/s
./build.sh: line 47: create: command not found
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x6f584148.
Command (m for help): Created a new DOS disklabel with disk identifier 0x9431d0e0.
Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-819199, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-819199, default 819199):
Created a new partition 1 of type 'Linux' and of size 399 MiB.
Command (m for help): Selected partition 1
The bootable flag on partition 1 is enabled now.
Command (m for help): The partition table has been altered.
Syncing disks.
A virtual block device has been created for snakeware.img.
Use lsblk to find the number of this device and run ./img_final.sh <num>
Example: ./img_final.sh 0 for loop0
Using Ubuntu 18.04, it downloaded a lot of things then crashes with:
...
usr/share/man/man1/python3.1 -> python3.8.1
usr/share/man/man1/python3.8.1
sent 326.07M bytes received 170.24K bytes 217.49M bytes/sec
total size is 325.30M speedup is 1.00
Installing for i386-pc platform.
grub-install: error: hostdisk//dev/loop0 appears to contain a squash4 filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
umount: /mnt: not mounted.
loop deleted : /dev/loop25
The current build implementation leverages kpartx
and loop devices to copy the rootfs contents to the final disk image, together with a manual step of determining the loop device index.
Instead, we could use FUSE and/or libguestfstools and have the build process work strictly in userspace.
This would add another build dependency.
Also, I'm not sure how this would work with grub-install
(I hope it will just work), since I previously had issues with grub-install
on loop device partitions and had to add another level of abstraction using nbd
.
I'll try to investigate this myself and report here anything useful that I find.
It's my understanding that this is currently a single-process application? I think that rpyc would be a pretty good way to handle IPC, it lets you expose python objects transparently over network connections, basically importing python objects from other processes and having everything more or less just work.
I'm imagining that all your apps export not only their user interface, but also an API.
Of course this is still early in the project, and it would complicate the implementation immensely. Still, maybe something to think about.
Working on adding a manager for key bindings.
Can Assign the issue to me if needed.
Make RaspberryPy real.
I'm trying to work on a web browser and I was wandering if it is possible to add a new package into the snakewm like requests
Currently snakeware only uses US qwerty keymap.
We should be able to set the keymap easily either once booted, or at boot time via grub, or at build.
Without different keymaps, it will be hard to get contributors from outside US (I'm French, I'm a python developer, but once in the snakeware python shell, it is unusable without brain torture to remap mentally...).
In your current build scripts, you seem to be just copying system libraries & hoping for the best, which can fail if the host system is subtly different from what you're using.
To make this better, I suggest using something small like Buildroot or KISS Linux.
Buildroot is the most mature of the two, and is specifically designed for building embedded Linux systems, which seems like a close goal to what you're doing here. It also has a lot of configuration options and build scripts for a lot of packages, including Python, which can make it feel complicated.
KISS is newer and less mature, but is very simple to understand, as most of the system is good old shell scripts & Busybox. However, it's not designed for a specific purpose like Buildroot, so it would probably only be used as a consistent base system (in a chroot or something similar) for the actual hand crafted build scripts.
So, if you want a robust build system, I'd recommend you go with Buildroot or something similar to it, but if you want your build system to be small, you can try messing around with something like KISS.
I am trying to run wm.py on macOS. I ran pip3 install pygame but I still receive the error "ImportError: No module named pygame"
Is there anything else I need to do to get this running?
I have written a game with python and pygame.
Do take a look.
Itβs a fairly medium sized project. If you like the project a lot, you could integrate it within your Snakeware Project. And you had mentioned that some changes will be needed to make it work in your project. If you like my project, we can work together to to integrate it in yours.
As the distribution grows, it may stop making sense to package all apps into it. What kinds of package management solutions make sense for this project?
My preliminary thoughts are:
Packages are maintained in their own repo by their respective maintainers. There is one central repository that hosts package metadata (maybe JSON?) of 'approved' packages. The package manager syncs to the master list (with the option of using other package lists?) and uses the metadata to resolve dependencies, clone and install applications, etc.
Related to #46 and more broad, i think a logo might be nice ^^_
I am very very much excited about this project and want to know a place to discuss / communicate/ get involved into snakeware, other than sending issues or pull requests.
Is there an official (beginner friendly) forum / place in the internet ?
We have released a Raspberry Pi 4 image in v0.0.5, and everything runs and works. However, the performance in SnakeWM is noticeably sluggish. I have been testing snakeware on a 2004 ThinkPad that has similar specs to the RPi 4 (and half the RAM) and it runs fine, but the performance on the Pi is significantly worse. On desktop SnakeWM runs at a pretty consistent 60FPS at idle, but on the Pi the FPS drops to ~45 idle.
This is the most significant setback we have yet faced, as I believe snakeware would excel on these SBCs if we could work out the performance issues. The basic apps like snakecalc run fine, but any graphic-intensive apps like dazzler or the dynamic backgrounds really bring the system to a crawl.
I am now running a very aggressive overclock on my Pi locally, here are the relevant performance options I have set in config.txt
:
gpu_mem=512
over_voltage=6
arm_freq=2140
gpu_freq=750
This overclock helps quite a bit, and brings the idle FPS up to ~55, but it is still noticeably sluggish when running apps.
snakeware is very snappy and fun on desktop, and I think that it will be really special if we can bring this experience to the Pi as well. Please share any ideas on this issue, or open a PR if you find a good performance tweak. It's clear that "overclock the crap out of it" is not going to solve all of our problems, and that additional underlying changes will be required to achieve performance that comes close to desktop.
a way to connect any "consumer"(editors, like #17 ?) and any "producer" (file managers, like #11).
my thoughts thus far:
either: a (singleton / static) class as middleware
Middleware.open
method
or as custom event (like pygame_gui extends pygames user events). But there must be a clever way, to avoid having an instance of all apps
That said, I have no idea how others have done this.
Any ideas are welcome.
Greetings,
I'd be grateful if i can be assigned to build the live chat app for
snakeware users, thanks!
It would be really user friendly to be able to choose ipython or bpython as default shell instead of the raw python shell.
I have tested the shutdown and reboot dialogs on my host Arch install, while running snakeware in a VM, and running snakeware on real hardware, and they don't seem to work in any of these configurations.
However, if I run os.system("/sbin/reboot -f")
(or shutdown) from the interpreter, this operation works as expected.
It will be helpful if you added Documentation to all modules. I would recommend using sphnix to generate documenation from code.
I think it would be helpful to start a wiki. Arch linux is well documented due to ArchWiki. I think that would be a good model.
While the C64 Basic interpreter was also a code editor, it would be great to add to snakeware a code editor to load/write/save programs. Not sure what is easier... use nano or write a pygame editor ?
Hi,
Snakeware is really a great idea!
I guess having a full network support will be a pain but at least to support local wheel installation would be great. I also expect some wheels won't work but I guess it will be ok for vanilla python libraries ?
I'm running snakeware0-0-3.img
on Debian buster (stable) using QEMU version 3.1.0. I started up snakewm using
from snakewm.wm import SnakeWM
SnakeWM().run()
and ran snaketerm
from the menu. When I entered help()
into the input box and pressed Enter, the system seemed to freeze: nothing showed up in the console output, keyboard or mouse inptu had no effect, and pressing Alt+Esc did not exit snakewm. I have to reset the machine in QEMU to get it to restart. I've repeated these steps to make sure this is a reproducible bug.
Hello @joshiemoore
first of all, I enjoy the work with snakeware. For having even more fun having network / Internet applications in snakeware would boost for the creativity of developers and give a huge improvement to the OS. To get this, I suggest the integration of a minimal network stack consisting of following parts:
With this setup, the web browser (#134) would run on snakeware and a Python IRC-client could by integrated to visit the snakeware IRC room directly from the OS.
Regards,
Oliver
Currently the only part of the build process that happens outside of buildroot is the installation of pip modules in post-build.sh
. This script executes the compiled python3 binary and has it install the pip modules specified in config/pip_modules.txt
. This works fine when building for x86_64, but will not work when trying to cross-build for Raspberry Pi or other systems.
I have scoured the net and not found a good, modular, and extensible way to install external pip modules in buildroot. I found some tools online that seemed like they would do what we're looking for, but I wasn't able to make any of them work. If anyone has any ideas for this, please share them or submit a PR.
I don't want anyone to have to manually write a bunch of configs to add another pip module to the build. They should basically be able to just add the desired module to the list, and it gets installed in the build (like the behavior now).
Once we have networking all set, we could have it automatically install a list of external pip modules on first boot or something like that (this would keep distro images small), but I think I would prefer to just install them at build-time.
In the readme's todo list there is currently an entry for replacing busybox's init with a python based solution.
Although there are quite a few init systems out there, not many of them are written in python.
I looked around a bit and found some OSS projects that fit the description, although not all of them would work as a drop-in replacement for the current init:
I'm just writing this down in case someone else looks at init and wonders what pure python implementations are already out there.
[1] https://github.com/Supervisor/supervisor
[2] https://github.com/pisilinux/mudur
Greetings,
Can it be run on the Pi?
Make it easier to communicate with everyone and share ideas etc
Just a few issues I ran across when building an image from scratch. It would be best to check for them at the beginning of build.sh before a git-clone is issued or any other work is done
Suggest adding a single folder to hold all files. Easier to gitignore than to let people have their own filespace. We then associate files to apps. Apps refer to files via the API.
For global settings also we provide an API. #27
In case somebody is interested, the image works perfectly with VMWare Player (tested on Linux/Ubuntu 18.04):
sudo apt-get install qemu-utils
qemu-img convert -O vmdk snakeware.img snakeware.vmdk
Then create a VM without any OS, remove the default disk and add this VMDK image.
You won't be able to resize the window but good for testing!
Hi! My name is Denis, and I tried to build snakeware on my MacBook. But I have had some issues:
sed
utility which is obviously in Makefile in snakeware/snakeware/buildroot
may not be used on macOS with option -r
. The issue show itself like this:(base) user@omelched-MacBook snakeware % sudo ./build.sh x86-64
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
-E
and replacing that Makefile line 349: sed -n -r...
with sed - n -E...
solved that problem for my case.make
based on which OS you are building on.Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
/Applications/Xcode.app/Contents/Developer/usr/bin/make -j1 O=/Users/user/git_repo/snakeware/snakeware/buildroot/output HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
You must install 'gcc' on your build machine
/usr/bin/gcc
that would be Clang:(base) user@omelched-MacBook snakeware % /usr/bin/gcc
clang: error: no input files
Anyway, I'll do my best to help you with this interesting project!
Hey, how would I shutdown the snakeware system? Running os.system("/sbin/shutdown") in the Python console does not work, and there is currently no way to shutdown the system from snakewm (though I am going to make one), so I am currently relying on force shutdowns, which I would rather not use. So if you could please tell me how to shutdown the system, so I could then build a button for it in snakewm.
As I am developing an app for snakeware I realised that my app was not compatible with the version of pygame gui that snakware uses. (My bad!) The app is several thousand lines of code already. If there was a way to update pygame and pygamegui in sankeware that would get this app into snakeware.
I have successfully built a snakeware ISO with the required pygame gui version (0.5.7) but snakewm won't load when I boot into the iso.
I am a noob when it comes to build root but if there is a way to debug snakewm within snakeware that would be a good first step.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.